From 0d408aa2af08a0c39c5165237e697d9a1c48111b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 5 Jan 2026 22:30:58 +0000 Subject: [PATCH 1/2] feat: add custom prompt config in the request and return prompt in the response feat: update min_speaker_count and max_speaker_count to be optional docs: Clarify that min_speaker_count and max_speaker_count in SpeakerDiarizationConfig are not currently used docs: Update guidance on how to enable speaker diarization; to enable, set the diarization_config field to an empty SpeakerDiarizationConfig message PiperOrigin-RevId: 852383212 Source-Link: https://github.com/googleapis/googleapis/commit/1a141530079896691c100e0624705f2e0923f864 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c84243caa11c7fc89056e0bd07b4c4c6aea0510b Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN1cHBvcnQvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhbGVudC12NC8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhbGVudC12NGJldGExLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhbGVudC8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLXYyLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLXYyYmV0YTIvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLXYyYmV0YTMvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRhc2tzLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRlbGNvX2F1dG9tYXRpb24tdjEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRlbGNvX2F1dG9tYXRpb24vLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRleHRfdG9fc3BlZWNoLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRleHRfdG9fc3BlZWNoLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImM4NDI0M2NhYTExYzdmYzg5MDU2ZTBiZDA3YjRjNGM2YWVhMDUxMGIifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRleHRfdG9fc3BlZWNoLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRwdS12MS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRwdS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYWNlLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYWNlLXYyLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYW5zbGF0ZS12My8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXRyYW5zbGF0ZS8uT3dsQm90LnlhbWwiLCJoIjoiYzg0MjQzY2FhMTFjN2ZjODkwNTZlMGJkMDdiNGM0YzZhZWEwNTEwYiJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZpZGVvLWxpdmVfc3RyZWFtLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJjODQyNDNjYWExMWM3ZmM4OTA1NmUwYmQwN2I0YzRjNmFlYTA1MTBiIn0= --- .../google-cloud-support/.gitignore | 22 + .../google-cloud-support/.repo-metadata.json | 17 + .../google-cloud-support/.rubocop.yml | 39 + owl-bot-staging/google-cloud-support/.toys.rb | 28 + .../google-cloud-support/.yardopts | 11 + .../google-cloud-support/AUTHENTICATION.md | 122 + .../google-cloud-support/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-support/Gemfile | 28 + .../google-cloud-support/LICENSE.md | 201 + .../google-cloud-support/README.md | 142 + owl-bot-staging/google-cloud-support/Rakefile | 169 + .../google-cloud-support.gemspec | 27 + .../lib/google-cloud-support.rb | 19 + .../lib/google/cloud/support.rb | 269 + .../lib/google/cloud/support/version.rb | 26 + .../test/google/cloud/support/client_test.rb | 75 + .../test/google/cloud/support/version_test.rb | 26 + .../google-cloud-support/test/helper.rb | 25 + .../google-cloud-talent-v4/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-talent-v4/.rubocop.yml | 33 + .../google-cloud-talent-v4/.toys.rb | 28 + .../google-cloud-talent-v4/.yardopts | 12 + .../google-cloud-talent-v4/AUTHENTICATION.md | 122 + .../google-cloud-talent-v4/CHANGELOG.md | 2 + .../google-cloud-talent-v4/Gemfile | 11 + .../google-cloud-talent-v4/LICENSE.md | 201 + .../google-cloud-talent-v4/README.md | 154 + .../google-cloud-talent-v4/Rakefile | 169 + .../gapic_metadata.json | 164 + .../google-cloud-talent-v4.gemspec | 28 + .../lib/google-cloud-talent-v4.rb | 21 + .../lib/google/cloud/talent/v4.rb | 49 + .../lib/google/cloud/talent/v4/common_pb.rb | 79 + .../lib/google/cloud/talent/v4/company_pb.rb | 48 + .../google/cloud/talent/v4/company_service.rb | 55 + .../cloud/talent/v4/company_service/client.rb | 909 ++++ .../talent/v4/company_service/credentials.rb | 52 + .../cloud/talent/v4/company_service/paths.rb | 69 + .../cloud/talent/v4/company_service/rest.rb | 52 + .../talent/v4/company_service/rest/client.rb | 831 +++ .../v4/company_service/rest/service_stub.rb | 388 ++ .../cloud/talent/v4/company_service_pb.rb | 59 + .../talent/v4/company_service_services_pb.rb | 54 + .../lib/google/cloud/talent/v4/completion.rb | 55 + .../cloud/talent/v4/completion/client.rb | 510 ++ .../cloud/talent/v4/completion/credentials.rb | 52 + .../cloud/talent/v4/completion/paths.rb | 69 + .../google/cloud/talent/v4/completion/rest.rb | 52 + .../cloud/talent/v4/completion/rest/client.rb | 460 ++ .../talent/v4/completion/rest/service_stub.rb | 142 + .../cloud/talent/v4/completion_service_pb.rb | 53 + .../v4/completion_service_services_pb.rb | 46 + .../lib/google/cloud/talent/v4/event_pb.rb | 48 + .../google/cloud/talent/v4/event_service.rb | 55 + .../cloud/talent/v4/event_service/client.rb | 488 ++ .../talent/v4/event_service/credentials.rb | 52 + .../cloud/talent/v4/event_service/paths.rb | 50 + .../cloud/talent/v4/event_service/rest.rb | 52 + .../talent/v4/event_service/rest/client.rb | 438 ++ .../v4/event_service/rest/service_stub.rb | 143 + .../cloud/talent/v4/event_service_pb.rb | 49 + .../talent/v4/event_service_services_pb.rb | 51 + .../lib/google/cloud/talent/v4/filters_pb.rb | 58 + .../google/cloud/talent/v4/histogram_pb.rb | 43 + .../lib/google/cloud/talent/v4/job_pb.rb | 52 + .../lib/google/cloud/talent/v4/job_service.rb | 56 + .../cloud/talent/v4/job_service/client.rb | 2062 ++++++++ .../talent/v4/job_service/credentials.rb | 52 + .../cloud/talent/v4/job_service/operations.rb | 841 +++ .../cloud/talent/v4/job_service/paths.rb | 88 + .../cloud/talent/v4/job_service/rest.rb | 53 + .../talent/v4/job_service/rest/client.rb | 1949 +++++++ .../talent/v4/job_service/rest/operations.rb | 925 ++++ .../v4/job_service/rest/service_stub.rb | 698 +++ .../google/cloud/talent/v4/job_service_pb.rb | 86 + .../talent/v4/job_service_services_pb.rb | 90 + .../lib/google/cloud/talent/v4/rest.rb | 41 + .../lib/google/cloud/talent/v4/tenant_pb.rb | 45 + .../google/cloud/talent/v4/tenant_service.rb | 55 + .../cloud/talent/v4/tenant_service/client.rb | 897 ++++ .../talent/v4/tenant_service/credentials.rb | 52 + .../cloud/talent/v4/tenant_service/paths.rb | 64 + .../cloud/talent/v4/tenant_service/rest.rb | 52 + .../talent/v4/tenant_service/rest/client.rb | 819 +++ .../v4/tenant_service/rest/service_stub.rb | 388 ++ .../cloud/talent/v4/tenant_service_pb.rb | 59 + .../talent/v4/tenant_service_services_pb.rb | 53 + .../lib/google/cloud/talent/v4/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/talent/v4/common.rb | 959 ++++ .../google/cloud/talent/v4/company.rb | 123 + .../google/cloud/talent/v4/company_service.rb | 133 + .../cloud/talent/v4/completion_service.rb | 148 + .../google/cloud/talent/v4/event.rb | 179 + .../google/cloud/talent/v4/event_service.rb | 42 + .../google/cloud/talent/v4/filters.rb | 392 ++ .../google/cloud/talent/v4/histogram.rb | 72 + .../proto_docs/google/cloud/talent/v4/job.rb | 392 ++ .../google/cloud/talent/v4/job_service.rb | 929 ++++ .../google/cloud/talent/v4/tenant.rb | 50 + .../google/cloud/talent/v4/tenant_service.rb | 121 + .../google/longrunning/operations.rb | 191 + .../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/latlng.rb | 38 + .../proto_docs/google/type/money.rb | 43 + .../proto_docs/google/type/postal_address.rb | 135 + .../proto_docs/google/type/timeofday.rb | 45 + .../google-cloud-talent-v4/snippets/Gemfile | 32 + .../company_service/create_company.rb | 47 + .../company_service/delete_company.rb | 47 + .../snippets/company_service/get_company.rb | 47 + .../company_service/list_companies.rb | 51 + .../company_service/update_company.rb | 47 + .../snippets/completion/complete_query.rb | 47 + .../event_service/create_client_event.rb | 47 + .../snippets/job_service/batch_create_jobs.rb | 54 + .../snippets/job_service/batch_delete_jobs.rb | 54 + .../snippets/job_service/batch_update_jobs.rb | 54 + .../snippets/job_service/create_job.rb | 47 + .../snippets/job_service/delete_job.rb | 47 + .../snippets/job_service/get_job.rb | 47 + .../snippets/job_service/list_jobs.rb | 51 + .../snippets/job_service/search_jobs.rb | 47 + .../job_service/search_jobs_for_alert.rb | 47 + .../snippets/job_service/update_job.rb | 47 + ...ippet_metadata_google.cloud.talent.v4.json | 895 ++++ .../snippets/tenant_service/create_tenant.rb | 47 + .../snippets/tenant_service/delete_tenant.rb | 47 + .../snippets/tenant_service/get_tenant.rb | 47 + .../snippets/tenant_service/list_tenants.rb | 51 + .../snippets/tenant_service/update_tenant.rb | 47 + .../talent/v4/company_service_paths_test.rb | 67 + .../talent/v4/company_service_rest_test.rb | 374 ++ .../cloud/talent/v4/company_service_test.rb | 409 ++ .../cloud/talent/v4/completion_paths_test.rb | 67 + .../cloud/talent/v4/completion_rest_test.rb | 159 + .../google/cloud/talent/v4/completion_test.rb | 174 + .../talent/v4/event_service_paths_test.rb | 55 + .../talent/v4/event_service_rest_test.rb | 154 + .../cloud/talent/v4/event_service_test.rb | 164 + .../talent/v4/job_service_operations_test.rb | 400 ++ .../cloud/talent/v4/job_service_paths_test.rb | 79 + .../cloud/talent/v4/job_service_rest_test.rb | 679 +++ .../cloud/talent/v4/job_service_test.rb | 798 +++ .../talent/v4/tenant_service_paths_test.rb | 67 + .../talent/v4/tenant_service_rest_test.rb | 373 ++ .../cloud/talent/v4/tenant_service_test.rb | 407 ++ .../google-cloud-talent-v4/test/helper.rb | 25 + .../google-cloud-talent-v4beta1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-talent-v4beta1/.rubocop.yml | 33 + .../google-cloud-talent-v4beta1/.toys.rb | 28 + .../google-cloud-talent-v4beta1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-talent-v4beta1/CHANGELOG.md | 2 + .../google-cloud-talent-v4beta1/Gemfile | 11 + .../google-cloud-talent-v4beta1/LICENSE.md | 201 + .../google-cloud-talent-v4beta1/README.md | 154 + .../google-cloud-talent-v4beta1/Rakefile | 169 + .../gapic_metadata.json | 164 + .../google-cloud-talent-v4beta1.gemspec | 28 + .../lib/google-cloud-talent-v4beta1.rb | 21 + .../lib/google/cloud/talent/v4beta1.rb | 49 + .../google/cloud/talent/v4beta1/batch_pb.rb | 41 + .../google/cloud/talent/v4beta1/common_pb.rb | 79 + .../google/cloud/talent/v4beta1/company_pb.rb | 48 + .../cloud/talent/v4beta1/company_service.rb | 55 + .../talent/v4beta1/company_service/client.rb | 920 ++++ .../v4beta1/company_service/credentials.rb | 52 + .../talent/v4beta1/company_service/paths.rb | 105 + .../talent/v4beta1/company_service/rest.rb | 52 + .../v4beta1/company_service/rest/client.rb | 842 +++ .../company_service/rest/service_stub.rb | 425 ++ .../talent/v4beta1/company_service_pb.rb | 59 + .../v4beta1/company_service_services_pb.rb | 54 + .../google/cloud/talent/v4beta1/completion.rb | 55 + .../cloud/talent/v4beta1/completion/client.rb | 516 ++ .../talent/v4beta1/completion/credentials.rb | 52 + .../cloud/talent/v4beta1/completion/paths.rb | 105 + .../cloud/talent/v4beta1/completion/rest.rb | 52 + .../talent/v4beta1/completion/rest/client.rb | 466 ++ .../v4beta1/completion/rest/service_stub.rb | 149 + .../talent/v4beta1/completion_service_pb.rb | 53 + .../v4beta1/completion_service_services_pb.rb | 46 + .../google/cloud/talent/v4beta1/event_pb.rb | 48 + .../cloud/talent/v4beta1/event_service.rb | 55 + .../talent/v4beta1/event_service/client.rb | 489 ++ .../v4beta1/event_service/credentials.rb | 52 + .../talent/v4beta1/event_service/paths.rb | 64 + .../talent/v4beta1/event_service/rest.rb | 52 + .../v4beta1/event_service/rest/client.rb | 439 ++ .../event_service/rest/service_stub.rb | 151 + .../cloud/talent/v4beta1/event_service_pb.rb | 49 + .../v4beta1/event_service_services_pb.rb | 51 + .../google/cloud/talent/v4beta1/filters_pb.rb | 58 + .../cloud/talent/v4beta1/histogram_pb.rb | 43 + .../lib/google/cloud/talent/v4beta1/job_pb.rb | 52 + .../cloud/talent/v4beta1/job_service.rb | 56 + .../talent/v4beta1/job_service/client.rb | 2083 ++++++++ .../talent/v4beta1/job_service/credentials.rb | 52 + .../talent/v4beta1/job_service/operations.rb | 841 +++ .../cloud/talent/v4beta1/job_service/paths.rb | 146 + .../cloud/talent/v4beta1/job_service/rest.rb | 53 + .../talent/v4beta1/job_service/rest/client.rb | 1970 +++++++ .../v4beta1/job_service/rest/operations.rb | 925 ++++ .../v4beta1/job_service/rest/service_stub.rb | 774 +++ .../cloud/talent/v4beta1/job_service_pb.rb | 84 + .../talent/v4beta1/job_service_services_pb.rb | 90 + .../lib/google/cloud/talent/v4beta1/rest.rb | 41 + .../google/cloud/talent/v4beta1/tenant_pb.rb | 46 + .../cloud/talent/v4beta1/tenant_service.rb | 55 + .../talent/v4beta1/tenant_service/client.rb | 899 ++++ .../v4beta1/tenant_service/credentials.rb | 52 + .../talent/v4beta1/tenant_service/paths.rb | 64 + .../talent/v4beta1/tenant_service/rest.rb | 52 + .../v4beta1/tenant_service/rest/client.rb | 821 +++ .../tenant_service/rest/service_stub.rb | 388 ++ .../cloud/talent/v4beta1/tenant_service_pb.rb | 59 + .../v4beta1/tenant_service_services_pb.rb | 53 + .../google/cloud/talent/v4beta1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/talent/v4beta1/common.rb | 955 ++++ .../google/cloud/talent/v4beta1/company.rb | 126 + .../cloud/talent/v4beta1/company_service.rb | 144 + .../talent/v4beta1/completion_service.rb | 154 + .../google/cloud/talent/v4beta1/event.rb | 188 + .../cloud/talent/v4beta1/event_service.rb | 43 + .../google/cloud/talent/v4beta1/filters.rb | 404 ++ .../google/cloud/talent/v4beta1/histogram.rb | 74 + .../google/cloud/talent/v4beta1/job.rb | 389 ++ .../cloud/talent/v4beta1/job_service.rb | 914 ++++ .../google/cloud/talent/v4beta1/tenant.rb | 81 + .../cloud/talent/v4beta1/tenant_service.rb | 123 + .../google/longrunning/operations.rb | 191 + .../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/latlng.rb | 38 + .../proto_docs/google/type/money.rb | 43 + .../proto_docs/google/type/postal_address.rb | 135 + .../proto_docs/google/type/timeofday.rb | 45 + .../snippets/Gemfile | 32 + .../company_service/create_company.rb | 47 + .../company_service/delete_company.rb | 47 + .../snippets/company_service/get_company.rb | 47 + .../company_service/list_companies.rb | 51 + .../company_service/update_company.rb | 47 + .../snippets/completion/complete_query.rb | 47 + .../event_service/create_client_event.rb | 47 + .../snippets/job_service/batch_create_jobs.rb | 54 + .../snippets/job_service/batch_delete_jobs.rb | 47 + .../snippets/job_service/batch_update_jobs.rb | 54 + .../snippets/job_service/create_job.rb | 47 + .../snippets/job_service/delete_job.rb | 47 + .../snippets/job_service/get_job.rb | 47 + .../snippets/job_service/list_jobs.rb | 51 + .../snippets/job_service/search_jobs.rb | 47 + .../job_service/search_jobs_for_alert.rb | 47 + .../snippets/job_service/update_job.rb | 47 + ..._metadata_google.cloud.talent.v4beta1.json | 895 ++++ .../snippets/tenant_service/create_tenant.rb | 47 + .../snippets/tenant_service/delete_tenant.rb | 47 + .../snippets/tenant_service/get_tenant.rb | 47 + .../snippets/tenant_service/list_tenants.rb | 51 + .../snippets/tenant_service/update_tenant.rb | 47 + .../v4beta1/company_service_paths_test.rb | 82 + .../v4beta1/company_service_rest_test.rb | 374 ++ .../talent/v4beta1/company_service_test.rb | 409 ++ .../talent/v4beta1/completion_paths_test.rb | 82 + .../talent/v4beta1/completion_rest_test.rb | 159 + .../cloud/talent/v4beta1/completion_test.rb | 174 + .../v4beta1/event_service_paths_test.rb | 67 + .../talent/v4beta1/event_service_rest_test.rb | 154 + .../talent/v4beta1/event_service_test.rb | 164 + .../v4beta1/job_service_operations_test.rb | 400 ++ .../talent/v4beta1/job_service_paths_test.rb | 97 + .../talent/v4beta1/job_service_rest_test.rb | 681 +++ .../cloud/talent/v4beta1/job_service_test.rb | 797 +++ .../v4beta1/tenant_service_paths_test.rb | 67 + .../v4beta1/tenant_service_rest_test.rb | 373 ++ .../talent/v4beta1/tenant_service_test.rb | 407 ++ .../test/helper.rb | 25 + .../google-cloud-talent/.gitignore | 22 + .../google-cloud-talent/.repo-metadata.json | 18 + .../google-cloud-talent/.rubocop.yml | 39 + owl-bot-staging/google-cloud-talent/.toys.rb | 28 + owl-bot-staging/google-cloud-talent/.yardopts | 11 + .../google-cloud-talent/AUTHENTICATION.md | 122 + .../google-cloud-talent/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-talent/Gemfile | 28 + .../google-cloud-talent/LICENSE.md | 201 + owl-bot-staging/google-cloud-talent/README.md | 142 + owl-bot-staging/google-cloud-talent/Rakefile | 169 + .../google-cloud-talent.gemspec | 27 + .../lib/google-cloud-talent.rb | 19 + .../lib/google/cloud/talent.rb | 436 ++ .../lib/google/cloud/talent/version.rb | 26 + .../test/google/cloud/talent/client_test.rb | 148 + .../test/google/cloud/talent/version_test.rb | 26 + .../google-cloud-talent/test/helper.rb | 25 + .../google-cloud-tasks-v2/.gitignore | 22 + .../google-cloud-tasks-v2/.repo-metadata.json | 18 + .../google-cloud-tasks-v2/.rubocop.yml | 33 + .../google-cloud-tasks-v2/.toys.rb | 28 + .../google-cloud-tasks-v2/.yardopts | 12 + .../google-cloud-tasks-v2/AUTHENTICATION.md | 122 + .../google-cloud-tasks-v2/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-tasks-v2/Gemfile | 11 + .../google-cloud-tasks-v2/LICENSE.md | 201 + .../google-cloud-tasks-v2/README.md | 154 + .../google-cloud-tasks-v2/Rakefile | 169 + .../google-cloud-tasks-v2/gapic_metadata.json | 98 + .../google-cloud-tasks-v2.gemspec | 30 + .../lib/google-cloud-tasks-v2.rb | 21 + .../lib/google/cloud/tasks/v2.rb | 45 + .../cloud/tasks/v2/bindings_override.rb | 75 + .../lib/google/cloud/tasks/v2/cloud_tasks.rb | 56 + .../cloud/tasks/v2/cloud_tasks/client.rb | 2259 ++++++++ .../cloud/tasks/v2/cloud_tasks/credentials.rb | 51 + .../cloud/tasks/v2/cloud_tasks/paths.rb | 90 + .../google/cloud/tasks/v2/cloud_tasks/rest.rb | 54 + .../cloud/tasks/v2/cloud_tasks/rest/client.rb | 2112 ++++++++ .../tasks/v2/cloud_tasks/rest/service_stub.rb | 1067 ++++ .../google/cloud/tasks/v2/cloudtasks_pb.rb | 70 + .../cloud/tasks/v2/cloudtasks_services_pb.rb | 206 + .../lib/google/cloud/tasks/v2/queue_pb.rb | 54 + .../lib/google/cloud/tasks/v2/rest.rb | 38 + .../lib/google/cloud/tasks/v2/target_pb.rb | 49 + .../lib/google/cloud/tasks/v2/task_pb.rb | 54 + .../lib/google/cloud/tasks/v2/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/tasks/v2/cloudtasks.rb | 375 ++ .../proto_docs/google/cloud/tasks/v2/queue.rb | 376 ++ .../google/cloud/tasks/v2/target.rb | 466 ++ .../proto_docs/google/cloud/tasks/v2/task.rb | 196 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../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/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../google-cloud-tasks-v2/snippets/Gemfile | 32 + .../snippets/cloud_tasks/create_queue.rb | 47 + .../snippets/cloud_tasks/create_task.rb | 47 + .../snippets/cloud_tasks/delete_queue.rb | 47 + .../snippets/cloud_tasks/delete_task.rb | 47 + .../snippets/cloud_tasks/get_iam_policy.rb | 47 + .../snippets/cloud_tasks/get_queue.rb | 47 + .../snippets/cloud_tasks/get_task.rb | 47 + .../snippets/cloud_tasks/list_queues.rb | 51 + .../snippets/cloud_tasks/list_tasks.rb | 51 + .../snippets/cloud_tasks/pause_queue.rb | 47 + .../snippets/cloud_tasks/purge_queue.rb | 47 + .../snippets/cloud_tasks/resume_queue.rb | 47 + .../snippets/cloud_tasks/run_task.rb | 47 + .../snippets/cloud_tasks/set_iam_policy.rb | 47 + .../cloud_tasks/test_iam_permissions.rb | 47 + .../snippets/cloud_tasks/update_queue.rb | 47 + ...nippet_metadata_google.cloud.tasks.v2.json | 655 +++ .../cloud/tasks/v2/cloud_tasks_paths_test.rb | 79 + .../cloud/tasks/v2/cloud_tasks_rest_test.rb | 979 ++++ .../google/cloud/tasks/v2/cloud_tasks_test.rb | 1074 ++++ .../google-cloud-tasks-v2/test/helper.rb | 25 + .../google-cloud-tasks-v2beta2/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-tasks-v2beta2/.rubocop.yml | 33 + .../google-cloud-tasks-v2beta2/.toys.rb | 28 + .../google-cloud-tasks-v2beta2/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-tasks-v2beta2/CHANGELOG.md | 2 + .../google-cloud-tasks-v2beta2/Gemfile | 11 + .../google-cloud-tasks-v2beta2/LICENSE.md | 201 + .../google-cloud-tasks-v2beta2/README.md | 154 + .../google-cloud-tasks-v2beta2/Rakefile | 169 + .../gapic_metadata.json | 123 + .../google-cloud-tasks-v2beta2.gemspec | 30 + .../lib/google-cloud-tasks-v2beta2.rb | 21 + .../lib/google/cloud/tasks/v2beta2.rb | 45 + .../cloud/tasks/v2beta2/bindings_override.rb | 75 + .../google/cloud/tasks/v2beta2/cloud_tasks.rb | 56 + .../cloud/tasks/v2beta2/cloud_tasks/client.rb | 2936 +++++++++++ .../tasks/v2beta2/cloud_tasks/credentials.rb | 51 + .../cloud/tasks/v2beta2/cloud_tasks/paths.rb | 90 + .../cloud/tasks/v2beta2/cloud_tasks/rest.rb | 54 + .../tasks/v2beta2/cloud_tasks/rest/client.rb | 2667 ++++++++++ .../v2beta2/cloud_tasks/rest/service_stub.rb | 1315 +++++ .../cloud/tasks/v2beta2/cloudtasks_pb.rb | 82 + .../tasks/v2beta2/cloudtasks_services_pb.rb | 274 + .../cloud/tasks/v2beta2/old_target_pb.rb | 41 + .../google/cloud/tasks/v2beta2/queue_pb.rb | 55 + .../lib/google/cloud/tasks/v2beta2/rest.rb | 38 + .../google/cloud/tasks/v2beta2/target_pb.rb | 60 + .../lib/google/cloud/tasks/v2beta2/task_pb.rb | 53 + .../lib/google/cloud/tasks/v2beta2/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/httpbody.rb | 80 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/tasks/v2beta2/cloudtasks.rb | 608 +++ .../google/cloud/tasks/v2beta2/queue.rb | 448 ++ .../google/cloud/tasks/v2beta2/target.rb | 775 +++ .../google/cloud/tasks/v2beta2/task.rb | 208 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../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/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../snippets/cloud_tasks/acknowledge_task.rb | 47 + .../snippets/cloud_tasks/cancel_lease.rb | 47 + .../snippets/cloud_tasks/create_queue.rb | 47 + .../snippets/cloud_tasks/create_task.rb | 47 + .../snippets/cloud_tasks/delete_queue.rb | 47 + .../snippets/cloud_tasks/delete_task.rb | 47 + .../snippets/cloud_tasks/get_iam_policy.rb | 47 + .../snippets/cloud_tasks/get_queue.rb | 47 + .../snippets/cloud_tasks/get_task.rb | 47 + .../snippets/cloud_tasks/lease_tasks.rb | 47 + .../snippets/cloud_tasks/list_queues.rb | 51 + .../snippets/cloud_tasks/list_tasks.rb | 51 + .../snippets/cloud_tasks/pause_queue.rb | 47 + .../snippets/cloud_tasks/purge_queue.rb | 47 + .../snippets/cloud_tasks/renew_lease.rb | 47 + .../snippets/cloud_tasks/resume_queue.rb | 47 + .../snippets/cloud_tasks/run_task.rb | 47 + .../snippets/cloud_tasks/set_iam_policy.rb | 47 + .../cloud_tasks/test_iam_permissions.rb | 47 + .../snippets/cloud_tasks/update_queue.rb | 47 + .../snippets/cloud_tasks/upload_queue_yaml.rb | 47 + ...t_metadata_google.cloud.tasks.v2beta2.json | 855 +++ .../tasks/v2beta2/cloud_tasks_paths_test.rb | 79 + .../tasks/v2beta2/cloud_tasks_rest_test.rb | 1207 +++++ .../cloud/tasks/v2beta2/cloud_tasks_test.rb | 1391 +++++ .../google-cloud-tasks-v2beta2/test/helper.rb | 25 + .../google-cloud-tasks-v2beta3/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-tasks-v2beta3/.rubocop.yml | 33 + .../google-cloud-tasks-v2beta3/.toys.rb | 28 + .../google-cloud-tasks-v2beta3/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-tasks-v2beta3/CHANGELOG.md | 2 + .../google-cloud-tasks-v2beta3/Gemfile | 11 + .../google-cloud-tasks-v2beta3/LICENSE.md | 201 + .../google-cloud-tasks-v2beta3/README.md | 154 + .../google-cloud-tasks-v2beta3/Rakefile | 169 + .../gapic_metadata.json | 98 + .../google-cloud-tasks-v2beta3.gemspec | 30 + .../lib/google-cloud-tasks-v2beta3.rb | 21 + .../lib/google/cloud/tasks/v2beta3.rb | 45 + .../cloud/tasks/v2beta3/bindings_override.rb | 75 + .../google/cloud/tasks/v2beta3/cloud_tasks.rb | 56 + .../cloud/tasks/v2beta3/cloud_tasks/client.rb | 2277 ++++++++ .../tasks/v2beta3/cloud_tasks/credentials.rb | 51 + .../cloud/tasks/v2beta3/cloud_tasks/paths.rb | 90 + .../cloud/tasks/v2beta3/cloud_tasks/rest.rb | 54 + .../tasks/v2beta3/cloud_tasks/rest/client.rb | 2130 ++++++++ .../v2beta3/cloud_tasks/rest/service_stub.rb | 1067 ++++ .../cloud/tasks/v2beta3/cloudtasks_pb.rb | 70 + .../tasks/v2beta3/cloudtasks_services_pb.rb | 208 + .../google/cloud/tasks/v2beta3/queue_pb.rb | 57 + .../lib/google/cloud/tasks/v2beta3/rest.rb | 38 + .../google/cloud/tasks/v2beta3/target_pb.rb | 57 + .../lib/google/cloud/tasks/v2beta3/task_pb.rb | 54 + .../lib/google/cloud/tasks/v2beta3/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/tasks/v2beta3/cloudtasks.rb | 396 ++ .../google/cloud/tasks/v2beta3/queue.rb | 462 ++ .../google/cloud/tasks/v2beta3/target.rb | 728 +++ .../google/cloud/tasks/v2beta3/task.rb | 213 + .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 ++ .../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/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../snippets/cloud_tasks/create_queue.rb | 47 + .../snippets/cloud_tasks/create_task.rb | 47 + .../snippets/cloud_tasks/delete_queue.rb | 47 + .../snippets/cloud_tasks/delete_task.rb | 47 + .../snippets/cloud_tasks/get_iam_policy.rb | 47 + .../snippets/cloud_tasks/get_queue.rb | 47 + .../snippets/cloud_tasks/get_task.rb | 47 + .../snippets/cloud_tasks/list_queues.rb | 51 + .../snippets/cloud_tasks/list_tasks.rb | 51 + .../snippets/cloud_tasks/pause_queue.rb | 47 + .../snippets/cloud_tasks/purge_queue.rb | 47 + .../snippets/cloud_tasks/resume_queue.rb | 47 + .../snippets/cloud_tasks/run_task.rb | 47 + .../snippets/cloud_tasks/set_iam_policy.rb | 47 + .../cloud_tasks/test_iam_permissions.rb | 47 + .../snippets/cloud_tasks/update_queue.rb | 47 + ...t_metadata_google.cloud.tasks.v2beta3.json | 655 +++ .../tasks/v2beta3/cloud_tasks_paths_test.rb | 79 + .../tasks/v2beta3/cloud_tasks_rest_test.rb | 981 ++++ .../cloud/tasks/v2beta3/cloud_tasks_test.rb | 1078 ++++ .../google-cloud-tasks-v2beta3/test/helper.rb | 25 + owl-bot-staging/google-cloud-tasks/.gitignore | 22 + .../google-cloud-tasks/.repo-metadata.json | 18 + .../google-cloud-tasks/.rubocop.yml | 39 + owl-bot-staging/google-cloud-tasks/.toys.rb | 28 + owl-bot-staging/google-cloud-tasks/.yardopts | 11 + .../google-cloud-tasks/AUTHENTICATION.md | 122 + .../google-cloud-tasks/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-tasks/Gemfile | 28 + owl-bot-staging/google-cloud-tasks/LICENSE.md | 201 + owl-bot-staging/google-cloud-tasks/README.md | 142 + owl-bot-staging/google-cloud-tasks/Rakefile | 169 + .../google-cloud-tasks.gemspec | 27 + .../lib/google-cloud-tasks.rb | 19 + .../lib/google/cloud/tasks.rb | 157 + .../lib/google/cloud/tasks/version.rb | 26 + .../test/google/cloud/tasks/client_test.rb | 64 + .../test/google/cloud/tasks/version_test.rb | 26 + .../google-cloud-tasks/test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-telco_automation-v1/.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-telco_automation-v1/Gemfile | 11 + .../LICENSE.md | 201 + .../README.md | 153 + .../google-cloud-telco_automation-v1/Rakefile | 169 + .../gapic_metadata.json | 198 + .../google-cloud-telco_automation-v1.gemspec | 29 + .../lib/google-cloud-telco_automation-v1.rb | 21 + .../lib/google/cloud/telco_automation/v1.rb | 45 + .../telco_automation/v1/bindings_override.rb | 75 + .../google/cloud/telco_automation/v1/rest.rb | 38 + .../telco_automation/v1/telco_automation.rb | 60 + .../v1/telco_automation/client.rb | 4039 +++++++++++++++ .../v1/telco_automation/credentials.rb | 47 + .../v1/telco_automation/operations.rb | 841 +++ .../v1/telco_automation/paths.rb | 172 + .../v1/telco_automation/rest.rb | 58 + .../v1/telco_automation/rest/client.rb | 3752 ++++++++++++++ .../v1/telco_automation/rest/operations.rb | 925 ++++ .../v1/telco_automation/rest/service_stub.rb | 2293 ++++++++ .../cloud/telco_automation/v1/version.rb | 28 + .../telcoautomation/v1/telcoautomation_pb.rb | 131 + .../v1/telcoautomation_services_pb.rb | 126 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../telcoautomation/v1/telcoautomation.rb | 1551 ++++++ .../google/longrunning/operations.rb | 191 + .../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/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ...adata_google.cloud.telcoautomation.v1.json | 1455 ++++++ .../telco_automation/apply_deployment.rb | 47 + .../apply_hydrated_deployment.rb | 47 + .../telco_automation/approve_blueprint.rb | 47 + .../compute_deployment_status.rb | 47 + .../telco_automation/create_blueprint.rb | 47 + .../telco_automation/create_deployment.rb | 47 + .../telco_automation/create_edge_slm.rb | 54 + .../create_orchestration_cluster.rb | 54 + .../telco_automation/delete_blueprint.rb | 47 + .../telco_automation/delete_edge_slm.rb | 54 + .../delete_orchestration_cluster.rb | 54 + .../discard_blueprint_changes.rb | 47 + .../discard_deployment_changes.rb | 47 + .../telco_automation/get_blueprint.rb | 47 + .../telco_automation/get_deployment.rb | 47 + .../snippets/telco_automation/get_edge_slm.rb | 47 + .../get_hydrated_deployment.rb | 47 + .../get_orchestration_cluster.rb | 47 + .../telco_automation/get_public_blueprint.rb | 47 + .../list_blueprint_revisions.rb | 51 + .../telco_automation/list_blueprints.rb | 51 + .../list_deployment_revisions.rb | 51 + .../telco_automation/list_deployments.rb | 51 + .../telco_automation/list_edge_slms.rb | 51 + .../list_hydrated_deployments.rb | 51 + .../list_orchestration_clusters.rb | 51 + .../list_public_blueprints.rb | 51 + .../telco_automation/propose_blueprint.rb | 47 + .../telco_automation/reject_blueprint.rb | 47 + .../telco_automation/remove_deployment.rb | 47 + .../telco_automation/rollback_deployment.rb | 47 + .../search_blueprint_revisions.rb | 51 + .../search_deployment_revisions.rb | 51 + .../telco_automation/update_blueprint.rb | 47 + .../telco_automation/update_deployment.rb | 47 + .../update_hydrated_deployment.rb | 47 + .../v1/telco_automation_operations_test.rb | 400 ++ .../v1/telco_automation_paths_test.rb | 127 + .../v1/telco_automation_rest_test.rb | 2089 ++++++++ .../v1/telco_automation_test.rb | 2368 +++++++++ .../test/helper.rb | 25 + .../google-cloud-telco_automation/.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 39 + .../google-cloud-telco_automation/.toys.rb | 28 + .../google-cloud-telco_automation/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-telco_automation/Gemfile | 28 + .../google-cloud-telco_automation/LICENSE.md | 201 + .../google-cloud-telco_automation/README.md | 141 + .../google-cloud-telco_automation/Rakefile | 169 + .../google-cloud-telco_automation.gemspec | 27 + .../lib/google-cloud-telco_automation.rb | 19 + .../lib/google/cloud/telco_automation.rb | 160 + .../google/cloud/telco_automation/version.rb | 26 + .../cloud/telco_automation/client_test.rb | 64 + .../cloud/telco_automation/version_test.rb | 26 + .../test/helper.rb | 25 + .../google-cloud-text_to_speech-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-text_to_speech-v1/.toys.rb | 28 + .../google-cloud-text_to_speech-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-text_to_speech-v1/Gemfile | 11 + .../google-cloud-text_to_speech-v1/LICENSE.md | 201 + .../google-cloud-text_to_speech-v1/README.md | 154 + .../google-cloud-text_to_speech-v1/Rakefile | 169 + .../gapic_metadata.json | 47 + .../google-cloud-text_to_speech-v1.gemspec | 28 + .../lib/google-cloud-text_to_speech-v1.rb | 21 + .../lib/google/cloud/text_to_speech/v1.rb | 46 + .../google/cloud/text_to_speech/v1/rest.rb | 38 + .../cloud/text_to_speech/v1/text_to_speech.rb | 55 + .../v1/text_to_speech/client.rb | 655 +++ .../v1/text_to_speech/credentials.rb | 51 + .../text_to_speech/v1/text_to_speech/paths.rb | 52 + .../text_to_speech/v1/text_to_speech/rest.rb | 52 + .../v1/text_to_speech/rest/client.rb | 528 ++ .../v1/text_to_speech/rest/service_stub.rb | 200 + .../text_to_speech_long_audio_synthesize.rb | 56 + .../client.rb | 510 ++ .../credentials.rb | 51 + .../operations.rb | 841 +++ .../paths.rb | 52 + .../rest.rb | 53 + .../rest/client.rb | 460 ++ .../rest/operations.rb | 925 ++++ .../rest/service_stub.rb | 143 + .../google/cloud/text_to_speech/v1/version.rb | 28 + .../cloud/texttospeech/v1/cloud_tts_lrs_pb.rb | 53 + .../v1/cloud_tts_lrs_services_pb.rb | 45 + .../cloud/texttospeech/v1/cloud_tts_pb.rb | 72 + .../texttospeech/v1/cloud_tts_services_pb.rb | 51 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/texttospeech/v1/cloud_tts.rb | 583 +++ .../cloud/texttospeech/v1/cloud_tts_lrs.rb | 73 + .../google/longrunning/operations.rb | 191 + .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ...metadata_google.cloud.texttospeech.v1.json | 175 + .../snippets/text_to_speech/list_voices.rb | 47 + .../text_to_speech/streaming_synthesize.rb | 56 + .../text_to_speech/synthesize_speech.rb | 47 + .../synthesize_long_audio.rb | 54 + ...h_long_audio_synthesize_operations_test.rb | 400 ++ ...speech_long_audio_synthesize_paths_test.rb | 55 + ..._speech_long_audio_synthesize_rest_test.rb | 157 + ...xt_to_speech_long_audio_synthesize_test.rb | 189 + .../v1/text_to_speech_paths_test.rb | 55 + .../v1/text_to_speech_rest_test.rb | 210 + .../text_to_speech/v1/text_to_speech_test.rb | 316 ++ .../test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 11 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 47 + ...oogle-cloud-text_to_speech-v1beta1.gemspec | 28 + .../google-cloud-text_to_speech-v1beta1.rb | 21 + .../google/cloud/text_to_speech/v1beta1.rb | 46 + .../cloud/text_to_speech/v1beta1/rest.rb | 38 + .../text_to_speech/v1beta1/text_to_speech.rb | 55 + .../v1beta1/text_to_speech/client.rb | 657 +++ .../v1beta1/text_to_speech/credentials.rb | 51 + .../v1beta1/text_to_speech/paths.rb | 52 + .../v1beta1/text_to_speech/rest.rb | 52 + .../v1beta1/text_to_speech/rest/client.rb | 530 ++ .../text_to_speech/rest/service_stub.rb | 200 + .../text_to_speech_long_audio_synthesize.rb | 56 + .../client.rb | 510 ++ .../credentials.rb | 51 + .../operations.rb | 841 +++ .../paths.rb | 52 + .../rest.rb | 53 + .../rest/client.rb | 460 ++ .../rest/operations.rb | 925 ++++ .../rest/service_stub.rb | 143 + .../cloud/text_to_speech/v1beta1/version.rb | 28 + .../texttospeech/v1beta1/cloud_tts_lrs_pb.rb | 53 + .../v1beta1/cloud_tts_lrs_services_pb.rb | 45 + .../texttospeech/v1beta1/cloud_tts_pb.rb | 74 + .../v1beta1/cloud_tts_services_pb.rb | 51 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/texttospeech/v1beta1/cloud_tts.rb | 618 +++ .../texttospeech/v1beta1/cloud_tts_lrs.rb | 73 + .../google/longrunning/operations.rb | 191 + .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ...ata_google.cloud.texttospeech.v1beta1.json | 175 + .../snippets/text_to_speech/list_voices.rb | 47 + .../text_to_speech/streaming_synthesize.rb | 56 + .../text_to_speech/synthesize_speech.rb | 47 + .../synthesize_long_audio.rb | 54 + ...h_long_audio_synthesize_operations_test.rb | 400 ++ ...speech_long_audio_synthesize_paths_test.rb | 55 + ..._speech_long_audio_synthesize_rest_test.rb | 157 + ...xt_to_speech_long_audio_synthesize_test.rb | 189 + .../v1beta1/text_to_speech_paths_test.rb | 55 + .../v1beta1/text_to_speech_rest_test.rb | 211 + .../v1beta1/text_to_speech_test.rb | 318 ++ .../test/helper.rb | 25 + .../google-cloud-text_to_speech/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-text_to_speech/.rubocop.yml | 39 + .../google-cloud-text_to_speech/.toys.rb | 28 + .../google-cloud-text_to_speech/.yardopts | 11 + .../AUTHENTICATION.md | 122 + .../google-cloud-text_to_speech/CHANGELOG.md | 2 + .../google-cloud-text_to_speech/Gemfile | 28 + .../google-cloud-text_to_speech/LICENSE.md | 201 + .../google-cloud-text_to_speech/README.md | 142 + .../google-cloud-text_to_speech/Rakefile | 169 + .../google-cloud-text_to_speech.gemspec | 27 + .../lib/google-cloud-text_to_speech.rb | 19 + .../lib/google/cloud/text_to_speech.rb | 226 + .../google/cloud/text_to_speech/version.rb | 26 + .../cloud/text_to_speech/client_test.rb | 85 + .../cloud/text_to_speech/version_test.rb | 26 + .../test/helper.rb | 25 + .../google-cloud-tpu-v1/.gitignore | 22 + .../google-cloud-tpu-v1/.repo-metadata.json | 18 + .../google-cloud-tpu-v1/.rubocop.yml | 33 + owl-bot-staging/google-cloud-tpu-v1/.toys.rb | 28 + owl-bot-staging/google-cloud-tpu-v1/.yardopts | 12 + .../google-cloud-tpu-v1/AUTHENTICATION.md | 122 + .../google-cloud-tpu-v1/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-tpu-v1/Gemfile | 11 + .../google-cloud-tpu-v1/LICENSE.md | 201 + owl-bot-staging/google-cloud-tpu-v1/README.md | 154 + owl-bot-staging/google-cloud-tpu-v1/Rakefile | 169 + .../google-cloud-tpu-v1/gapic_metadata.json | 73 + .../google-cloud-tpu-v1.gemspec | 29 + .../lib/google-cloud-tpu-v1.rb | 21 + .../lib/google/cloud/tpu/v1.rb | 40 + .../lib/google/cloud/tpu/v1/cloud_tpu_pb.rb | 74 + .../cloud/tpu/v1/cloud_tpu_services_pb.rb | 67 + .../lib/google/cloud/tpu/v1/tpu.rb | 52 + .../lib/google/cloud/tpu/v1/tpu/client.rb | 1517 ++++++ .../google/cloud/tpu/v1/tpu/credentials.rb | 51 + .../lib/google/cloud/tpu/v1/tpu/operations.rb | 841 +++ .../lib/google/cloud/tpu/v1/tpu/paths.rb | 107 + .../lib/google/cloud/tpu/v1/version.rb | 28 + .../google-cloud-tpu-v1/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/tpu/v1/cloud_tpu.rb | 521 ++ .../google/longrunning/operations.rb | 191 + .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../google-cloud-tpu-v1/snippets/Gemfile | 32 + .../snippet_metadata_google.cloud.tpu.v1.json | 455 ++ .../snippets/tpu/create_node.rb | 54 + .../snippets/tpu/delete_node.rb | 54 + .../snippets/tpu/get_accelerator_type.rb | 47 + .../snippets/tpu/get_node.rb | 47 + .../snippets/tpu/get_tensor_flow_version.rb | 47 + .../snippets/tpu/list_accelerator_types.rb | 51 + .../snippets/tpu/list_nodes.rb | 51 + .../snippets/tpu/list_tensor_flow_versions.rb | 51 + .../snippets/tpu/reimage_node.rb | 54 + .../snippets/tpu/start_node.rb | 54 + .../snippets/tpu/stop_node.rb | 54 + .../cloud/tpu/v1/tpu_operations_test.rb | 400 ++ .../google/cloud/tpu/v1/tpu_paths_test.rb | 91 + .../test/google/cloud/tpu/v1/tpu_test.rb | 822 +++ .../google-cloud-tpu-v1/test/helper.rb | 25 + owl-bot-staging/google-cloud-tpu/.gitignore | 22 + .../google-cloud-tpu/.repo-metadata.json | 18 + owl-bot-staging/google-cloud-tpu/.rubocop.yml | 39 + owl-bot-staging/google-cloud-tpu/.toys.rb | 28 + owl-bot-staging/google-cloud-tpu/.yardopts | 11 + .../google-cloud-tpu/AUTHENTICATION.md | 122 + owl-bot-staging/google-cloud-tpu/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-tpu/Gemfile | 28 + owl-bot-staging/google-cloud-tpu/LICENSE.md | 201 + owl-bot-staging/google-cloud-tpu/README.md | 142 + owl-bot-staging/google-cloud-tpu/Rakefile | 169 + .../google-cloud-tpu/google-cloud-tpu.gemspec | 27 + .../google-cloud-tpu/lib/google-cloud-tpu.rb | 19 + .../google-cloud-tpu/lib/google/cloud/tpu.rb | 149 + .../lib/google/cloud/tpu/version.rb | 26 + .../test/google/cloud/tpu/client_test.rb | 53 + .../test/google/cloud/tpu/version_test.rb | 26 + .../google-cloud-tpu/test/helper.rb | 25 + .../google-cloud-trace-v1/.gitignore | 22 + .../google-cloud-trace-v1/.repo-metadata.json | 18 + .../google-cloud-trace-v1/.rubocop.yml | 33 + .../google-cloud-trace-v1/.toys.rb | 28 + .../google-cloud-trace-v1/.yardopts | 12 + .../google-cloud-trace-v1/AUTHENTICATION.md | 122 + .../google-cloud-trace-v1/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-trace-v1/Gemfile | 11 + .../google-cloud-trace-v1/LICENSE.md | 201 + .../google-cloud-trace-v1/README.md | 154 + .../google-cloud-trace-v1/Rakefile | 169 + .../google-cloud-trace-v1/gapic_metadata.json | 33 + .../google-cloud-trace-v1.gemspec | 28 + .../lib/google-cloud-trace-v1.rb | 21 + .../lib/google/cloud/trace/v1.rb | 45 + .../lib/google/cloud/trace/v1/rest.rb | 37 + .../google/cloud/trace/v1/trace_service.rb | 58 + .../cloud/trace/v1/trace_service/client.rb | 753 +++ .../trace/v1/trace_service/credentials.rb | 53 + .../cloud/trace/v1/trace_service/rest.rb | 55 + .../trace/v1/trace_service/rest/client.rb | 686 +++ .../v1/trace_service/rest/service_stub.rb | 266 + .../lib/google/cloud/trace/v1/version.rb | 28 + .../google/devtools/cloudtrace/v1/trace_pb.rb | 57 + .../cloudtrace/v1/trace_services_pb.rb | 57 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/devtools/cloudtrace/v1/trace.rb | 287 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../google-cloud-trace-v1/snippets/Gemfile | 32 + ...etadata_google.devtools.cloudtrace.v1.json | 135 + .../snippets/trace_service/get_trace.rb | 47 + .../snippets/trace_service/list_traces.rb | 51 + .../snippets/trace_service/patch_traces.rb | 47 + .../cloud/trace/v1/trace_service_rest_test.rb | 270 + .../cloud/trace/v1/trace_service_test.rb | 301 ++ .../google-cloud-trace-v1/test/helper.rb | 25 + .../google-cloud-trace-v2/.gitignore | 22 + .../google-cloud-trace-v2/.repo-metadata.json | 18 + .../google-cloud-trace-v2/.rubocop.yml | 33 + .../google-cloud-trace-v2/.toys.rb | 28 + .../google-cloud-trace-v2/.yardopts | 12 + .../google-cloud-trace-v2/AUTHENTICATION.md | 122 + .../google-cloud-trace-v2/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-trace-v2/Gemfile | 11 + .../google-cloud-trace-v2/LICENSE.md | 201 + .../google-cloud-trace-v2/README.md | 154 + .../google-cloud-trace-v2/Rakefile | 169 + .../google-cloud-trace-v2/gapic_metadata.json | 28 + .../google-cloud-trace-v2.gemspec | 28 + .../lib/google-cloud-trace-v2.rb | 21 + .../lib/google/cloud/trace/v2.rb | 45 + .../lib/google/cloud/trace/v2/rest.rb | 37 + .../google/cloud/trace/v2/trace_service.rb | 61 + .../cloud/trace/v2/trace_service/client.rb | 643 +++ .../trace/v2/trace_service/credentials.rb | 52 + .../cloud/trace/v2/trace_service/paths.rb | 66 + .../cloud/trace/v2/trace_service/rest.rb | 58 + .../trace/v2/trace_service/rest/client.rb | 586 +++ .../v2/trace_service/rest/service_stub.rb | 205 + .../lib/google/cloud/trace/v2/version.rb | 28 + .../google/devtools/cloudtrace/v2/trace_pb.rb | 67 + .../devtools/cloudtrace/v2/tracing_pb.rb | 50 + .../cloudtrace/v2/tracing_services_pb.rb | 54 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/devtools/cloudtrace/v2/trace.rb | 427 ++ .../google/devtools/cloudtrace/v2/tracing.rb | 40 + .../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/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 121 + .../proto_docs/google/rpc/status.rb | 48 + .../google-cloud-trace-v2/snippets/Gemfile | 32 + ...etadata_google.devtools.cloudtrace.v2.json | 95 + .../trace_service/batch_write_spans.rb | 47 + .../snippets/trace_service/create_span.rb | 47 + .../trace/v2/trace_service_paths_test.rb | 67 + .../cloud/trace/v2/trace_service_rest_test.rb | 221 + .../cloud/trace/v2/trace_service_test.rb | 248 + .../google-cloud-trace-v2/test/helper.rb | 25 + .../google-cloud-translate-v3/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-translate-v3/.rubocop.yml | 33 + .../google-cloud-translate-v3/.toys.rb | 28 + .../google-cloud-translate-v3/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-translate-v3/CHANGELOG.md | 2 + .../google-cloud-translate-v3/Gemfile | 11 + .../google-cloud-translate-v3/LICENSE.md | 201 + .../google-cloud-translate-v3/README.md | 154 + .../google-cloud-translate-v3/Rakefile | 169 + .../gapic_metadata.json | 208 + .../google-cloud-translate-v3.gemspec | 30 + .../lib/google-cloud-translate-v3.rb | 21 + .../lib/google/cloud/translate/v3.rb | 45 + .../cloud/translate/v3/adaptive_mt_pb.rb | 71 + .../translate/v3/automl_translation_pb.rb | 78 + .../cloud/translate/v3/bindings_override.rb | 75 + .../google/cloud/translate/v3/common_pb.rb | 52 + .../lib/google/cloud/translate/v3/rest.rb | 38 + .../cloud/translate/v3/translation_service.rb | 56 + .../v3/translation_service/client.rb | 4614 +++++++++++++++++ .../v3/translation_service/credentials.rb | 52 + .../v3/translation_service/operations.rb | 849 +++ .../translate/v3/translation_service/paths.rb | 168 + .../translate/v3/translation_service/rest.rb | 54 + .../v3/translation_service/rest/client.rb | 4313 +++++++++++++++ .../v3/translation_service/rest/operations.rb | 1093 ++++ .../translation_service/rest/service_stub.rb | 2454 +++++++++ .../translate/v3/translation_service_pb.rb | 112 + .../v3/translation_service_services_pb.rb | 141 + .../lib/google/cloud/translate/v3/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/translate/v3/adaptive_mt.rb | 405 ++ .../cloud/translate/v3/automl_translation.rb | 487 ++ .../google/cloud/translate/v3/common.rb | 143 + .../cloud/translate/v3/translation_service.rb | 1657 ++++++ .../google/longrunning/operations.rb | 191 + .../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/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ..._metadata_google.cloud.translation.v3.json | 1535 ++++++ .../adaptive_mt_translate.rb | 47 + .../batch_translate_document.rb | 54 + .../batch_translate_text.rb | 54 + .../create_adaptive_mt_dataset.rb | 47 + .../translation_service/create_dataset.rb | 54 + .../translation_service/create_glossary.rb | 54 + .../create_glossary_entry.rb | 47 + .../translation_service/create_model.rb | 54 + .../delete_adaptive_mt_dataset.rb | 47 + .../delete_adaptive_mt_file.rb | 47 + .../translation_service/delete_dataset.rb | 54 + .../translation_service/delete_glossary.rb | 54 + .../delete_glossary_entry.rb | 47 + .../translation_service/delete_model.rb | 54 + .../translation_service/detect_language.rb | 47 + .../translation_service/export_data.rb | 54 + .../get_adaptive_mt_dataset.rb | 47 + .../get_adaptive_mt_file.rb | 47 + .../translation_service/get_dataset.rb | 47 + .../translation_service/get_glossary.rb | 47 + .../translation_service/get_glossary_entry.rb | 47 + .../snippets/translation_service/get_model.rb | 47 + .../get_supported_languages.rb | 47 + .../import_adaptive_mt_file.rb | 47 + .../translation_service/import_data.rb | 54 + .../list_adaptive_mt_datasets.rb | 51 + .../list_adaptive_mt_files.rb | 51 + .../list_adaptive_mt_sentences.rb | 51 + .../translation_service/list_datasets.rb | 51 + .../translation_service/list_examples.rb | 51 + .../translation_service/list_glossaries.rb | 51 + .../list_glossary_entries.rb | 51 + .../translation_service/list_models.rb | 51 + .../translation_service/romanize_text.rb | 47 + .../translation_service/translate_document.rb | 47 + .../translation_service/translate_text.rb | 47 + .../translation_service/update_glossary.rb | 54 + .../update_glossary_entry.rb | 47 + .../v3/translation_service_operations_test.rb | 400 ++ .../v3/translation_service_paths_test.rb | 127 + .../v3/translation_service_rest_test.rb | 2228 ++++++++ .../translate/v3/translation_service_test.rb | 2575 +++++++++ .../google-cloud-translate-v3/test/helper.rb | 25 + .../google-cloud-translate/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-translate/.rubocop.yml | 39 + .../google-cloud-translate/.toys.rb | 28 + .../google-cloud-translate/.yardopts | 12 + .../google-cloud-translate/AUTHENTICATION.md | 122 + .../google-cloud-translate/CHANGELOG.md | 2 + .../google-cloud-translate/Gemfile | 28 + .../google-cloud-translate/LICENSE.md | 201 + .../google-cloud-translate/README.md | 152 + .../google-cloud-translate/Rakefile | 169 + .../google-cloud-translate.gemspec | 28 + .../lib/google-cloud-translate.rb | 19 + .../lib/google/cloud/translate.rb | 156 + .../lib/google/cloud/translate/version.rb | 26 + .../google/cloud/translate/client_test.rb | 64 + .../google/cloud/translate/version_test.rb | 26 + .../google-cloud-translate/test/helper.rb | 25 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-video-live_stream-v1/Gemfile | 11 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 188 + .../google-cloud-video-live_stream-v1.gemspec | 29 + .../lib/google-cloud-video-live_stream-v1.rb | 21 + .../lib/google/cloud/video/live_stream/v1.rb | 47 + .../video/live_stream/v1/bindings_override.rb | 77 + .../live_stream/v1/livestream_service.rb | 62 + .../v1/livestream_service/client.rb | 4350 ++++++++++++++++ .../v1/livestream_service/credentials.rb | 49 + .../v1/livestream_service/operations.rb | 843 +++ .../v1/livestream_service/paths.rb | 227 + .../live_stream/v1/livestream_service/rest.rb | 60 + .../v1/livestream_service/rest/client.rb | 4077 +++++++++++++++ .../v1/livestream_service/rest/operations.rb | 927 ++++ .../livestream_service/rest/service_stub.rb | 2172 ++++++++ .../google/cloud/video/live_stream/v1/rest.rb | 40 + .../cloud/video/live_stream/v1/version.rb | 30 + .../cloud/video/livestream/v1/outputs_pb.rb | 76 + .../cloud/video/livestream/v1/resources_pb.rb | 116 + .../cloud/video/livestream/v1/service_pb.rb | 100 + .../livestream/v1/service_services_pb.rb | 123 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/video/livestream/v1/outputs.rb | 788 +++ .../cloud/video/livestream/v1/resources.rb | 1294 +++++ .../cloud/video/livestream/v1/service.rb | 1032 ++++ .../google/longrunning/operations.rb | 191 + .../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/rpc/status.rb | 48 + .../proto_docs/google/type/datetime.rb | 103 + .../snippets/Gemfile | 32 + .../livestream_service/create_asset.rb | 54 + .../livestream_service/create_channel.rb | 54 + .../livestream_service/create_clip.rb | 54 + .../livestream_service/create_dvr_session.rb | 54 + .../livestream_service/create_event.rb | 47 + .../livestream_service/create_input.rb | 54 + .../livestream_service/delete_asset.rb | 54 + .../livestream_service/delete_channel.rb | 54 + .../livestream_service/delete_clip.rb | 54 + .../livestream_service/delete_dvr_session.rb | 54 + .../livestream_service/delete_event.rb | 47 + .../livestream_service/delete_input.rb | 54 + .../snippets/livestream_service/get_asset.rb | 47 + .../livestream_service/get_channel.rb | 47 + .../snippets/livestream_service/get_clip.rb | 47 + .../livestream_service/get_dvr_session.rb | 47 + .../snippets/livestream_service/get_event.rb | 47 + .../snippets/livestream_service/get_input.rb | 47 + .../snippets/livestream_service/get_pool.rb | 47 + .../livestream_service/list_assets.rb | 51 + .../livestream_service/list_channels.rb | 51 + .../snippets/livestream_service/list_clips.rb | 51 + .../livestream_service/list_dvr_sessions.rb | 51 + .../livestream_service/list_events.rb | 51 + .../livestream_service/list_inputs.rb | 51 + .../livestream_service/preview_input.rb | 47 + .../livestream_service/start_channel.rb | 54 + .../livestream_service/start_distribution.rb | 54 + .../livestream_service/stop_channel.rb | 54 + .../livestream_service/stop_distribution.rb | 54 + .../livestream_service/update_channel.rb | 54 + .../livestream_service/update_dvr_session.rb | 54 + .../livestream_service/update_input.rb | 54 + .../livestream_service/update_pool.rb | 54 + ...data_google.cloud.video.livestream.v1.json | 1375 +++++ .../v1/livestream_service_operations_test.rb | 400 ++ .../v1/livestream_service_paths_test.rb | 163 + .../v1/livestream_service_rest_test.rb | 1998 +++++++ .../live_stream/v1/livestream_service_test.rb | 2336 +++++++++ .../test/helper.rb | 25 + 1166 files changed, 232242 insertions(+) create mode 100644 owl-bot-staging/google-cloud-support/.gitignore create mode 100644 owl-bot-staging/google-cloud-support/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-support/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-support/.toys.rb create mode 100644 owl-bot-staging/google-cloud-support/.yardopts create mode 100644 owl-bot-staging/google-cloud-support/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-support/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-support/Gemfile create mode 100644 owl-bot-staging/google-cloud-support/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-support/README.md create mode 100644 owl-bot-staging/google-cloud-support/Rakefile create mode 100644 owl-bot-staging/google-cloud-support/google-cloud-support.gemspec create mode 100644 owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb create mode 100644 owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb create mode 100644 owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb create mode 100644 owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb create mode 100644 owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb create mode 100644 owl-bot-staging/google-cloud-support/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/.gitignore create mode 100644 owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-talent-v4/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-talent-v4/.toys.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/.yardopts create mode 100644 owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/Gemfile create mode 100644 owl-bot-staging/google-cloud-talent-v4/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/README.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/Rakefile create mode 100644 owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/README.md create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb create mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-talent/.gitignore create mode 100644 owl-bot-staging/google-cloud-talent/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-talent/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-talent/.toys.rb create mode 100644 owl-bot-staging/google-cloud-talent/.yardopts create mode 100644 owl-bot-staging/google-cloud-talent/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-talent/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-talent/Gemfile create mode 100644 owl-bot-staging/google-cloud-talent/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-talent/README.md create mode 100644 owl-bot-staging/google-cloud-talent/Rakefile create mode 100644 owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec create mode 100644 owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb create mode 100644 owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb create mode 100644 owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb create mode 100644 owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb create mode 100644 owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb create mode 100644 owl-bot-staging/google-cloud-talent/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-tasks-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-tasks-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-tasks-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-tasks-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2/README.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-tasks-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.gitignore create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.yardopts create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/README.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/httpbody.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.gitignore create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.yardopts create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/README.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-tasks/.gitignore create mode 100644 owl-bot-staging/google-cloud-tasks/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-tasks/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-tasks/.toys.rb create mode 100644 owl-bot-staging/google-cloud-tasks/.yardopts create mode 100644 owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-tasks/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-tasks/Gemfile create mode 100644 owl-bot-staging/google-cloud-tasks/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-tasks/README.md create mode 100644 owl-bot-staging/google-cloud-tasks/Rakefile create mode 100644 owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec create mode 100644 owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb create mode 100644 owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb create mode 100644 owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb create mode 100644 owl-bot-staging/google-cloud-tasks/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/README.md create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation/.gitignore create mode 100644 owl-bot-staging/google-cloud-telco_automation/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-telco_automation/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-telco_automation/.toys.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation/.yardopts create mode 100644 owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-telco_automation/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-telco_automation/Gemfile create mode 100644 owl-bot-staging/google-cloud-telco_automation/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-telco_automation/README.md create mode 100644 owl-bot-staging/google-cloud-telco_automation/Rakefile create mode 100644 owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec create mode 100644 owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb create mode 100644 owl-bot-staging/google-cloud-telco_automation/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/README.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech/.gitignore create mode 100644 owl-bot-staging/google-cloud-text_to_speech/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-text_to_speech/.toys.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech/.yardopts create mode 100644 owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech/Gemfile create mode 100644 owl-bot-staging/google-cloud-text_to_speech/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech/README.md create mode 100644 owl-bot-staging/google-cloud-text_to_speech/Rakefile create mode 100644 owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec create mode 100644 owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb create mode 100644 owl-bot-staging/google-cloud-text_to_speech/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-tpu-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-tpu-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-tpu-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-tpu-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-tpu-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-tpu-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-tpu-v1/README.md create mode 100644 owl-bot-staging/google-cloud-tpu-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-tpu-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/create_node.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb create mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-tpu/.gitignore create mode 100644 owl-bot-staging/google-cloud-tpu/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-tpu/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-tpu/.toys.rb create mode 100644 owl-bot-staging/google-cloud-tpu/.yardopts create mode 100644 owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-tpu/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-tpu/Gemfile create mode 100644 owl-bot-staging/google-cloud-tpu/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-tpu/README.md create mode 100644 owl-bot-staging/google-cloud-tpu/Rakefile create mode 100644 owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec create mode 100644 owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb create mode 100644 owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb create mode 100644 owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb create mode 100644 owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb create mode 100644 owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb create mode 100644 owl-bot-staging/google-cloud-tpu/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-trace-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-trace-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-trace-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-trace-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-trace-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-trace-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-trace-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-trace-v1/README.md create mode 100644 owl-bot-staging/google-cloud-trace-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-trace-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json create mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/get_trace.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb create mode 100644 owl-bot-staging/google-cloud-trace-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-trace-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-trace-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-trace-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-trace-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-trace-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-trace-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-trace-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-trace-v2/README.md create mode 100644 owl-bot-staging/google-cloud-trace-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-trace-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json create mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb create mode 100644 owl-bot-staging/google-cloud-trace-v2/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/.gitignore create mode 100644 owl-bot-staging/google-cloud-translate-v3/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-translate-v3/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-translate-v3/.toys.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/.yardopts create mode 100644 owl-bot-staging/google-cloud-translate-v3/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-translate-v3/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-translate-v3/Gemfile create mode 100644 owl-bot-staging/google-cloud-translate-v3/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-translate-v3/README.md create mode 100644 owl-bot-staging/google-cloud-translate-v3/Rakefile create mode 100644 owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb create mode 100644 owl-bot-staging/google-cloud-translate-v3/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-translate/.gitignore create mode 100644 owl-bot-staging/google-cloud-translate/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-translate/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-translate/.toys.rb create mode 100644 owl-bot-staging/google-cloud-translate/.yardopts create mode 100644 owl-bot-staging/google-cloud-translate/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-translate/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-translate/Gemfile create mode 100644 owl-bot-staging/google-cloud-translate/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-translate/README.md create mode 100644 owl-bot-staging/google-cloud-translate/Rakefile create mode 100644 owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec create mode 100644 owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb create mode 100644 owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb create mode 100644 owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb create mode 100644 owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb create mode 100644 owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb create mode 100644 owl-bot-staging/google-cloud-translate/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/README.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb create mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-support/.gitignore b/owl-bot-staging/google-cloud-support/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.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-support/.repo-metadata.json b/owl-bot-staging/google-cloud-support/.repo-metadata.json new file mode 100644 index 000000000000..28ed335c14c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "cloudsupport.googleapis.com", + "api_shortname": "cloudsupport", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-support/latest", + "distribution_name": "google-cloud-support", + "is_cloud": true, + "language": "ruby", + "name": "cloudsupport", + "name_pretty": "Google Cloud Support API", + "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Manages Google Cloud technical support cases for Customer Care support offerings.", + "ruby-cloud-product-url": "https://cloud.google.com/support/docs/reference/support-api", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-support/.rubocop.yml b/owl-bot-staging/google-cloud-support/.rubocop.yml new file mode 100644 index 000000000000..0c62c9f8e48e --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-support.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-support.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-support/.toys.rb b/owl-bot-staging/google-cloud-support/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-support/.yardopts b/owl-bot-staging/google-cloud-support/.yardopts new file mode 100644 index 000000000000..9b5133e11480 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Google Cloud Support API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-support/AUTHENTICATION.md b/owl-bot-staging/google-cloud-support/AUTHENTICATION.md new file mode 100644 index 000000000000..a26939650afc --- /dev/null +++ b/owl-bot-staging/google-cloud-support/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-support 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-support 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/support" + +client = Google::Cloud::Support.case_attachment_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/support" + +Google::Cloud::Support.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Support.case_attachment_service +``` + +### 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-support +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/support" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Support.case_attachment_service +``` + +### 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-support/CHANGELOG.md b/owl-bot-staging/google-cloud-support/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-support/Gemfile b/owl-bot-staging/google-cloud-support/Gemfile new file mode 100644 index 000000000000..f30454cd3550 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-support-v2"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-support.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.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-support/LICENSE.md b/owl-bot-staging/google-cloud-support/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-support/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-support/README.md b/owl-bot-staging/google-cloud-support/README.md new file mode 100644 index 000000000000..7db6a09bc115 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Google Cloud Support API + +Manages Google Cloud technical support cases for Customer Care support offerings. + +Manages Google Cloud technical support cases for Customer Care support offerings. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-support-v*`. +The gem `google-cloud-support` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-support/latest) +for this library, google-cloud-support, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-support-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest). + +See also the [Product Documentation](https://cloud.google.com/support/docs/reference/support-api) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-support +``` + +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/cloudsupport.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/support" + +client = Google::Cloud::Support.case_attachment_service +request = ::Google::Cloud::Support::V2::ListAttachmentsRequest.new # (request fields as keyword arguments...) +response = client.list_attachments request +``` + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-support-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +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-support`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-support-v2`. +_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-support`. +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-support-v2`. + +### 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-support/Rakefile b/owl-bot-staging/google-cloud-support/Rakefile new file mode 100644 index 000000000000..da0a2d865834 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true +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-support acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/support/v2/case_attachment_service/credentials" + ::Google::Cloud::Support::V2::CaseAttachmentService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-support 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-support 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-support 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-support gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-support" + header "google-cloud-support rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-support yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-support 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-support 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-support 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-support/google-cloud-support.gemspec b/owl-bot-staging/google-cloud-support/google-cloud-support.gemspec new file mode 100644 index 000000000000..4feb21fe15bf --- /dev/null +++ b/owl-bot-staging/google-cloud-support/google-cloud-support.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/support/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-support" + gem.version = Google::Cloud::Support::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Manages Google Cloud technical support cases for Customer Care support offerings." + gem.summary = "Manages Google Cloud technical support cases for Customer Care support offerings." + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-support-v2", ">= 0.3", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb b/owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb new file mode 100644 index 000000000000..ff0e8c67c079 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/support" unless defined? Google::Cloud::Support::VERSION diff --git a/owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb b/owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb new file mode 100644 index 000000000000..9531f5ac0f41 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb @@ -0,0 +1,269 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/support/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :support do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Support + ## + # Create a new client object for CaseAttachmentService. + # + # By default, this returns an instance of + # [Google::Cloud::Support::V2::CaseAttachmentService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest/Google-Cloud-Support-V2-CaseAttachmentService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CaseAttachmentService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the CaseAttachmentService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Support.case_attachment_service_available?}. + # + # ## About CaseAttachmentService + # + # A service to manage file attachments for Google Cloud support cases. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [::Object] A client object for the specified version. + # + def self.case_attachment_service version: :v2, &block + require "google/cloud/support/#{version.to_s.downcase}" + + package_name = Google::Cloud::Support + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Support.const_get(package_name).const_get(:CaseAttachmentService) + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CaseAttachmentService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Support.case_attachment_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CaseAttachmentService service, + # or if the versioned client gem needs an update to support the CaseAttachmentService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [boolean] Whether the service is available. + # + def self.case_attachment_service_available? version: :v2 + require "google/cloud/support/#{version.to_s.downcase}" + package_name = Google::Cloud::Support + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Support.const_get package_name + return false unless service_module.const_defined? :CaseAttachmentService + service_module = service_module.const_get :CaseAttachmentService + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for CaseService. + # + # By default, this returns an instance of + # [Google::Cloud::Support::V2::CaseService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest/Google-Cloud-Support-V2-CaseService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CaseService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the CaseService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Support.case_service_available?}. + # + # ## About CaseService + # + # A service to manage Google Cloud support cases. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [::Object] A client object for the specified version. + # + def self.case_service version: :v2, &block + require "google/cloud/support/#{version.to_s.downcase}" + + package_name = Google::Cloud::Support + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Support.const_get(package_name).const_get(:CaseService) + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CaseService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Support.case_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CaseService service, + # or if the versioned client gem needs an update to support the CaseService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [boolean] Whether the service is available. + # + def self.case_service_available? version: :v2 + require "google/cloud/support/#{version.to_s.downcase}" + package_name = Google::Cloud::Support + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Support.const_get package_name + return false unless service_module.const_defined? :CaseService + service_module = service_module.const_get :CaseService + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for CommentService. + # + # By default, this returns an instance of + # [Google::Cloud::Support::V2::CommentService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest/Google-Cloud-Support-V2-CommentService-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CommentService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the CommentService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Support.comment_service_available?}. + # + # ## About CommentService + # + # A service to manage comments on cases. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [::Object] A client object for the specified version. + # + def self.comment_service version: :v2, &block + require "google/cloud/support/#{version.to_s.downcase}" + + package_name = Google::Cloud::Support + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Support.const_get(package_name).const_get(:CommentService) + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CommentService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Support.comment_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CommentService service, + # or if the versioned client gem needs an update to support the CommentService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [boolean] Whether the service is available. + # + def self.comment_service_available? version: :v2 + require "google/cloud/support/#{version.to_s.downcase}" + package_name = Google::Cloud::Support + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Support.const_get package_name + return false unless service_module.const_defined? :CommentService + service_module = service_module.const_get :CommentService + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-support library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.support if block_given? + + ::Google::Cloud.configure.support + end + end + end +end + +helper_path = ::File.join __dir__, "support", "helpers.rb" +require "google/cloud/support/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb b/owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb new file mode 100644 index 000000000000..10109b175e7a --- /dev/null +++ b/owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Support + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb b/owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb new file mode 100644 index 000000000000..6e8f5d25f10b --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/support" +require "gapic/common" +require "gapic/grpc" + +class Google::Cloud::Support::ClientConstructionMinitest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_case_attachment_service_grpc + skip unless Google::Cloud::Support.case_attachment_service_available? + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Support.case_attachment_service do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Support::V2::CaseAttachmentService::Client, client + end + end + + def test_case_service_grpc + skip unless Google::Cloud::Support.case_service_available? + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Support.case_service do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Support::V2::CaseService::Client, client + end + end + + def test_comment_service_grpc + skip unless Google::Cloud::Support.comment_service_available? + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Support.comment_service do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Support::V2::CommentService::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb b/owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb new file mode 100644 index 000000000000..0ec07616c6b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/support/version" + +class Google::Cloud::Support::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Support::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-support/test/helper.rb b/owl-bot-staging/google-cloud-support/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-support/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-talent-v4/.gitignore b/owl-bot-staging/google-cloud-talent-v4/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.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-talent-v4/.repo-metadata.json b/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json new file mode 100644 index 000000000000..2798805ded2c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "jobs.googleapis.com", + "api_shortname": "jobs", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest", + "distribution_name": "google-cloud-talent-v4", + "is_cloud": true, + "language": "ruby", + "name": "jobs", + "name_pretty": "Cloud Talent Solution V4 API", + "product_documentation": "https://cloud.google.com/solutions/talent-solution", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TALENT", + "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml b/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml new file mode 100644 index 000000000000..bd272e76c0ea --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-talent-v4.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-talent-v4.rb" diff --git a/owl-bot-staging/google-cloud-talent-v4/.toys.rb b/owl-bot-staging/google-cloud-talent-v4/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/.yardopts b/owl-bot-staging/google-cloud-talent-v4/.yardopts new file mode 100644 index 000000000000..5c7f550fa4ae --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Talent Solution V4 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-talent-v4/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md new file mode 100644 index 000000000000..3ee7d3b9820d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-talent-v4 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-talent-v4 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/talent/v4" + +client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/talent/v4" + +::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4 +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/talent/v4" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4/CHANGELOG.md b/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-talent-v4/Gemfile b/owl-bot-staging/google-cloud-talent-v4/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-talent-v4/LICENSE.md b/owl-bot-staging/google-cloud-talent-v4/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/README.md b/owl-bot-staging/google-cloud-talent-v4/README.md new file mode 100644 index 000000000000..dcd4f76bc132 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Talent Solution V4 API + +Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. + +Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. + +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 Talent Solution V4 API. Most users should consider using +the main client gem, +[google-cloud-talent](https://rubygems.org/gems/google-cloud-talent). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-talent-v4 +``` + +## 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/jobs.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/talent/v4" + +client = ::Google::Cloud::Talent::V4::CompanyService::Client.new +request = ::Google::Cloud::Talent::V4::CreateCompanyRequest.new # (request fields as keyword arguments...) +response = client.create_company request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/talent/v4" +require "logger" + +client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-talent`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-talent-v4`. +_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-talent`. +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-talent-v4`. + +### 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-talent-v4/Rakefile b/owl-bot-staging/google-cloud-talent-v4/Rakefile new file mode 100644 index 000000000000..e241f71a45d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TALENT_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TALENT_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/talent/v4/company_service/credentials" + ::Google::Cloud::Talent::V4::CompanyService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TALENT_PROJECT"] = project + ENV["TALENT_TEST_PROJECT"] = project + ENV["TALENT_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-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-talent-v4" + header "google-cloud-talent-v4 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-talent-v4 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4/gapic_metadata.json b/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json new file mode 100644 index 000000000000..12740756819f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json @@ -0,0 +1,164 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.talent.v4", + "libraryPackage": "::Google::Cloud::Talent::V4", + "services": { + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::CompanyService::Client", + "rpcs": { + "CreateCompany": { + "methods": [ + "create_company" + ] + }, + "GetCompany": { + "methods": [ + "get_company" + ] + }, + "UpdateCompany": { + "methods": [ + "update_company" + ] + }, + "DeleteCompany": { + "methods": [ + "delete_company" + ] + }, + "ListCompanies": { + "methods": [ + "list_companies" + ] + } + } + } + } + }, + "Completion": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::Completion::Client", + "rpcs": { + "CompleteQuery": { + "methods": [ + "complete_query" + ] + } + } + } + } + }, + "EventService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::EventService::Client", + "rpcs": { + "CreateClientEvent": { + "methods": [ + "create_client_event" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::JobService::Client", + "rpcs": { + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "BatchCreateJobs": { + "methods": [ + "batch_create_jobs" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "BatchUpdateJobs": { + "methods": [ + "batch_update_jobs" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "BatchDeleteJobs": { + "methods": [ + "batch_delete_jobs" + ] + }, + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "SearchJobs": { + "methods": [ + "search_jobs" + ] + }, + "SearchJobsForAlert": { + "methods": [ + "search_jobs_for_alert" + ] + } + } + } + } + }, + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4::TenantService::Client", + "rpcs": { + "CreateTenant": { + "methods": [ + "create_tenant" + ] + }, + "GetTenant": { + "methods": [ + "get_tenant" + ] + }, + "UpdateTenant": { + "methods": [ + "update_tenant" + ] + }, + "DeleteTenant": { + "methods": [ + "delete_tenant" + ] + }, + "ListTenants": { + "methods": [ + "list_tenants" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec b/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec new file mode 100644 index 000000000000..64071099173c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/talent/v4/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-talent-v4" + gem.version = Google::Cloud::Talent::V4::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details." + gem.summary = "Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb new file mode 100644 index 000000000000..c715c2e0b79a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4" diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb new file mode 100644 index 000000000000..35c2c38a0397 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service" +require "google/cloud/talent/v4/completion" +require "google/cloud/talent/v4/event_service" +require "google/cloud/talent/v4/job_service" +require "google/cloud/talent/v4/tenant_service" +require "google/cloud/talent/v4/version" + +module Google + module Cloud + module Talent + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/talent/v4" + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/talent/v4" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module V4 + end + end + end +end + +helper_path = ::File.join __dir__, "v4", "_helpers.rb" +require "google/cloud/talent/v4/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb new file mode 100644 index 000000000000..70e3b6d1694b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/type/latlng_pb' +require 'google/type/money_pb' +require 'google/type/postal_address_pb' + + +descriptor_data = "\n#google/cloud/talent/v4/common.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x18google/type/latlng.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"n\n\x0eTimestampRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb2\x03\n\x08Location\x12\x44\n\rlocation_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.Location.LocationType\x12\x32\n\x0epostal_address\x18\x02 \x01(\x0b\x32\x1a.google.type.PostalAddress\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x14\n\x0cradius_miles\x18\x04 \x01(\x01\"\xef\x01\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OUNTRY\x10\x01\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x02\x12\x1b\n\x17SUB_ADMINISTRATIVE_AREA\x10\x03\x12\x0c\n\x08LOCALITY\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x10\n\x0cSUB_LOCALITY\x10\x06\x12\x12\n\x0eSUB_LOCALITY_1\x10\x07\x12\x12\n\x0eSUB_LOCALITY_2\x10\x08\x12\x10\n\x0cNEIGHBORHOOD\x10\t\x12\x12\n\x0eSTREET_ADDRESS\x10\n\"\x9a\x01\n\x0fRequestMetadata\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x19\n\x11\x61llow_missing_ids\x18\x04 \x01(\x08\x12\x37\n\x0b\x64\x65vice_info\x18\x05 \x01(\x0b\x32\".google.cloud.talent.v4.DeviceInfo\"&\n\x10ResponseMetadata\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\xca\x01\n\nDeviceInfo\x12\x42\n\x0b\x64\x65vice_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.DeviceInfo.DeviceType\x12\n\n\x02id\x18\x02 \x01(\t\"l\n\nDeviceType\x12\x1b\n\x17\x44\x45VICE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0e\n\nMOBILE_WEB\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x07\n\x03IOS\x10\x04\x12\x07\n\x03\x42OT\x10\x05\x12\t\n\x05OTHER\x10\x06\"m\n\x0f\x43ustomAttribute\x12\x15\n\rstring_values\x18\x01 \x03(\t\x12\x13\n\x0blong_values\x18\x02 \x03(\x03\x12\x12\n\nfilterable\x18\x03 \x01(\x08\x12\x1a\n\x12keyword_searchable\x18\x04 \x01(\x08\"W\n\x12SpellingCorrection\x12\x11\n\tcorrected\x18\x01 \x01(\x08\x12\x16\n\x0e\x63orrected_text\x18\x02 \x01(\t\x12\x16\n\x0e\x63orrected_html\x18\x03 \x01(\t\"\x88\t\n\x10\x43ompensationInfo\x12K\n\x07\x65ntries\x18\x01 \x03(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationEntry\x12k\n\"annualized_base_compensation_range\x18\x02 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x12l\n#annualized_total_compensation_range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x1a\x83\x03\n\x11\x43ompensationEntry\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationType\x12G\n\x04unit\x18\x02 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnit\x12$\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12K\n\x05range\x18\x04 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12=\n\x17\x65xpected_units_per_year\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValueB\x15\n\x13\x63ompensation_amount\x1ao\n\x11\x43ompensationRange\x12,\n\x10max_compensation\x18\x02 \x01(\x0b\x32\x12.google.type.Money\x12,\n\x10min_compensation\x18\x01 \x01(\x0b\x32\x12.google.type.Money\"\xb5\x01\n\x10\x43ompensationType\x12!\n\x1d\x43OMPENSATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42\x41SE\x10\x01\x12\t\n\x05\x42ONUS\x10\x02\x12\x11\n\rSIGNING_BONUS\x10\x03\x12\n\n\x06\x45QUITY\x10\x04\x12\x12\n\x0ePROFIT_SHARING\x10\x05\x12\x0f\n\x0b\x43OMMISSIONS\x10\x06\x12\x08\n\x04TIPS\x10\x07\x12\x1b\n\x17OTHER_COMPENSATION_TYPE\x10\x08\"\x9c\x01\n\x10\x43ompensationUnit\x12!\n\x1d\x43OMPENSATION_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06HOURLY\x10\x01\x12\t\n\x05\x44\x41ILY\x10\x02\x12\n\n\x06WEEKLY\x10\x03\x12\x0b\n\x07MONTHLY\x10\x04\x12\n\n\x06YEARLY\x10\x05\x12\x0c\n\x08ONE_TIME\x10\x06\x12\x1b\n\x17OTHER_COMPENSATION_UNIT\x10\x07\"\xc7\x03\n\x16\x42\x61tchOperationMetadata\x12\x43\n\x05state\x18\x01 \x01(\x0e\x32\x34.google.cloud.talent.v4.BatchOperationMetadata.State\x12\x19\n\x11state_description\x18\x02 \x01(\t\x12\x15\n\rsuccess_count\x18\x03 \x01(\x05\x12\x15\n\rfailure_count\x18\x04 \x01(\x05\x12\x13\n\x0btotal_count\x18\x05 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"z\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06*y\n\x0b\x43ompanySize\x12\x1c\n\x18\x43OMPANY_SIZE_UNSPECIFIED\x10\x00\x12\x08\n\x04MINI\x10\x01\x12\t\n\x05SMALL\x10\x02\x12\x0b\n\x07SMEDIUM\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x07\n\x03\x42IG\x10\x05\x12\n\n\x06\x42IGGER\x10\x06\x12\t\n\x05GIANT\x10\x07*\xe2\x01\n\nJobBenefit\x12\x1b\n\x17JOB_BENEFIT_UNSPECIFIED\x10\x00\x12\x0e\n\nCHILD_CARE\x10\x01\x12\n\n\x06\x44\x45NTAL\x10\x02\x12\x14\n\x10\x44OMESTIC_PARTNER\x10\x03\x12\x12\n\x0e\x46LEXIBLE_HOURS\x10\x04\x12\x0b\n\x07MEDICAL\x10\x05\x12\x12\n\x0eLIFE_INSURANCE\x10\x06\x12\x12\n\x0ePARENTAL_LEAVE\x10\x07\x12\x13\n\x0fRETIREMENT_PLAN\x10\x08\x12\r\n\tSICK_DAYS\x10\t\x12\x0c\n\x08VACATION\x10\n\x12\n\n\x06VISION\x10\x0b*\x8e\x02\n\nDegreeType\x12\x1b\n\x17\x44\x45GREE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PRIMARY_EDUCATION\x10\x01\x12\x1d\n\x19LOWER_SECONDARY_EDUCATION\x10\x02\x12\x1d\n\x19UPPER_SECONDARY_EDUCATION\x10\x03\x12\x1c\n\x18\x41\x44ULT_REMEDIAL_EDUCATION\x10\x04\x12\x1c\n\x18\x41SSOCIATES_OR_EQUIVALENT\x10\x05\x12\x1b\n\x17\x42\x41\x43HELORS_OR_EQUIVALENT\x10\x06\x12\x19\n\x15MASTERS_OR_EQUIVALENT\x10\x07\x12\x1a\n\x16\x44OCTORAL_OR_EQUIVALENT\x10\x08*\xdc\x01\n\x0e\x45mploymentType\x12\x1f\n\x1b\x45MPLOYMENT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFULL_TIME\x10\x01\x12\r\n\tPART_TIME\x10\x02\x12\x0e\n\nCONTRACTOR\x10\x03\x12\x14\n\x10\x43ONTRACT_TO_HIRE\x10\x04\x12\r\n\tTEMPORARY\x10\x05\x12\n\n\x06INTERN\x10\x06\x12\r\n\tVOLUNTEER\x10\x07\x12\x0c\n\x08PER_DIEM\x10\x08\x12\x12\n\x0e\x46LY_IN_FLY_OUT\x10\t\x12\x19\n\x15OTHER_EMPLOYMENT_TYPE\x10\n*q\n\x08JobLevel\x12\x19\n\x15JOB_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45NTRY_LEVEL\x10\x01\x12\x0f\n\x0b\x45XPERIENCED\x10\x02\x12\x0b\n\x07MANAGER\x10\x03\x12\x0c\n\x08\x44IRECTOR\x10\x04\x12\r\n\tEXECUTIVE\x10\x05*\xba\x06\n\x0bJobCategory\x12\x1c\n\x18JOB_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41\x43\x43OUNTING_AND_FINANCE\x10\x01\x12\x1d\n\x19\x41\x44MINISTRATIVE_AND_OFFICE\x10\x02\x12\x1d\n\x19\x41\x44VERTISING_AND_MARKETING\x10\x03\x12\x0f\n\x0b\x41NIMAL_CARE\x10\x04\x12\x1a\n\x16\x41RT_FASHION_AND_DESIGN\x10\x05\x12\x17\n\x13\x42USINESS_OPERATIONS\x10\x06\x12\x1b\n\x17\x43LEANING_AND_FACILITIES\x10\x07\x12\x13\n\x0f\x43OMPUTER_AND_IT\x10\x08\x12\x10\n\x0c\x43ONSTRUCTION\x10\t\x12\x14\n\x10\x43USTOMER_SERVICE\x10\n\x12\r\n\tEDUCATION\x10\x0b\x12\x1c\n\x18\x45NTERTAINMENT_AND_TRAVEL\x10\x0c\x12\x18\n\x14\x46\x41RMING_AND_OUTDOORS\x10\r\x12\x0e\n\nHEALTHCARE\x10\x0e\x12\x13\n\x0fHUMAN_RESOURCES\x10\x0f\x12\'\n#INSTALLATION_MAINTENANCE_AND_REPAIR\x10\x10\x12\t\n\x05LEGAL\x10\x11\x12\x0e\n\nMANAGEMENT\x10\x12\x12\x1f\n\x1bMANUFACTURING_AND_WAREHOUSE\x10\x13\x12$\n MEDIA_COMMUNICATIONS_AND_WRITING\x10\x14\x12\x16\n\x12OIL_GAS_AND_MINING\x10\x15\x12\x1e\n\x1aPERSONAL_CARE_AND_SERVICES\x10\x16\x12\x17\n\x13PROTECTIVE_SERVICES\x10\x17\x12\x0f\n\x0bREAL_ESTATE\x10\x18\x12\x1e\n\x1aRESTAURANT_AND_HOSPITALITY\x10\x19\x12\x14\n\x10SALES_AND_RETAIL\x10\x1a\x12\x1b\n\x17SCIENCE_AND_ENGINEERING\x10\x1b\x12\"\n\x1eSOCIAL_SERVICES_AND_NON_PROFIT\x10\x1c\x12!\n\x1dSPORTS_FITNESS_AND_RECREATION\x10\x1d\x12 \n\x1cTRANSPORTATION_AND_LOGISTICS\x10\x1e*e\n\rPostingRegion\x12\x1e\n\x1aPOSTING_REGION_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x01\x12\n\n\x06NATION\x10\x02\x12\x0f\n\x0bTELECOMMUTE\x10\x03*n\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x41\x43\x43OUNT_ONLY\x10\x01\x12\x16\n\x12SHARED_WITH_GOOGLE\x10\x02\x12\x16\n\x12SHARED_WITH_PUBLIC\x10\x03\x1a\x02\x18\x01*q\n\x10HtmlSanitization\x12!\n\x1dHTML_SANITIZATION_UNSPECIFIED\x10\x00\x12\x1e\n\x1aHTML_SANITIZATION_DISABLED\x10\x01\x12\x1a\n\x16SIMPLE_FORMATTING_ONLY\x10\x02*{\n\rCommuteMethod\x12\x1e\n\x1a\x43OMMUTE_METHOD_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44RIVING\x10\x01\x12\x0b\n\x07TRANSIT\x10\x02\x12\x0b\n\x07WALKING\x10\x03\x12\x0b\n\x07\x43YCLING\x10\x04\x12\x16\n\x12TRANSIT_ACCESSIBLE\x10\x05\x42\x65\n\x1a\x63om.google.cloud.talent.v4B\x0b\x43ommonProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.type.PostalAddress", "google/type/postal_address.proto"], + ["google.type.LatLng", "google/type/latlng.proto"], + ["google.type.Money", "google/type/money.proto"], + ["google.protobuf.DoubleValue", "google/protobuf/wrappers.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 Talent + module V4 + TimestampRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.TimestampRange").msgclass + Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location").msgclass + Location::LocationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location.LocationType").enummodule + RequestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.RequestMetadata").msgclass + ResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ResponseMetadata").msgclass + DeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo").msgclass + DeviceInfo::DeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo.DeviceType").enummodule + CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CustomAttribute").msgclass + SpellingCorrection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SpellingCorrection").msgclass + CompensationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo").msgclass + CompensationInfo::CompensationEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationEntry").msgclass + CompensationInfo::CompensationRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationRange").msgclass + CompensationInfo::CompensationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationType").enummodule + CompensationInfo::CompensationUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationUnit").enummodule + BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata").msgclass + BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata.State").enummodule + CompanySize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompanySize").enummodule + JobBenefit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobBenefit").enummodule + DegreeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DegreeType").enummodule + EmploymentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.EmploymentType").enummodule + JobLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobLevel").enummodule + JobCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobCategory").enummodule + PostingRegion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.PostingRegion").enummodule + Visibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Visibility").enummodule + HtmlSanitization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HtmlSanitization").enummodule + CommuteMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb new file mode 100644 index 000000000000..9f8fd2ced95a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/company.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4/common_pb' + + +descriptor_data = "\n$google/cloud/talent/v4/company.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\xc8\x04\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x65xternal_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x04size\x18\x04 \x01(\x0e\x32#.google.cloud.talent.v4.CompanySize\x12\x1c\n\x14headquarters_address\x18\x05 \x01(\t\x12\x15\n\rhiring_agency\x18\x06 \x01(\x08\x12\x10\n\x08\x65\x65o_text\x18\x07 \x01(\t\x12\x13\n\x0bwebsite_uri\x18\x08 \x01(\t\x12\x17\n\x0f\x63\x61reer_site_uri\x18\t \x01(\t\x12\x11\n\timage_uri\x18\n \x01(\t\x12\x34\n(keyword_searchable_job_custom_attributes\x18\x0b \x03(\tB\x02\x18\x01\x12\x46\n\x0c\x64\x65rived_info\x18\x0c \x01(\x0b\x32+.google.cloud.talent.v4.Company.DerivedInfoB\x03\xe0\x41\x03\x12\x16\n\tsuspended\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x1aN\n\x0b\x44\x65rivedInfo\x12?\n\x15headquarters_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location:Y\xea\x41V\n\x1bjobs.googleapis.com/Company\x12\x37projects/{project}/tenants/{tenant}/companies/{company}Bf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x43ompanyProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Location", "google/cloud/talent/v4/common.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 Talent + module V4 + Company = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company").msgclass + Company::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company.DerivedInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb new file mode 100644 index 000000000000..948f3a46bcd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/company_service/credentials" +require "google/cloud/talent/v4/company_service/paths" +require "google/cloud/talent/v4/company_service/client" +require "google/cloud/talent/v4/company_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles company management, including CRUD and enumeration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/company_service" + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/company_service/rest" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module CompanyService + end + end + end + end +end + +helper_path = ::File.join __dir__, "company_service", "helpers.rb" +require "google/cloud/talent/v4/company_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb new file mode 100644 index 000000000000..174536c919cc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb @@ -0,0 +1,909 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" + +module Google + module Cloud + module Talent + module V4 + module CompanyService + ## + # Client for the CompanyService service. + # + # A service that handles company management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :company_service_stub + + ## + # Configure the CompanyService Client class. + # + # See {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompanyService clients + # ::Google::Cloud::Talent::V4::CompanyService::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", "Talent", "V4"] + 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_company.timeout = 30.0 + + default_config.rpcs.get_company.timeout = 30.0 + default_config.rpcs.get_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_company.timeout = 30.0 + + default_config.rpcs.delete_company.timeout = 30.0 + default_config.rpcs.delete_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_companies.timeout = 30.0 + default_config.rpcs.list_companies.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompanyService 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::Talent::V4::CompanyService::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 + @company_service_stub.universe_domain + end + + ## + # Create a new CompanyService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompanyService 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/talent/v4/company_service_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 + + @company_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::CompanyService::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, + logger: @config.logger + ) + + @company_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @company_service_stub.logger + end + + # Service calls + + ## + # Creates a new company entity. + # + # @overload create_company(request, options = nil) + # Pass arguments to `create_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) + # Pass arguments to `create_company` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new + # + # # Call the create_company method. + # result = client.create_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def create_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :create_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified company. + # + # @overload get_company(request, options = nil) + # Pass arguments to `get_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `get_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetCompanyRequest.new + # + # # Call the get_company method. + # result = client.get_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def get_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :get_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified company. + # + # @overload update_company(request, options = nil) + # Pass arguments to `update_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) + # Pass arguments to `update_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Company Company} are + # supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new + # + # # Call the update_company method. + # result = client.update_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def update_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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.company&.name + header_params["company.name"] = request.company.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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :update_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified company. + # Prerequisite: The company has no jobs associated with it. + # + # @overload delete_company(request, options = nil) + # Pass arguments to `delete_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `delete_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new + # + # # Call the delete_company method. + # result = client.delete_company request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :delete_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all companies associated with the project. + # + # @overload list_companies(request, options = nil) + # Pass arguments to `list_companies` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) + # Pass arguments to `list_companies` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @param require_open_jobs [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new + # + # # Call the list_companies method. + # result = client.list_companies 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::Talent::V4::Company. + # p item + # end + # + def list_companies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest + + # Converts hash 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_companies.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::Talent::V4::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_companies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_companies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :list_companies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @company_service_stub, :list_companies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CompanyService API. + # + # This class represents the configuration for CompanyService, + # 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::Talent::V4::CompanyService::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_company to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CompanyService 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_company` + # @return [::Gapic::Config::Method] + # + attr_reader :create_company + ## + # RPC-specific configuration for `get_company` + # @return [::Gapic::Config::Method] + # + attr_reader :get_company + ## + # RPC-specific configuration for `update_company` + # @return [::Gapic::Config::Method] + # + attr_reader :update_company + ## + # RPC-specific configuration for `delete_company` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_company + ## + # RPC-specific configuration for `list_companies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_companies + + # @private + def initialize parent_rpcs = nil + create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company + @create_company = ::Gapic::Config::Method.new create_company_config + get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company + @get_company = ::Gapic::Config::Method.new get_company_config + update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company + @update_company = ::Gapic::Config::Method.new update_company_config + delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company + @delete_company = ::Gapic::Config::Method.new delete_company_config + list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies + @list_companies = ::Gapic::Config::Method.new list_companies_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb new file mode 100644 index 000000000000..6cb90fd7eecb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module CompanyService + # Credentials for the CompanyService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb new file mode 100644 index 000000000000..c4a717b39ab8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module CompanyService + # Path helper methods for the CompanyService API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @return [::String] + def company_path project:, tenant:, company: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb new file mode 100644 index 000000000000..3c513e88db2d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/company_service/credentials" +require "google/cloud/talent/v4/company_service/paths" +require "google/cloud/talent/v4/company_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles company management, including CRUD and enumeration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/company_service/rest" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module CompanyService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/company_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb new file mode 100644 index 000000000000..f1d3ac698682 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb @@ -0,0 +1,831 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" +require "google/cloud/talent/v4/company_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module CompanyService + module Rest + ## + # REST client for the CompanyService service. + # + # A service that handles company management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :company_service_stub + + ## + # Configure the CompanyService Client class. + # + # See {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompanyService clients + # ::Google::Cloud::Talent::V4::CompanyService::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", "Talent", "V4"] + 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_company.timeout = 30.0 + + default_config.rpcs.get_company.timeout = 30.0 + default_config.rpcs.get_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_company.timeout = 30.0 + + default_config.rpcs.delete_company.timeout = 30.0 + default_config.rpcs.delete_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_companies.timeout = 30.0 + default_config.rpcs.list_companies.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompanyService 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::Talent::V4::CompanyService::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 + @company_service_stub.universe_domain + end + + ## + # Create a new CompanyService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompanyService 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 + + @company_service_stub = ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @company_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @company_service_stub.logger + end + + # Service calls + + ## + # Creates a new company entity. + # + # @overload create_company(request, options = nil) + # Pass arguments to `create_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) + # Pass arguments to `create_company` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new + # + # # Call the create_company method. + # result = client.create_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def create_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.create_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified company. + # + # @overload get_company(request, options = nil) + # Pass arguments to `get_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `get_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetCompanyRequest.new + # + # # Call the get_company method. + # result = client.get_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def get_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.get_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified company. + # + # @overload update_company(request, options = nil) + # Pass arguments to `update_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) + # Pass arguments to `update_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] + # Required. The company resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Company Company} are + # supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new + # + # # Call the update_company method. + # result = client.update_company request + # + # # The returned object is of type Google::Cloud::Talent::V4::Company. + # p result + # + def update_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.update_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified company. + # Prerequisite: The company has no jobs associated with it. + # + # @overload delete_company(request, options = nil) + # Pass arguments to `delete_company` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `delete_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new + # + # # Call the delete_company method. + # result = client.delete_company request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest + + # Converts hash 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_company.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::Talent::V4::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.delete_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all companies associated with the project. + # + # @overload list_companies(request, options = nil) + # Pass arguments to `list_companies` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) + # Pass arguments to `list_companies` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @param require_open_jobs [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new + # + # # Call the list_companies method. + # result = client.list_companies 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::Talent::V4::Company. + # p item + # end + # + def list_companies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest + + # Converts hash 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_companies.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::Talent::V4::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_companies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_companies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.list_companies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CompanyService REST API. + # + # This class represents the configuration for CompanyService 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::Talent::V4::CompanyService::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_company to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CompanyService 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_company` + # @return [::Gapic::Config::Method] + # + attr_reader :create_company + ## + # RPC-specific configuration for `get_company` + # @return [::Gapic::Config::Method] + # + attr_reader :get_company + ## + # RPC-specific configuration for `update_company` + # @return [::Gapic::Config::Method] + # + attr_reader :update_company + ## + # RPC-specific configuration for `delete_company` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_company + ## + # RPC-specific configuration for `list_companies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_companies + + # @private + def initialize parent_rpcs = nil + create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company + @create_company = ::Gapic::Config::Method.new create_company_config + get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company + @get_company = ::Gapic::Config::Method.new get_company_config + update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company + @update_company = ::Gapic::Config::Method.new update_company_config + delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company + @delete_company = ::Gapic::Config::Method.new delete_company_config + list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies + @list_companies = ::Gapic::Config::Method.new list_companies_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb new file mode 100644 index 000000000000..c890988eb823 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" + +module Google + module Cloud + module Talent + module V4 + module CompanyService + module Rest + ## + # REST service stub for the CompanyService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] + # 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::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # A result object deserialized from the server's reply + def create_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_company_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, + method_name: "create_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] + # 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::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # A result object deserialized from the server's reply + def get_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_company_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, + method_name: "get_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] + # 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::Talent::V4::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Company] + # A result object deserialized from the server's reply + def update_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_company_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, + method_name: "update_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] + # 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_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_company_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, + method_name: "delete_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_companies REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] + # 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::Talent::V4::ListCompaniesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ListCompaniesResponse] + # A result object deserialized from the server's reply + def list_companies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_companies_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, + method_name: "list_companies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/companies", + body: "company", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v4/{company.name}", + body: "company", + matches: [ + ["company.name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_companies REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] + # 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_companies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{parent}/companies", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb new file mode 100644 index 000000000000..c07404b567d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/company_service.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/talent/v4/common_pb' +require 'google/cloud/talent/v4/company_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n,google/cloud/talent/v4/company_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/company.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x81\x01\n\x14\x43reateCompanyRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x35\n\x07\x63ompany\x18\x02 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\"F\n\x11GetCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"~\n\x14UpdateCompanyRequest\x12\x35\n\x07\x63ompany\x18\x01 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x14\x44\x65leteCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x8c\x01\n\x14ListCompaniesRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x19\n\x11require_open_jobs\x18\x04 \x01(\x08\"\xa0\x01\n\x15ListCompaniesResponse\x12\x32\n\tcompanies\x18\x01 \x03(\x0b\x32\x1f.google.cloud.talent.v4.Company\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xc3\x07\n\x0e\x43ompanyService\x12\xad\x01\n\rCreateCompany\x12,.google.cloud.talent.v4.CreateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"M\xda\x41\x0eparent,company\x82\xd3\xe4\x93\x02\x36\"+/v4/{parent=projects/*/tenants/*}/companies:\x07\x63ompany\x12\x94\x01\n\nGetCompany\x12).google.cloud.talent.v4.GetCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v4/{name=projects/*/tenants/*/companies/*}\x12\xba\x01\n\rUpdateCompany\x12,.google.cloud.talent.v4.UpdateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"Z\xda\x41\x13\x63ompany,update_mask\x82\xd3\xe4\x93\x02>23/v4/{company.name=projects/*/tenants/*/companies/*}:\x07\x63ompany\x12\x91\x01\n\rDeleteCompany\x12,.google.cloud.talent.v4.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v4/{name=projects/*/tenants/*/companies/*}\x12\xaa\x01\n\rListCompanies\x12,.google.cloud.talent.v4.ListCompaniesRequest\x1a-.google.cloud.talent.v4.ListCompaniesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v4/{parent=projects/*/tenants/*}/companies\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBm\n\x1a\x63om.google.cloud.talent.v4B\x13\x43ompanyServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Company", "google/cloud/talent/v4/company.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.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 Talent + module V4 + CreateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateCompanyRequest").msgclass + GetCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetCompanyRequest").msgclass + UpdateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateCompanyRequest").msgclass + DeleteCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteCompanyRequest").msgclass + ListCompaniesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesRequest").msgclass + ListCompaniesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb new file mode 100644 index 000000000000..970558173e7b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/company_service.proto for package 'google.cloud.talent.v4' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4/company_service_pb' + +module Google + module Cloud + module Talent + module V4 + module CompanyService + # A service that handles company management, including CRUD and enumeration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.CompanyService' + + # Creates a new company entity. + rpc :CreateCompany, ::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Google::Cloud::Talent::V4::Company + # Retrieves specified company. + rpc :GetCompany, ::Google::Cloud::Talent::V4::GetCompanyRequest, ::Google::Cloud::Talent::V4::Company + # Updates specified company. + rpc :UpdateCompany, ::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Google::Cloud::Talent::V4::Company + # Deletes specified company. + # Prerequisite: The company has no jobs associated with it. + rpc :DeleteCompany, ::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Google::Protobuf::Empty + # Lists all companies associated with the project. + rpc :ListCompanies, ::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Google::Cloud::Talent::V4::ListCompaniesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb new file mode 100644 index 000000000000..b6fa3c5a86bc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/completion/credentials" +require "google/cloud/talent/v4/completion/paths" +require "google/cloud/talent/v4/completion/client" +require "google/cloud/talent/v4/completion/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles auto completion. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/completion" + # client = ::Google::Cloud::Talent::V4::Completion::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/completion/rest" + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + module Completion + end + end + end + end +end + +helper_path = ::File.join __dir__, "completion", "helpers.rb" +require "google/cloud/talent/v4/completion/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb new file mode 100644 index 000000000000..94005a2e169b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb @@ -0,0 +1,510 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" + +module Google + module Cloud + module Talent + module V4 + module Completion + ## + # Client for the Completion service. + # + # A service handles auto completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_stub + + ## + # Configure the Completion Client class. + # + # See {::Google::Cloud::Talent::V4::Completion::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Completion clients + # ::Google::Cloud::Talent::V4::Completion::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", "Talent", "V4"] + 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.complete_query.timeout = 30.0 + default_config.rpcs.complete_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Completion 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::Talent::V4::Completion::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 + @completion_stub.universe_domain + end + + ## + # Create a new Completion client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::Completion::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Completion 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/talent/v4/completion_service_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 + + @completion_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::Completion::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, + logger: @config.logger + ) + + @completion_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @completion_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::String] + # Required. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param language_codes [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @param page_size [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @param company [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::Completion::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest + + # Converts hash 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.complete_query.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::Talent::V4::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.tenant + header_params["tenant"] = request.tenant + 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.complete_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_stub.call_rpc :complete_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Completion API. + # + # This class represents the configuration for Completion, + # 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::Talent::V4::Completion::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 + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::Completion::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 Completion 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 `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb new file mode 100644 index 000000000000..7cd296fec044 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module Completion + # Credentials for the Completion API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb new file mode 100644 index 000000000000..76d8a7f968e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module Completion + # Path helper methods for the Completion API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @return [::String] + def company_path project:, tenant:, company: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb new file mode 100644 index 000000000000..20ebc6431f70 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/completion/credentials" +require "google/cloud/talent/v4/completion/paths" +require "google/cloud/talent/v4/completion/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles auto completion. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/completion/rest" + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + module Completion + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/completion/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb new file mode 100644 index 000000000000..8d92314466de --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb @@ -0,0 +1,460 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" +require "google/cloud/talent/v4/completion/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module Completion + module Rest + ## + # REST client for the Completion service. + # + # A service handles auto completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_stub + + ## + # Configure the Completion Client class. + # + # See {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Completion clients + # ::Google::Cloud::Talent::V4::Completion::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", "Talent", "V4"] + 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.complete_query.timeout = 30.0 + default_config.rpcs.complete_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Completion 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::Talent::V4::Completion::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 + @completion_stub.universe_domain + end + + ## + # Create a new Completion REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Completion 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 + + @completion_stub = ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @completion_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @completion_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::String] + # Required. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param language_codes [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @param page_size [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @param company [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::Completion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest + + # Converts hash 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.complete_query.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::Talent::V4::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.complete_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_stub.complete_query request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Completion REST API. + # + # This class represents the configuration for Completion 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::Talent::V4::Completion::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 + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::Completion::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 Completion 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 `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb new file mode 100644 index 000000000000..05cfeeb2676d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" + +module Google + module Cloud + module Talent + module V4 + module Completion + module Rest + ## + # REST service stub for the Completion service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the complete_query REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] + # 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::Talent::V4::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] + # A result object deserialized from the server's reply + def complete_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_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, + method_name: "complete_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the complete_query REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_complete_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{tenant}:completeQuery", + matches: [ + ["tenant", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb new file mode 100644 index 000000000000..3fbf900dcf6d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/completion_service.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/talent/v4/common_pb' + + +descriptor_data = "\n/google/cloud/talent/v4/completion_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\x88\x04\n\x14\x43ompleteQueryRequest\x12\x32\n\x06tenant\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12K\n\x05scope\x18\x06 \x01(\x0e\x32<.google.cloud.talent.v4.CompleteQueryRequest.CompletionScope\x12I\n\x04type\x18\x07 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02\"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03\"\xb6\x02\n\x15\x43ompleteQueryResponse\x12Z\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32>.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult\x12:\n\x08metadata\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x1a\x84\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12I\n\x04type\x18\x02 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xa2\x02\n\nCompletion\x12\xa5\x01\n\rCompleteQuery\x12,.google.cloud.talent.v4.CompleteQueryRequest\x1a-.google.cloud.talent.v4.CompleteQueryResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//v4/{tenant=projects/*/tenants/*}:completeQuery\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBp\n\x1a\x63om.google.cloud.talent.v4B\x16\x43ompletionServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.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 Talent + module V4 + CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest").msgclass + CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionScope").enummodule + CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionType").enummodule + CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse").msgclass + CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse.CompletionResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb new file mode 100644 index 000000000000..ee3e95861429 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb @@ -0,0 +1,46 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/completion_service.proto for package 'google.cloud.talent.v4' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4/completion_service_pb' + +module Google + module Cloud + module Talent + module V4 + module Completion + # A service handles auto completion. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.Completion' + + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + rpc :CompleteQuery, ::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Google::Cloud::Talent::V4::CompleteQueryResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb new file mode 100644 index 000000000000..553b2b45aeef --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\"google/cloud/talent/v4/event.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc3\x01\n\x0b\x43lientEvent\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x35\n\tjob_event\x18\x05 \x01(\x0b\x32 .google.cloud.talent.v4.JobEventH\x00\x12\x13\n\x0b\x65vent_notes\x18\t \x01(\tB\x07\n\x05\x65vent\"\xe0\x03\n\x08JobEvent\x12@\n\x04type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.JobEvent.JobEventTypeB\x03\xe0\x41\x02\x12\x11\n\x04jobs\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xfe\x02\n\x0cJobEventType\x12\x1e\n\x1aJOB_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x11\n\rVIEW_REDIRECT\x10\x03\x12\x15\n\x11\x41PPLICATION_START\x10\x04\x12\x16\n\x12\x41PPLICATION_FINISH\x10\x05\x12 \n\x1c\x41PPLICATION_QUICK_SUBMISSION\x10\x06\x12\x18\n\x14\x41PPLICATION_REDIRECT\x10\x07\x12!\n\x1d\x41PPLICATION_START_FROM_SEARCH\x10\x08\x12$\n APPLICATION_REDIRECT_FROM_SEARCH\x10\t\x12\x1e\n\x1a\x41PPLICATION_COMPANY_SUBMIT\x10\n\x12\x0c\n\x08\x42OOKMARK\x10\x0b\x12\x10\n\x0cNOTIFICATION\x10\x0c\x12\t\n\x05HIRED\x10\r\x12\x0b\n\x07SENT_CV\x10\x0e\x12\x15\n\x11INTERVIEW_GRANTED\x10\x0f\x42\x64\n\x1a\x63om.google.cloud.talent.v4B\nEventProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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 Talent + module V4 + ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ClientEvent").msgclass + JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent").msgclass + JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent.JobEventType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb new file mode 100644 index 000000000000..3eae631b03f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/event_service/credentials" +require "google/cloud/talent/v4/event_service/paths" +require "google/cloud/talent/v4/event_service/client" +require "google/cloud/talent/v4/event_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles client event report. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/event_service" + # client = ::Google::Cloud::Talent::V4::EventService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/event_service/rest" + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + module EventService + end + end + end + end +end + +helper_path = ::File.join __dir__, "event_service", "helpers.rb" +require "google/cloud/talent/v4/event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb new file mode 100644 index 000000000000..caae115348d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb @@ -0,0 +1,488 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" + +module Google + module Cloud + module Talent + module V4 + module EventService + ## + # Client for the EventService service. + # + # A service handles client event report. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :event_service_stub + + ## + # Configure the EventService Client class. + # + # See {::Google::Cloud::Talent::V4::EventService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EventService clients + # ::Google::Cloud::Talent::V4::EventService::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", "Talent", "V4"] + 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_client_event.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EventService 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::Talent::V4::EventService::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 + @event_service_stub.universe_domain + end + + ## + # Create a new EventService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::EventService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EventService 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/talent/v4/event_service_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 + + @event_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::EventService::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, + logger: @config.logger + ) + + @event_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @event_service_stub.logger + end + + # Service calls + + ## + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + # + # @overload create_client_event(request, options = nil) + # Pass arguments to `create_client_event` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) + # Pass arguments to `create_client_event` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::ClientEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::EventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new + # + # # Call the create_client_event method. + # result = client.create_client_event request + # + # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. + # p result + # + def create_client_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest + + # Converts hash 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_client_event.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::Talent::V4::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_client_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_client_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @event_service_stub.call_rpc :create_client_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EventService API. + # + # This class represents the configuration for EventService, + # 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::Talent::V4::EventService::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_client_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::EventService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 EventService 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_client_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_client_event + + # @private + def initialize parent_rpcs = nil + create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event + @create_client_event = ::Gapic::Config::Method.new create_client_event_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb new file mode 100644 index 000000000000..3909062c4684 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module EventService + # Credentials for the EventService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb new file mode 100644 index 000000000000..bdb45a8600a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module EventService + # Path helper methods for the EventService API. + module Paths + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb new file mode 100644 index 000000000000..b3d12ce1a69a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/event_service/credentials" +require "google/cloud/talent/v4/event_service/paths" +require "google/cloud/talent/v4/event_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles client event report. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/event_service/rest" + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + module EventService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb new file mode 100644 index 000000000000..43bd04679cc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" +require "google/cloud/talent/v4/event_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module EventService + module Rest + ## + # REST client for the EventService service. + # + # A service handles client event report. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :event_service_stub + + ## + # Configure the EventService Client class. + # + # See {::Google::Cloud::Talent::V4::EventService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EventService clients + # ::Google::Cloud::Talent::V4::EventService::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", "Talent", "V4"] + 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_client_event.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EventService 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::Talent::V4::EventService::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 + @event_service_stub.universe_domain + end + + ## + # Create a new EventService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EventService 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 + + @event_service_stub = ::Google::Cloud::Talent::V4::EventService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @event_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @event_service_stub.logger + end + + # Service calls + + ## + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + # + # @overload create_client_event(request, options = nil) + # Pass arguments to `create_client_event` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) + # Pass arguments to `create_client_event` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::ClientEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::EventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new + # + # # Call the create_client_event method. + # result = client.create_client_event request + # + # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. + # p result + # + def create_client_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest + + # Converts hash 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_client_event.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::Talent::V4::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_client_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_client_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @event_service_stub.create_client_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EventService REST API. + # + # This class represents the configuration for EventService 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::Talent::V4::EventService::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_client_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::EventService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 EventService 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_client_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_client_event + + # @private + def initialize parent_rpcs = nil + create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event + @create_client_event = ::Gapic::Config::Method.new create_client_event_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb new file mode 100644 index 000000000000..1df84a12be19 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" + +module Google + module Cloud + module Talent + module V4 + module EventService + module Rest + ## + # REST service stub for the EventService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_client_event REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] + # 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::Talent::V4::ClientEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # A result object deserialized from the server's reply + def create_client_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_client_event_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, + method_name: "create_client_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ClientEvent.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_client_event REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] + # 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_client_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/clientEvents", + body: "client_event", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb new file mode 100644 index 000000000000..b6407a59f4e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/event_service.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/talent/v4/event_pb' + + +descriptor_data = "\n*google/cloud/talent/v4/event_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/talent/v4/event.proto\"\x8e\x01\n\x18\x43reateClientEventRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12>\n\x0c\x63lient_event\x18\x02 \x01(\x0b\x32#.google.cloud.talent.v4.ClientEventB\x03\xe0\x41\x02\x32\xc5\x02\n\x0c\x45ventService\x12\xc6\x01\n\x11\x43reateClientEvent\x12\x30.google.cloud.talent.v4.CreateClientEventRequest\x1a#.google.cloud.talent.v4.ClientEvent\"Z\xda\x41\x13parent,client_event\x82\xd3\xe4\x93\x02>\"./v4/{parent=projects/*/tenants/*}/clientEvents:\x0c\x63lient_event\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBk\n\x1a\x63om.google.cloud.talent.v4B\x11\x45ventServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.ClientEvent", "google/cloud/talent/v4/event.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 Talent + module V4 + CreateClientEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateClientEventRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb new file mode 100644 index 000000000000..4e21dbe2ff0e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/event_service.proto for package 'google.cloud.talent.v4' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4/event_service_pb' + +module Google + module Cloud + module Talent + module V4 + module EventService + # A service handles client event report. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.EventService' + + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + rpc :CreateClientEvent, ::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Google::Cloud::Talent::V4::ClientEvent + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb new file mode 100644 index 000000000000..d1a60f54d060 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/filters.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/talent/v4/common_pb' +require 'google/protobuf/duration_pb' +require 'google/type/latlng_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n$google/cloud/talent/v4/filters.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x18google/type/latlng.proto\x1a\x1bgoogle/type/timeofday.proto\"\xe2\x04\n\x08JobQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x1b\n\x13query_language_code\x18\x0e \x01(\t\x12\x11\n\tcompanies\x18\x02 \x03(\t\x12@\n\x10location_filters\x18\x03 \x03(\x0b\x32&.google.cloud.talent.v4.LocationFilter\x12;\n\x0ejob_categories\x18\x04 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x12=\n\x0e\x63ommute_filter\x18\x05 \x01(\x0b\x32%.google.cloud.talent.v4.CommuteFilter\x12\x1d\n\x15\x63ompany_display_names\x18\x06 \x03(\t\x12G\n\x13\x63ompensation_filter\x18\x07 \x01(\x0b\x32*.google.cloud.talent.v4.CompensationFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x08 \x01(\t\x12\x1b\n\x13\x64isable_spell_check\x18\t \x01(\x08\x12@\n\x10\x65mployment_types\x18\n \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x16\n\x0elanguage_codes\x18\x0b \x03(\t\x12\x42\n\x12publish_time_range\x18\x0c \x01(\x0b\x32&.google.cloud.talent.v4.TimestampRange\x12\x15\n\rexcluded_jobs\x18\r \x03(\t\"\xed\x02\n\x0eLocationFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x19\n\x11\x64istance_in_miles\x18\x04 \x01(\x01\x12\\\n\x16telecommute_preference\x18\x05 \x01(\x0e\x32<.google.cloud.talent.v4.LocationFilter.TelecommutePreference\"\x95\x01\n\x15TelecommutePreference\x12&\n\"TELECOMMUTE_PREFERENCE_UNSPECIFIED\x10\x00\x12\x1c\n\x14TELECOMMUTE_EXCLUDED\x10\x01\x1a\x02\x08\x01\x12\x17\n\x13TELECOMMUTE_ALLOWED\x10\x02\x12\x1d\n\x19TELECOMMUTE_JOBS_EXCLUDED\x10\x03\"\xbb\x03\n\x12\x43ompensationFilter\x12H\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.talent.v4.CompensationFilter.FilterTypeB\x03\xe0\x41\x02\x12M\n\x05units\x18\x02 \x03(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnitB\x03\xe0\x41\x02\x12I\n\x05range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRange\x12\x38\n0include_jobs_with_unspecified_compensation_range\x18\x04 \x01(\x08\"\x86\x01\n\nFilterType\x12\x1b\n\x17\x46ILTER_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tUNIT_ONLY\x10\x01\x12\x13\n\x0fUNIT_AND_AMOUNT\x10\x02\x12\x1a\n\x16\x41NNUALIZED_BASE_AMOUNT\x10\x03\x12\x1b\n\x17\x41NNUALIZED_TOTAL_AMOUNT\x10\x04\"\xc1\x03\n\rCommuteFilter\x12\x42\n\x0e\x63ommute_method\x18\x01 \x01(\x0e\x32%.google.cloud.talent.v4.CommuteMethodB\x03\xe0\x41\x02\x12\x33\n\x11start_coordinates\x18\x02 \x01(\x0b\x32\x13.google.type.LatLngB\x03\xe0\x41\x02\x12\x37\n\x0ftravel_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12!\n\x19\x61llow_imprecise_addresses\x18\x04 \x01(\x08\x12I\n\x0croad_traffic\x18\x05 \x01(\x0e\x32\x31.google.cloud.talent.v4.CommuteFilter.RoadTrafficH\x00\x12\x30\n\x0e\x64\x65parture_time\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00\"L\n\x0bRoadTraffic\x12\x1c\n\x18ROAD_TRAFFIC_UNSPECIFIED\x10\x00\x12\x10\n\x0cTRAFFIC_FREE\x10\x01\x12\r\n\tBUSY_HOUR\x10\x02\x42\x10\n\x0etraffic_optionBf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x46iltersProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.TimestampRange", "google/cloud/talent/v4/common.proto"], + ["google.type.LatLng", "google/type/latlng.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.type.TimeOfDay", "google/type/timeofday.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 Talent + module V4 + JobQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobQuery").msgclass + LocationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter").msgclass + LocationFilter::TelecommutePreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter.TelecommutePreference").enummodule + CompensationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter").msgclass + CompensationFilter::FilterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter.FilterType").enummodule + CommuteFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter").msgclass + CommuteFilter::RoadTraffic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter.RoadTraffic").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb new file mode 100644 index 000000000000..a698ce351fce --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/histogram.proto + +require 'google/protobuf' + + +descriptor_data = "\n&google/cloud/talent/v4/histogram.proto\x12\x16google.cloud.talent.v4\")\n\x0eHistogramQuery\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\"\xb1\x01\n\x14HistogramQueryResult\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\x12N\n\thistogram\x18\x02 \x03(\x0b\x32;.google.cloud.talent.v4.HistogramQueryResult.HistogramEntry\x1a\x30\n\x0eHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42h\n\x1a\x63om.google.cloud.talent.v4B\x0eHistogramProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ + ] + 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 Talent + module V4 + HistogramQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQuery").msgclass + HistogramQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQueryResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb new file mode 100644 index 000000000000..f32b2914b46c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n google/cloud/talent/v4/job.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x0e\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x07\x63ompany\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12\x1b\n\x0erequisition_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\taddresses\x18\x06 \x03(\t\x12\x45\n\x10\x61pplication_info\x18\x07 \x01(\x0b\x32+.google.cloud.talent.v4.Job.ApplicationInfo\x12\x38\n\x0cjob_benefits\x18\x08 \x03(\x0e\x32\".google.cloud.talent.v4.JobBenefit\x12\x43\n\x11\x63ompensation_info\x18\t \x01(\x0b\x32(.google.cloud.talent.v4.CompensationInfo\x12L\n\x11\x63ustom_attributes\x18\n \x03(\x0b\x32\x31.google.cloud.talent.v4.Job.CustomAttributesEntry\x12\x38\n\x0c\x64\x65gree_types\x18\x0b \x03(\x0e\x32\".google.cloud.talent.v4.DegreeType\x12\x12\n\ndepartment\x18\x0c \x01(\t\x12@\n\x10\x65mployment_types\x18\r \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x12\n\nincentives\x18\x0e \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12\x33\n\tjob_level\x18\x10 \x01(\x0e\x32 .google.cloud.talent.v4.JobLevel\x12\x17\n\x0fpromotion_value\x18\x11 \x01(\x05\x12\x16\n\x0equalifications\x18\x12 \x01(\t\x12\x18\n\x10responsibilities\x18\x13 \x01(\t\x12=\n\x0eposting_region\x18\x14 \x01(\x0e\x32%.google.cloud.talent.v4.PostingRegion\x12:\n\nvisibility\x18\x15 \x01(\x0e\x32\".google.cloud.talent.v4.VisibilityB\x02\x18\x01\x12\x32\n\x0ejob_start_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cjob_end_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14posting_publish_time\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x13posting_expire_time\x18\x19 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x13posting_create_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13posting_update_time\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12!\n\x14\x63ompany_display_name\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x0c\x64\x65rived_info\x18\x1d \x01(\x0b\x32\'.google.cloud.talent.v4.Job.DerivedInfoB\x03\xe0\x41\x03\x12I\n\x12processing_options\x18\x1e \x01(\x0b\x32-.google.cloud.talent.v4.Job.ProcessingOptions\x1a\x44\n\x0f\x41pplicationInfo\x12\x0e\n\x06\x65mails\x18\x01 \x03(\t\x12\x13\n\x0binstruction\x18\x02 \x01(\t\x12\x0c\n\x04uris\x18\x03 \x03(\t\x1a\x7f\n\x0b\x44\x65rivedInfo\x12\x33\n\tlocations\x18\x01 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12;\n\x0ejob_categories\x18\x03 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x1a\x83\x01\n\x11ProcessingOptions\x12)\n!disable_street_address_resolution\x18\x01 \x01(\x08\x12\x43\n\x11html_sanitization\x18\x02 \x01(\x0e\x32(.google.cloud.talent.v4.HtmlSanitization\x1a`\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.talent.v4.CustomAttribute:\x02\x38\x01:L\xea\x41I\n\x17jobs.googleapis.com/Job\x12.projects/{project}/tenants/{tenant}/jobs/{job}Bb\n\x1a\x63om.google.cloud.talent.v4B\x08JobProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.CompensationInfo", "google/cloud/talent/v4/common.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 Talent + module V4 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job").msgclass + Job::ApplicationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ApplicationInfo").msgclass + Job::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.DerivedInfo").msgclass + Job::ProcessingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ProcessingOptions").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb new file mode 100644 index 000000000000..72fd641b46a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/job_service/credentials" +require "google/cloud/talent/v4/job_service/paths" +require "google/cloud/talent/v4/job_service/operations" +require "google/cloud/talent/v4/job_service/client" +require "google/cloud/talent/v4/job_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles job management, including job CRUD, enumeration and search. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/job_service" + # client = ::Google::Cloud::Talent::V4::JobService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/job_service/rest" + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + module JobService + end + end + end + end +end + +helper_path = ::File.join __dir__, "job_service", "helpers.rb" +require "google/cloud/talent/v4/job_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb new file mode 100644 index 000000000000..0c49b93e652d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb @@ -0,0 +1,2062 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" + +module Google + module Cloud + module Talent + module V4 + module JobService + ## + # Client for the JobService service. + # + # A service handles job management, including job CRUD, enumeration and search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::Talent::V4::JobService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::Talent::V4::JobService::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", "Talent", "V4"] + 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_job.timeout = 30.0 + + default_config.rpcs.batch_create_jobs.timeout = 30.0 + + default_config.rpcs.get_job.timeout = 30.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_job.timeout = 30.0 + + default_config.rpcs.batch_update_jobs.timeout = 30.0 + + default_config.rpcs.delete_job.timeout = 30.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_delete_jobs.timeout = 30.0 + + default_config.rpcs.list_jobs.timeout = 30.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_jobs.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobService 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::Talent::V4::JobService::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_service_stub.universe_domain + end + + ## + # Create a new JobService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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/talent/v4/job_service_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_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::JobService::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, + logger: @config.logger + ) + + @job_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4::JobService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) + # Pass arguments to `create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest + + # Converts hash 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_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::Talent::V4::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_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch create jobs operation. + # + # @overload batch_create_jobs(request, options = nil) + # Pass arguments to `batch_create_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_jobs(parent: nil, jobs: nil) + # Pass arguments to `batch_create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be created. + # A maximum of 200 jobs can be created in a batch. + # + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new + # + # # Call the batch_create_jobs method. + # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest + + # Converts hash 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.batch_create_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::Talent::V4::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.batch_create_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_create_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_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_service_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(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 job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise + # all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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.job&.name + header_params["job.name"] = request.job.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_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_service_stub.call_rpc :update_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch update jobs operation. + # + # @overload batch_update_jobs(request, options = nil) + # Pass arguments to `batch_update_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) + # Pass arguments to `batch_update_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be updated. + # A maximum of 200 jobs can be updated in a batch. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} + # are updated. Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside + # {::Google::Cloud::Talent::V4::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, + # which can yield a very large response. + # + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new + # + # # Call the batch_update_jobs method. + # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest + + # Converts hash 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.batch_update_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::Talent::V4::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.batch_update_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_update_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_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_service_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch delete jobs operation. + # + # @overload batch_delete_jobs(request, options = nil) + # Pass arguments to `batch_delete_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_delete_jobs(parent: nil, names: nil) + # Pass arguments to `batch_delete_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # + # The parent of all of the jobs specified in `names` must match this field. + # @param names [::Array<::String>] + # The names of the jobs to delete. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". + # For example, "projects/foo/tenants/bar/jobs/baz". + # + # A maximum of 200 jobs can be deleted in a batch. + # + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new + # + # # Call the batch_delete_jobs method. + # result = client.batch_delete_jobs 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 batch_delete_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest + + # Converts hash 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.batch_delete_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::Talent::V4::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.batch_delete_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_delete_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists jobs by filter. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param filter [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @param page_token [::String] + # The starting point of a query result. + # @param page_size [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no + # value is specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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::Talent::V4::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_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_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs that the caller has permission to search + # against. + # + # @overload search_jobs(request, options = nil) + # Pass arguments to `search_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_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 parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs method. + # result = client.search_jobs request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash 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.search_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::Talent::V4::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.search_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :search_jobs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), it has different algorithmic + # adjustments that are designed to specifically target passive job seekers. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs the caller has permission to search + # against. + # + # @overload search_jobs_for_alert(request, options = nil) + # Pass arguments to `search_jobs_for_alert` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs_for_alert method. + # result = client.search_jobs_for_alert request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs_for_alert request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash 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.search_jobs_for_alert.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::Talent::V4::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.search_jobs_for_alert.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :search_jobs_for_alert, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the JobService API. + # + # This class represents the configuration for JobService, + # 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::Talent::V4::JobService::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_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::JobService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 JobService 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_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `batch_create_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `batch_update_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_jobs + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `batch_delete_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_jobs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `search_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs + ## + # RPC-specific configuration for `search_jobs_for_alert` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs_for_alert + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs + @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs + @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs + @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs + @search_jobs = ::Gapic::Config::Method.new search_jobs_config + search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert + @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb new file mode 100644 index 000000000000..8264c8770c63 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module JobService + # Credentials for the JobService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb new file mode 100644 index 000000000000..7519b6ebba50 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module JobService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobService 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 JobService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::Talent::V4::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? + throw :response, 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::Talent::V4::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? + throw :response, 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::Talent::V4::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? + 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::Talent::V4::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? + 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::Talent::V4::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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb new file mode 100644 index 000000000000..b40f2cddc538 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module JobService + # Path helper methods for the JobService API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @return [::String] + def company_path project:, tenant:, company: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end + + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/jobs/{job}` + # + # @param project [String] + # @param tenant [String] + # @param job [String] + # + # @return [::String] + def job_path project:, tenant:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/jobs/#{job}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb new file mode 100644 index 000000000000..2155d4710be6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/job_service/credentials" +require "google/cloud/talent/v4/job_service/paths" +require "google/cloud/talent/v4/job_service/rest/operations" +require "google/cloud/talent/v4/job_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service handles job management, including job CRUD, enumeration and search. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/job_service/rest" + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + module JobService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/job_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb new file mode 100644 index 000000000000..88db35d75db8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb @@ -0,0 +1,1949 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module JobService + module Rest + ## + # REST client for the JobService service. + # + # A service handles job management, including job CRUD, enumeration and search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::Talent::V4::JobService::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", "Talent", "V4"] + 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_job.timeout = 30.0 + + default_config.rpcs.batch_create_jobs.timeout = 30.0 + + default_config.rpcs.get_job.timeout = 30.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_job.timeout = 30.0 + + default_config.rpcs.batch_update_jobs.timeout = 30.0 + + default_config.rpcs.delete_job.timeout = 30.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_delete_jobs.timeout = 30.0 + + default_config.rpcs.list_jobs.timeout = 30.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_jobs.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobService 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::Talent::V4::JobService::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_service_stub.universe_domain + end + + ## + # Create a new JobService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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::Talent::V4::JobService::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_service_stub = ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @job_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4::JobService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) + # Pass arguments to `create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest + + # Converts hash 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_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::Talent::V4::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_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch create jobs operation. + # + # @overload batch_create_jobs(request, options = nil) + # Pass arguments to `batch_create_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_create_jobs(parent: nil, jobs: nil) + # Pass arguments to `batch_create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be created. + # A maximum of 200 jobs can be created in a batch. + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new + # + # # Call the batch_create_jobs method. + # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest + + # Converts hash 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.batch_create_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::Talent::V4::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.batch_create_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_create_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(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 job [::Google::Cloud::Talent::V4::Job, ::Hash] + # Required. The Job to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise + # all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.update_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch update jobs operation. + # + # @overload batch_update_jobs(request, options = nil) + # Pass arguments to `batch_update_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) + # Pass arguments to `batch_update_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] + # Required. The jobs to be updated. + # A maximum of 200 jobs can be updated in a batch. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} + # are updated. Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside + # {::Google::Cloud::Talent::V4::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, + # which can yield a very large response. + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new + # + # # Call the batch_update_jobs method. + # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest + + # Converts hash 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.batch_update_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::Talent::V4::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.batch_update_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_update_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.delete_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch delete jobs operation. + # + # @overload batch_delete_jobs(request, options = nil) + # Pass arguments to `batch_delete_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_delete_jobs(parent: nil, names: nil) + # Pass arguments to `batch_delete_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # + # The parent of all of the jobs specified in `names` must match this field. + # @param names [::Array<::String>] + # The names of the jobs to delete. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". + # For example, "projects/foo/tenants/bar/jobs/baz". + # + # A maximum of 200 jobs can be deleted in a batch. + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new + # + # # Call the batch_delete_jobs method. + # result = client.batch_delete_jobs 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 batch_delete_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest + + # Converts hash 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.batch_delete_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::Talent::V4::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.batch_delete_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_delete_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists jobs by filter. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param filter [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @param page_token [::String] + # The starting point of a query result. + # @param page_size [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no + # value is specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_jobs, "jobs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs that the caller has permission to search + # against. + # + # @overload search_jobs(request, options = nil) + # Pass arguments to `search_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_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 parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs method. + # result = client.search_jobs request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash 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.search_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::Talent::V4::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.search_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.search_jobs request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), it has different algorithmic + # adjustments that are designed to specifically target passive job seekers. + # + # This call constrains the + # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the + # database, and only returns jobs the caller has permission to search + # against. + # + # @overload search_jobs_for_alert(request, options = nil) + # Pass arguments to `search_jobs_for_alert` via a request object, either of type + # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param max_page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # + # # Call the search_jobs_for_alert method. + # result = client.search_jobs_for_alert request + # + # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + # p result + # + def search_jobs_for_alert request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest + + # Converts hash 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.search_jobs_for_alert.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::Talent::V4::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.search_jobs_for_alert.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.search_jobs_for_alert request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the JobService REST API. + # + # This class represents the configuration for JobService 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::Talent::V4::JobService::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_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::JobService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 JobService 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_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `batch_create_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `batch_update_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_jobs + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `batch_delete_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_jobs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `search_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs + ## + # RPC-specific configuration for `search_jobs_for_alert` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs_for_alert + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs + @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs + @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs + @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs + @search_jobs = ::Gapic::Config::Method.new search_jobs_config + search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert + @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb new file mode 100644 index 000000000000..2a2c90d09cf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module JobService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobService 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 JobService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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::Talent::V4::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? + throw :response, 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::Talent::V4::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? + throw :response, 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::Talent::V4::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? + 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::Talent::V4::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? + 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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{^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: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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{^operations(?:/.*)?$}, true] + ] + ) + 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", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb new file mode 100644 index 000000000000..634719f7c02e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb @@ -0,0 +1,698 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" + +module Google + module Cloud + module Talent + module V4 + module JobService + module Rest + ## + # REST service stub for the JobService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] + # 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::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Job] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_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, + method_name: "create_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_create_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] + # 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 batch_create_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_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, + method_name: "batch_create_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::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, + method_name: "get_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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::Talent::V4::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::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, + method_name: "update_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_update_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] + # 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 batch_update_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_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, + method_name: "batch_update_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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, + method_name: "delete_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_delete_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] + # 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 batch_delete_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_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, + method_name: "batch_delete_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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::Talent::V4::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::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, + method_name: "list_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # 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::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # A result object deserialized from the server's reply + def search_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_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, + method_name: "search_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_jobs_for_alert REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # 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::Talent::V4::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] + # A result object deserialized from the server's reply + def search_jobs_for_alert request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_for_alert_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, + method_name: "search_jobs_for_alert", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] + # 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_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs", + body: "job", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{job.name}", + body: "job", + matches: [ + ["job.name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_update_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_delete_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:search", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_jobs_for_alert REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_jobs_for_alert_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/jobs:searchForAlert", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb new file mode 100644 index 000000000000..43897fc5869c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/job_service.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/talent/v4/common_pb' +require 'google/cloud/talent/v4/filters_pb' +require 'google/cloud/talent/v4/histogram_pb' +require 'google/cloud/talent/v4/job_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n(google/cloud/talent/v4/job_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/filters.proto\x1a&google/cloud/talent/v4/histogram.proto\x1a google/cloud/talent/v4/job.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"r\n\x10\x43reateJobRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12-\n\x03job\x18\x02 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\">\n\rGetJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"r\n\x10UpdateJobRequest\x12-\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"A\n\x10\x44\x65leteJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"\xb1\x01\n\x0fListJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x31\n\x08job_view\x18\x05 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\"\x92\x01\n\x10ListJobsResponse\x12)\n\x04jobs\x18\x01 \x03(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\"\x9d\r\n\x11SearchJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12I\n\x0bsearch_mode\x18\x02 \x01(\x0e\x32\x34.google.cloud.talent.v4.SearchJobsRequest.SearchMode\x12\x46\n\x10request_metadata\x18\x03 \x01(\x0b\x32\'.google.cloud.talent.v4.RequestMetadataB\x03\xe0\x41\x02\x12\x33\n\tjob_query\x18\x04 \x01(\x0b\x32 .google.cloud.talent.v4.JobQuery\x12\x19\n\x11\x65nable_broadening\x18\x05 \x01(\x08\x12\x41\n\x11histogram_queries\x18\x07 \x03(\x0b\x32&.google.cloud.talent.v4.HistogramQuery\x12\x31\n\x08job_view\x18\x08 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x15\n\rmax_page_size\x18\n \x01(\x05\x12\x12\n\npage_token\x18\x0b \x01(\t\x12\x10\n\x08order_by\x18\x0c \x01(\t\x12]\n\x15\x64iversification_level\x18\r \x01(\x0e\x32>.google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel\x12X\n\x13\x63ustom_ranking_info\x18\x0e \x01(\x0b\x32;.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo\x12!\n\x15\x64isable_keyword_match\x18\x10 \x01(\x08\x42\x02\x18\x01\x12V\n\x12keyword_match_mode\x18\x12 \x01(\x0e\x32:.google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode\x12^\n\x13relevance_threshold\x18\x13 \x01(\x0e\x32<.google.cloud.talent.v4.SearchJobsRequest.RelevanceThresholdB\x03\xe0\x41\x01\x1a\x95\x02\n\x11\x43ustomRankingInfo\x12j\n\x10importance_level\x18\x01 \x01(\x0e\x32K.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevelB\x03\xe0\x41\x02\x12\x1f\n\x12ranking_expression\x18\x02 \x01(\tB\x03\xe0\x41\x02\"s\n\x0fImportanceLevel\x12 \n\x1cIMPORTANCE_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\x08\n\x04MILD\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\x0b\n\x07\x45XTREME\x10\x06\"R\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nJOB_SEARCH\x10\x01\x12\x17\n\x13\x46\x45\x41TURED_JOB_SEARCH\x10\x02\"\xc0\x01\n\x14\x44iversificationLevel\x12%\n!DIVERSIFICATION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\n\n\x06SIMPLE\x10\x02\x12\x13\n\x0fONE_PER_COMPANY\x10\x03\x12\x13\n\x0fTWO_PER_COMPANY\x10\x04\x12\x19\n\x15MAX_THREE_PER_COMPANY\x10\x06\x12\"\n\x1e\x44IVERSIFY_BY_LOOSER_SIMILARITY\x10\x05\"\x87\x01\n\x10KeywordMatchMode\x12\"\n\x1eKEYWORD_MATCH_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16KEYWORD_MATCH_DISABLED\x10\x01\x12\x15\n\x11KEYWORD_MATCH_ALL\x10\x02\x12\x1c\n\x18KEYWORD_MATCH_TITLE_ONLY\x10\x03\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\x91\x06\n\x12SearchJobsResponse\x12M\n\rmatching_jobs\x18\x01 \x03(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.MatchingJob\x12M\n\x17histogram_query_results\x18\x02 \x03(\x0b\x32,.google.cloud.talent.v4.HistogramQueryResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12:\n\x10location_filters\x18\x04 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12\x12\n\ntotal_size\x18\x06 \x01(\x05\x12:\n\x08metadata\x18\x07 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x12\"\n\x1a\x62roadened_query_jobs_count\x18\x08 \x01(\x05\x12\x44\n\x10spell_correction\x18\t \x01(\x0b\x32*.google.cloud.talent.v4.SpellingCorrection\x1a\xd2\x01\n\x0bMatchingJob\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x13\n\x0bjob_summary\x18\x02 \x01(\t\x12\x19\n\x11job_title_snippet\x18\x03 \x01(\t\x12\x1b\n\x13search_text_snippet\x18\x04 \x01(\t\x12L\n\x0c\x63ommute_info\x18\x05 \x01(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo\x1ay\n\x0b\x43ommuteInfo\x12\x36\n\x0cjob_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location\x12\x32\n\x0ftravel_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"y\n\x16\x42\x61tchCreateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\"\xaa\x01\n\x16\x42\x61tchUpdateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"y\n\x16\x42\x61tchDeleteJobsRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12+\n\x05names\x18\x02 \x03(\tB\x1c\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"Y\n\tJobResult\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"Q\n\x17\x42\x61tchCreateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchUpdateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchDeleteJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult*v\n\x07JobView\x12\x18\n\x14JOB_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_VIEW_ID_ONLY\x10\x01\x12\x14\n\x10JOB_VIEW_MINIMAL\x10\x02\x12\x12\n\x0eJOB_VIEW_SMALL\x10\x03\x12\x11\n\rJOB_VIEW_FULL\x10\x04\x32\xdc\x0e\n\nJobService\x12\x94\x01\n\tCreateJob\x12(.google.cloud.talent.v4.CreateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"@\xda\x41\nparent,job\x82\xd3\xe4\x93\x02-\"&/v4/{parent=projects/*/tenants/*}/jobs:\x03job\x12\xe1\x01\n\x0f\x42\x61tchCreateJobs\x12..google.cloud.talent.v4.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchCreateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*\x12\x83\x01\n\x06GetJob\x12%.google.cloud.talent.v4.GetJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(\x12&/v4/{name=projects/*/tenants/*/jobs/*}\x12\x9d\x01\n\tUpdateJob\x12(.google.cloud.talent.v4.UpdateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"I\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x31\x32*/v4/{job.name=projects/*/tenants/*/jobs/*}:\x03job\x12\xe1\x01\n\x0f\x42\x61tchUpdateJobs\x12..google.cloud.talent.v4.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchUpdateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*\x12\x84\x01\n\tDeleteJob\x12(.google.cloud.talent.v4.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(*&/v4/{name=projects/*/tenants/*/jobs/*}\x12\xe3\x01\n\x0f\x42\x61tchDeleteJobs\x12..google.cloud.talent.v4.BatchDeleteJobsRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x31\n\x17\x42\x61tchDeleteJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*\x12\x9d\x01\n\x08ListJobs\x12\'.google.cloud.talent.v4.ListJobsRequest\x1a(.google.cloud.talent.v4.ListJobsResponse\">\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02(\x12&/v4/{parent=projects/*/tenants/*}/jobs\x12\x9d\x01\n\nSearchJobs\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"8\x82\xd3\xe4\x93\x02\x32\"-/v4/{parent=projects/*/tenants/*}/jobs:search:\x01*\x12\xad\x01\n\x12SearchJobsForAlert\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"@\x82\xd3\xe4\x93\x02:\"5/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBi\n\x1a\x63om.google.cloud.talent.v4B\x0fJobServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Job", "google/cloud/talent/v4/job.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.proto"], + ["google.cloud.talent.v4.JobQuery", "google/cloud/talent/v4/filters.proto"], + ["google.cloud.talent.v4.HistogramQuery", "google/cloud/talent/v4/histogram.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.rpc.Status", "google/rpc/status.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 Talent + module V4 + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateJobRequest").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetJobRequest").msgclass + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteJobRequest").msgclass + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsResponse").msgclass + SearchJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest").msgclass + SearchJobsRequest::CustomRankingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo").msgclass + SearchJobsRequest::CustomRankingInfo::ImportanceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel").enummodule + SearchJobsRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.SearchMode").enummodule + SearchJobsRequest::DiversificationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel").enummodule + SearchJobsRequest::KeywordMatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode").enummodule + SearchJobsRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold").enummodule + SearchJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse").msgclass + SearchJobsResponse::MatchingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.MatchingJob").msgclass + SearchJobsResponse::CommuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.CommuteInfo").msgclass + BatchCreateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsRequest").msgclass + BatchUpdateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsRequest").msgclass + BatchDeleteJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsRequest").msgclass + JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobResult").msgclass + BatchCreateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsResponse").msgclass + BatchUpdateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsResponse").msgclass + BatchDeleteJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsResponse").msgclass + JobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobView").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb new file mode 100644 index 000000000000..e1a90f630e33 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb @@ -0,0 +1,90 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/job_service.proto for package 'google.cloud.talent.v4' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4/job_service_pb' + +module Google + module Cloud + module Talent + module V4 + module JobService + # A service handles job management, including job CRUD, enumeration and search. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.JobService' + + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + rpc :CreateJob, ::Google::Cloud::Talent::V4::CreateJobRequest, ::Google::Cloud::Talent::V4::Job + # Begins executing a batch create jobs operation. + rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Google::Longrunning::Operation + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + rpc :GetJob, ::Google::Cloud::Talent::V4::GetJobRequest, ::Google::Cloud::Talent::V4::Job + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + rpc :UpdateJob, ::Google::Cloud::Talent::V4::UpdateJobRequest, ::Google::Cloud::Talent::V4::Job + # Begins executing a batch update jobs operation. + rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Google::Longrunning::Operation + # Deletes the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + rpc :DeleteJob, ::Google::Cloud::Talent::V4::DeleteJobRequest, ::Google::Protobuf::Empty + # Begins executing a batch delete jobs operation. + rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Google::Longrunning::Operation + # Lists jobs by filter. + rpc :ListJobs, ::Google::Cloud::Talent::V4::ListJobsRequest, ::Google::Cloud::Talent::V4::ListJobsResponse + # Searches for jobs using the provided + # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + # + # This call constrains the + # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the + # database, and only returns jobs that the caller has permission to search + # against. + rpc :SearchJobs, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse + # Searches for jobs using the provided + # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), it has different algorithmic + # adjustments that are designed to specifically target passive job seekers. + # + # This call constrains the + # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the + # database, and only returns jobs the caller has permission to search + # against. + rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb new file mode 100644 index 000000000000..e29f66d86a27 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service/rest" +require "google/cloud/talent/v4/completion/rest" +require "google/cloud/talent/v4/event_service/rest" +require "google/cloud/talent/v4/job_service/rest" +require "google/cloud/talent/v4/tenant_service/rest" +require "google/cloud/talent/v4/version" + +module Google + module Cloud + module Talent + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/talent/v4/rest" + # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new + # + module V4 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb new file mode 100644 index 000000000000..3fd37382f449 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/tenant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n#google/cloud/talent/v4/tenant.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"v\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x02 \x01(\tB\x03\xe0\x41\x02:D\xea\x41\x41\n\x1ajobs.googleapis.com/Tenant\x12#projects/{project}/tenants/{tenant}Be\n\x1a\x63om.google.cloud.talent.v4B\x0bTenantProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ + ] + 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 Talent + module V4 + Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Tenant").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb new file mode 100644 index 000000000000..ee4160331939 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/tenant_service/credentials" +require "google/cloud/talent/v4/tenant_service/paths" +require "google/cloud/talent/v4/tenant_service/client" +require "google/cloud/talent/v4/tenant_service/rest" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles tenant management, including CRUD and enumeration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4/tenant_service" + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4/tenant_service/rest" + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + module TenantService + end + end + end + end +end + +helper_path = ::File.join __dir__, "tenant_service", "helpers.rb" +require "google/cloud/talent/v4/tenant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb new file mode 100644 index 000000000000..fc1db7f8bdb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb @@ -0,0 +1,897 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" + +module Google + module Cloud + module Talent + module V4 + module TenantService + ## + # Client for the TenantService service. + # + # A service that handles tenant management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tenant_service_stub + + ## + # Configure the TenantService Client class. + # + # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TenantService clients + # ::Google::Cloud::Talent::V4::TenantService::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", "Talent", "V4"] + 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_tenant.timeout = 30.0 + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tenants.timeout = 30.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TenantService 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::Talent::V4::TenantService::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 + @tenant_service_stub.universe_domain + end + + ## + # Create a new TenantService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TenantService 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/talent/v4/tenant_service_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 + + @tenant_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4::TenantService::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, + logger: @config.logger + ) + + @tenant_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tenant_service_stub.logger + end + + # Service calls + + ## + # Creates a new tenant entity. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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.tenant&.name + header_params["tenant.name"] = request.tenant.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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all tenants associated with the project. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants 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::Talent::V4::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest + + # Converts hash 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_tenants.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::Talent::V4::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_tenants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TenantService API. + # + # This class represents the configuration for TenantService, + # 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::Talent::V4::TenantService::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_tenant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::TenantService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TenantService 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_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + + # @private + def initialize parent_rpcs = nil + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb new file mode 100644 index 000000000000..daf2d0afbeef --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module TenantService + # Credentials for the TenantService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb new file mode 100644 index 000000000000..ce93b2ff685b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + module TenantService + # Path helper methods for the TenantService API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb new file mode 100644 index 000000000000..6edaf614d38d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" + +require "google/cloud/talent/v4/tenant_service/credentials" +require "google/cloud/talent/v4/tenant_service/paths" +require "google/cloud/talent/v4/tenant_service/rest/client" + +module Google + module Cloud + module Talent + module V4 + ## + # A service that handles tenant management, including CRUD and enumeration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4/tenant_service/rest" + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + module TenantService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4/tenant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb new file mode 100644 index 000000000000..009b23f72ad2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb @@ -0,0 +1,819 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" +require "google/cloud/talent/v4/tenant_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4 + module TenantService + module Rest + ## + # REST client for the TenantService service. + # + # A service that handles tenant management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tenant_service_stub + + ## + # Configure the TenantService Client class. + # + # See {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TenantService clients + # ::Google::Cloud::Talent::V4::TenantService::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", "Talent", "V4"] + 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_tenant.timeout = 30.0 + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tenants.timeout = 30.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TenantService 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::Talent::V4::TenantService::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 + @tenant_service_stub.universe_domain + end + + ## + # Create a new TenantService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TenantService 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 + + @tenant_service_stub = ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tenant_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tenant_service_stub.logger + end + + # Service calls + + ## + # Creates a new tenant entity. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.create_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.get_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] + # Required. The tenant resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.update_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @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/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest + + # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.delete_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all tenants associated with the project. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants 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::Talent::V4::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest + + # Converts hash 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_tenants.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::Talent::V4::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_tenants.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.list_tenants request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TenantService REST API. + # + # This class represents the configuration for TenantService 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::Talent::V4::TenantService::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_tenant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4::TenantService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TenantService 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_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + + # @private + def initialize parent_rpcs = nil + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb new file mode 100644 index 000000000000..cc7ba8e861ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" + +module Google + module Cloud + module Talent + module V4 + module TenantService + module Rest + ## + # REST service stub for the TenantService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] + # 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::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # A result object deserialized from the server's reply + def create_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_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, + method_name: "create_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] + # 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::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # A result object deserialized from the server's reply + def get_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_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, + method_name: "get_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] + # 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::Talent::V4::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::Tenant] + # A result object deserialized from the server's reply + def update_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_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, + method_name: "update_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] + # 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_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_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, + method_name: "delete_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] + # 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::Talent::V4::ListTenantsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4::ListTenantsResponse] + # A result object deserialized from the server's reply + def list_tenants request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_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, + method_name: "list_tenants", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4/{parent}/tenants", + body: "tenant", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v4/{tenant.name}", + body: "tenant", + matches: [ + ["tenant.name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v4/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] + # 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_tenants_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4/{parent}/tenants", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb new file mode 100644 index 000000000000..46d96abbb8fc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4/tenant_service.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/talent/v4/common_pb' +require 'google/cloud/talent/v4/tenant_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n+google/cloud/talent/v4/tenant_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a#google/cloud/talent/v4/tenant.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8f\x01\n\x13\x43reateTenantRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x33\n\x06tenant\x18\x02 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\"D\n\x10GetTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"{\n\x13UpdateTenantRequest\x12\x33\n\x06tenant\x18\x01 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x13\x44\x65leteTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x12ListTenantsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x9b\x01\n\x13ListTenantsResponse\x12/\n\x07tenants\x18\x01 \x03(\x0b\x32\x1e.google.cloud.talent.v4.Tenant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xf0\x06\n\rTenantService\x12\x9c\x01\n\x0c\x43reateTenant\x12+.google.cloud.talent.v4.CreateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"?\xda\x41\rparent,tenant\x82\xd3\xe4\x93\x02)\"\x1f/v4/{parent=projects/*}/tenants:\x06tenant\x12\x85\x01\n\tGetTenant\x12(.google.cloud.talent.v4.GetTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{name=projects/*/tenants/*}\x12\xa8\x01\n\x0cUpdateTenant\x12+.google.cloud.talent.v4.UpdateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"K\xda\x41\x12tenant,update_mask\x82\xd3\xe4\x93\x02\x30\x32&/v4/{tenant.name=projects/*/tenants/*}:\x06tenant\x12\x83\x01\n\x0c\x44\x65leteTenant\x12+.google.cloud.talent.v4.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!*\x1f/v4/{name=projects/*/tenants/*}\x12\x98\x01\n\x0bListTenants\x12*.google.cloud.talent.v4.ListTenantsRequest\x1a+.google.cloud.talent.v4.ListTenantsResponse\"0\xda\x41\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{parent=projects/*}/tenants\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBl\n\x1a\x63om.google.cloud.talent.v4B\x12TenantServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Tenant", "google/cloud/talent/v4/tenant.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.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 Talent + module V4 + CreateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateTenantRequest").msgclass + GetTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetTenantRequest").msgclass + UpdateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateTenantRequest").msgclass + DeleteTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteTenantRequest").msgclass + ListTenantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsRequest").msgclass + ListTenantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb new file mode 100644 index 000000000000..1761f0653df7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4/tenant_service.proto for package 'google.cloud.talent.v4' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4/tenant_service_pb' + +module Google + module Cloud + module Talent + module V4 + module TenantService + # A service that handles tenant management, including CRUD and enumeration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4.TenantService' + + # Creates a new tenant entity. + rpc :CreateTenant, ::Google::Cloud::Talent::V4::CreateTenantRequest, ::Google::Cloud::Talent::V4::Tenant + # Retrieves specified tenant. + rpc :GetTenant, ::Google::Cloud::Talent::V4::GetTenantRequest, ::Google::Cloud::Talent::V4::Tenant + # Updates specified tenant. + rpc :UpdateTenant, ::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Google::Cloud::Talent::V4::Tenant + # Deletes specified tenant. + rpc :DeleteTenant, ::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Google::Protobuf::Empty + # Lists all tenants associated with the project. + rpc :ListTenants, ::Google::Cloud::Talent::V4::ListTenantsRequest, ::Google::Cloud::Talent::V4::ListTenantsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb new file mode 100644 index 000000000000..c14911f7ba77 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md b/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md new file mode 100644 index 000000000000..4583e024e1f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Talent Solution V4 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-talent-v4/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/cloud/talent/v4/common.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb new file mode 100644 index 000000000000..4a754f4d0ab3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb @@ -0,0 +1,959 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # Message representing a period of time between two timestamps. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Begin of the period (inclusive). + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End of the period (exclusive). + class TimestampRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A resource that represents a location with full geographic information. + # @!attribute [rw] location_type + # @return [::Google::Cloud::Talent::V4::Location::LocationType] + # The type of a location, which corresponds to the address lines field of + # {::Google::Type::PostalAddress google.type.PostalAddress}. For example, + # "Downtown, Atlanta, GA, USA" has a type of + # {::Google::Cloud::Talent::V4::Location::LocationType::NEIGHBORHOOD LocationType.NEIGHBORHOOD}, + # and "Kansas City, KS, USA" has a type of + # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}. + # @!attribute [rw] postal_address + # @return [::Google::Type::PostalAddress] + # Postal address of the location that includes human readable information, + # such as postal delivery and payments addresses. Given a postal address, + # a postal service can deliver items to a premises, P.O. Box, or other + # delivery location. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # An object representing a latitude/longitude pair. + # @!attribute [rw] radius_miles + # @return [::Float] + # Radius in miles of the job location. This value is derived from the + # location bounding box in which a circle with the specified radius + # centered from {::Google::Type::LatLng google.type.LatLng} covers the area + # associated with the job location. For example, currently, "Mountain View, + # CA, USA" has a radius of 6.17 miles. + class Location + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enum which represents the type of a location. + module LocationType + # Default value if the type isn't specified. + LOCATION_TYPE_UNSPECIFIED = 0 + + # A country level location. + COUNTRY = 1 + + # A state or equivalent level location. + ADMINISTRATIVE_AREA = 2 + + # A county or equivalent level location. + SUB_ADMINISTRATIVE_AREA = 3 + + # A city or equivalent level location. + LOCALITY = 4 + + # A postal code level location. + POSTAL_CODE = 5 + + # A sublocality is a subdivision of a locality, for example a city borough, + # ward, or arrondissement. Sublocalities are usually recognized by a local + # political authority. For example, Manhattan and Brooklyn are recognized + # as boroughs by the City of New York, and are therefore modeled as + # sublocalities. + SUB_LOCALITY = 6 + + # A district or equivalent level location. + SUB_LOCALITY_1 = 7 + + # A smaller district or equivalent level display. + SUB_LOCALITY_2 = 8 + + # A neighborhood level location. + NEIGHBORHOOD = 9 + + # A street address level location. + STREET_ADDRESS = 10 + end + end + + # Meta information related to the job searcher or entity + # conducting the job search. This information is used to improve the + # performance of the service. + # @!attribute [rw] domain + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # The client-defined scope or source of the service call, which typically + # is the domain on + # which the service has been implemented and is currently being run. + # + # For example, if the service is being run by client Foo, Inc., on + # job board www.foo.com and career site www.bar.com, then this field is + # set to "foo.com" for use on the job board, and "bar.com" for use on the + # career site. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique domain. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] session_id + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # A unique session identification string. A session is defined as the + # duration of an end user's interaction with the service over a certain + # period. + # Obfuscate this field for privacy concerns before + # providing it to the service. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique session ID. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] user_id + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # A unique user identification string, as determined by the client. + # To have the strongest positive impact on search quality + # make sure the client-level is unique. + # Obfuscate this field for privacy concerns before + # providing it to the service. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique user ID. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] allow_missing_ids + # @return [::Boolean] + # Only set when any of + # {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, + # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and + # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} isn't available + # for some reason. It is highly recommended not to set this field and provide + # accurate {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, + # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and + # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} for the best + # service experience. + # @!attribute [rw] device_info + # @return [::Google::Cloud::Talent::V4::DeviceInfo] + # The type of device used by the job seeker at the time of the call to the + # service. + class RequestMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional information returned to client, such as debugging information. + # @!attribute [rw] request_id + # @return [::String] + # A unique id associated with this call. + # This id is logged for tracking purposes. + class ResponseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Device information collected from the job seeker, candidate, or + # other entity conducting the job search. Providing this information improves + # the quality of the search results across devices. + # @!attribute [rw] device_type + # @return [::Google::Cloud::Talent::V4::DeviceInfo::DeviceType] + # Type of the device. + # @!attribute [rw] id + # @return [::String] + # A device-specific ID. The ID must be a unique identifier that + # distinguishes the device from other devices. + class DeviceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enumeration describing an API access portal and exposure mechanism. + module DeviceType + # The device type isn't specified. + DEVICE_TYPE_UNSPECIFIED = 0 + + # A desktop web browser, such as, Chrome, Firefox, Safari, or Internet + # Explorer) + WEB = 1 + + # A mobile device web browser, such as a phone or tablet with a Chrome + # browser. + MOBILE_WEB = 2 + + # An Android device native application. + ANDROID = 3 + + # An iOS device native application. + IOS = 4 + + # A bot, as opposed to a device operated by human beings, such as a web + # crawler. + BOT = 5 + + # Other devices types. + OTHER = 6 + end + end + + # Custom attribute values that are either filterable or non-filterable. + # @!attribute [rw] string_values + # @return [::Array<::String>] + # Exactly one of + # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or + # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be + # specified. + # + # This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or + # `CASE_INSENSITIVE_MATCH`) search. + # For filterable `string_value`s, a maximum total number of 200 values + # is allowed, with each `string_value` has a byte size of no more than + # 500B. For unfilterable `string_values`, the maximum total byte size of + # unfilterable `string_values` is 50KB. + # + # Empty string isn't allowed. + # @!attribute [rw] long_values + # @return [::Array<::Integer>] + # Exactly one of + # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or + # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be + # specified. + # + # This field is used to perform number range search. + # (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. + # + # Currently at most 1 + # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} is + # supported. + # @!attribute [rw] filterable + # @return [::Boolean] + # If the `filterable` flag is true, the custom field values may be used for + # custom attribute filters + # {::Google::Cloud::Talent::V4::JobQuery#custom_attribute_filter JobQuery.custom_attribute_filter}. + # If false, these values may not be used for custom attribute filters. + # + # Default is false. + # @!attribute [rw] keyword_searchable + # @return [::Boolean] + # If the `keyword_searchable` flag is true, the keywords in custom fields are + # searchable by keyword match. + # If false, the values are not searchable by keyword match. + # + # Default is false. + class CustomAttribute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spell check result. + # @!attribute [rw] corrected + # @return [::Boolean] + # Indicates if the query was corrected by the spell checker. + # @!attribute [rw] corrected_text + # @return [::String] + # Correction output consisting of the corrected keyword string. + # @!attribute [rw] corrected_html + # @return [::String] + # Corrected output with html tags to highlight the corrected words. + # Corrected words are called out with the "..." html tags. + # + # For example, the user input query is "software enginear", where the second + # word, "enginear," is incorrect. It should be "engineer". When spelling + # correction is enabled, this value is + # "software engineer". + class SpellingCorrection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Job compensation details. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry>] + # Job compensation information. + # + # At most one entry can be of type + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::BASE CompensationInfo.CompensationType.BASE}, + # which is referred as **base compensation entry** for the job. + # @!attribute [r] annualized_base_compensation_range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Output only. Annualized base compensation range. Computed as base + # compensation entry's + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # times + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} + # for explanation on compensation annualization. + # @!attribute [r] annualized_total_compensation_range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Output only. Annualized total compensation range. Computed as all + # compensation entries' + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # times + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} + # for explanation on compensation annualization. + class CompensationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A compensation entry that represents one component of compensation, such + # as base pay, bonus, or other compensation type. + # + # Annualization: One compensation entry can be annualized if + # - it contains valid + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}. + # - and its + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year} + # is set or can be derived. Its annualized range is determined as + # ({::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}) + # times + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year}. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationType] + # Compensation type. + # + # Default is + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::COMPENSATION_TYPE_UNSPECIFIED CompensationType.COMPENSATION_TYPE_UNSPECIFIED}. + # @!attribute [rw] unit + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit] + # Frequency of the specified amount. + # + # Default is + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED}. + # @!attribute [rw] amount + # @return [::Google::Type::Money] + # Compensation amount. + # + # Note: The following fields are mutually exclusive: `amount`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Compensation range. + # + # Note: The following fields are mutually exclusive: `range`, `amount`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] description + # @return [::String] + # Compensation description. For example, could + # indicate equity terms or provide additional context to an estimated + # bonus. + # @!attribute [rw] expected_units_per_year + # @return [::Google::Protobuf::DoubleValue] + # Expected number of units paid each year. If not specified, when + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types} is + # FULLTIME, a default value is inferred based on + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#unit unit}. + # Default values: + # - HOURLY: 2080 + # - DAILY: 260 + # - WEEKLY: 52 + # - MONTHLY: 12 + # - ANNUAL: 1 + class CompensationEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Compensation range. + # @!attribute [rw] max_compensation + # @return [::Google::Type::Money] + # The maximum amount of compensation. If left empty, the value is set + # to a maximal compensation value and the currency code is set to + # match the {::Google::Type::Money#currency_code currency code} of + # min_compensation. + # @!attribute [rw] min_compensation + # @return [::Google::Type::Money] + # The minimum amount of compensation. If left empty, the value is set + # to zero and the currency code is set to match the + # {::Google::Type::Money#currency_code currency code} of max_compensation. + class CompensationRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of compensation. + # + # For compensation amounts specified in non-monetary amounts, + # describe the compensation scheme in the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description}. + # + # For example, tipping format is described in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # (for example, "expect 15-20% tips based on customer bill.") and an estimate + # of the tips provided in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range} + # ($10 per hour). + # + # For example, equity is described in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and + # value estimated in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # or + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range}. + # If no value estimate is possible, units are + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED} + # and then further clarified in + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # field. + module CompensationType + # Default value. + COMPENSATION_TYPE_UNSPECIFIED = 0 + + # Base compensation: Refers to the fixed amount of money paid to an + # employee by an employer in return for work performed. Base compensation + # does not include benefits, bonuses or any other potential compensation + # from an employer. + BASE = 1 + + # Bonus. + BONUS = 2 + + # Signing bonus. + SIGNING_BONUS = 3 + + # Equity. + EQUITY = 4 + + # Profit sharing. + PROFIT_SHARING = 5 + + # Commission. + COMMISSIONS = 6 + + # Tips. + TIPS = 7 + + # Other compensation type. + OTHER_COMPENSATION_TYPE = 8 + end + + # Pay frequency. + module CompensationUnit + # Default value. + COMPENSATION_UNIT_UNSPECIFIED = 0 + + # Hourly. + HOURLY = 1 + + # Daily. + DAILY = 2 + + # Weekly + WEEKLY = 3 + + # Monthly. + MONTHLY = 4 + + # Yearly. + YEARLY = 5 + + # One time. + ONE_TIME = 6 + + # Other compensation units. + OTHER_COMPENSATION_UNIT = 7 + end + end + + # Metadata used for long running operations returned by CTS batch APIs. + # It's used to replace + # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}. + # @!attribute [rw] state + # @return [::Google::Cloud::Talent::V4::BatchOperationMetadata::State] + # The state of a long running operation. + # @!attribute [rw] state_description + # @return [::String] + # More detailed information about operation state. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of successful item(s) inside an operation. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of failed item(s) inside an operation. + # @!attribute [rw] total_count + # @return [::Integer] + # Count of total item(s) inside an operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation is created. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation status is updated. The metadata and the + # {::Google::Cloud::Talent::V4::BatchOperationMetadata#update_time update_time} is + # refreshed every minute otherwise cached data is returned. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to `true`. + class BatchOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module State + # Default value. + STATE_UNSPECIFIED = 0 + + # The batch operation is being prepared for processing. + INITIALIZING = 1 + + # The batch operation is actively being processed. + PROCESSING = 2 + + # The batch operation is processed, and at least one item has been + # successfully processed. + SUCCEEDED = 3 + + # The batch operation is done and no item has been successfully processed. + FAILED = 4 + + # The batch operation is in the process of cancelling after + # google.longrunning.Operations.CancelOperation + # is called. + CANCELLING = 5 + + # The batch operation is done after + # google.longrunning.Operations.CancelOperation + # is called. Any items processed before cancelling are returned in the + # response. + CANCELLED = 6 + end + end + + # An enum that represents the size of the company. + module CompanySize + # Default value if the size isn't specified. + COMPANY_SIZE_UNSPECIFIED = 0 + + # The company has less than 50 employees. + MINI = 1 + + # The company has between 50 and 99 employees. + SMALL = 2 + + # The company has between 100 and 499 employees. + SMEDIUM = 3 + + # The company has between 500 and 999 employees. + MEDIUM = 4 + + # The company has between 1,000 and 4,999 employees. + BIG = 5 + + # The company has between 5,000 and 9,999 employees. + BIGGER = 6 + + # The company has 10,000 or more employees. + GIANT = 7 + end + + # An enum that represents employee benefits included with the job. + module JobBenefit + # Default value if the type isn't specified. + JOB_BENEFIT_UNSPECIFIED = 0 + + # The job includes access to programs that support child care, such + # as daycare. + CHILD_CARE = 1 + + # The job includes dental services covered by a dental + # insurance plan. + DENTAL = 2 + + # The job offers specific benefits to domestic partners. + DOMESTIC_PARTNER = 3 + + # The job allows for a flexible work schedule. + FLEXIBLE_HOURS = 4 + + # The job includes health services covered by a medical insurance plan. + MEDICAL = 5 + + # The job includes a life insurance plan provided by the employer or + # available for purchase by the employee. + LIFE_INSURANCE = 6 + + # The job allows for a leave of absence to a parent to care for a newborn + # child. + PARENTAL_LEAVE = 7 + + # The job includes a workplace retirement plan provided by the + # employer or available for purchase by the employee. + RETIREMENT_PLAN = 8 + + # The job allows for paid time off due to illness. + SICK_DAYS = 9 + + # The job includes paid time off for vacation. + VACATION = 10 + + # The job includes vision services covered by a vision + # insurance plan. + VISION = 11 + end + + # Educational degree level defined in International Standard Classification + # of Education (ISCED). + module DegreeType + # Default value. Represents no degree, or early childhood education. + # Maps to ISCED code 0. + # Ex) Kindergarten + DEGREE_TYPE_UNSPECIFIED = 0 + + # Primary education which is typically the first stage of compulsory + # education. ISCED code 1. + # Ex) Elementary school + PRIMARY_EDUCATION = 1 + + # Lower secondary education; First stage of secondary education building on + # primary education, typically with a more subject-oriented curriculum. + # ISCED code 2. + # Ex) Middle school + LOWER_SECONDARY_EDUCATION = 2 + + # Middle education; Second/final stage of secondary education preparing for + # tertiary education and/or providing skills relevant to employment. + # Usually with an increased range of subject options and streams. ISCED + # code 3. + # Ex) High school + UPPER_SECONDARY_EDUCATION = 3 + + # Adult Remedial Education; Programmes providing learning experiences that + # build on secondary education and prepare for labour market entry and/or + # tertiary education. The content is broader than secondary but not as + # complex as tertiary education. ISCED code 4. + ADULT_REMEDIAL_EDUCATION = 4 + + # Associate's or equivalent; Short first tertiary programmes that are + # typically practically-based, occupationally-specific and prepare for + # labour market entry. These programmes may also provide a pathway to other + # tertiary programmes. ISCED code 5. + ASSOCIATES_OR_EQUIVALENT = 5 + + # Bachelor's or equivalent; Programmes designed to provide intermediate + # academic and/or professional knowledge, skills and competencies leading + # to a first tertiary degree or equivalent qualification. ISCED code 6. + BACHELORS_OR_EQUIVALENT = 6 + + # Master's or equivalent; Programmes designed to provide advanced academic + # and/or professional knowledge, skills and competencies leading to a + # second tertiary degree or equivalent qualification. ISCED code 7. + MASTERS_OR_EQUIVALENT = 7 + + # Doctoral or equivalent; Programmes designed primarily to lead to an + # advanced research qualification, usually concluding with the submission + # and defense of a substantive dissertation of publishable quality based on + # original research. ISCED code 8. + DOCTORAL_OR_EQUIVALENT = 8 + end + + # An enum that represents the employment type of a job. + module EmploymentType + # The default value if the employment type isn't specified. + EMPLOYMENT_TYPE_UNSPECIFIED = 0 + + # The job requires working a number of hours that constitute full + # time employment, typically 40 or more hours per week. + FULL_TIME = 1 + + # The job entails working fewer hours than a full time job, + # typically less than 40 hours a week. + PART_TIME = 2 + + # The job is offered as a contracted, as opposed to a salaried employee, + # position. + CONTRACTOR = 3 + + # The job is offered as a contracted position with the understanding + # that it's converted into a full-time position at the end of the + # contract. Jobs of this type are also returned by a search for + # {::Google::Cloud::Talent::V4::EmploymentType::CONTRACTOR EmploymentType.CONTRACTOR} + # jobs. + CONTRACT_TO_HIRE = 4 + + # The job is offered as a temporary employment opportunity, usually + # a short-term engagement. + TEMPORARY = 5 + + # The job is a fixed-term opportunity for students or entry-level job + # seekers to obtain on-the-job training, typically offered as a summer + # position. + INTERN = 6 + + # The is an opportunity for an individual to volunteer, where there's no + # expectation of compensation for the provided services. + VOLUNTEER = 7 + + # The job requires an employee to work on an as-needed basis with a + # flexible schedule. + PER_DIEM = 8 + + # The job involves employing people in remote areas and flying them + # temporarily to the work site instead of relocating employees and their + # families permanently. + FLY_IN_FLY_OUT = 9 + + # The job does not fit any of the other listed types. + OTHER_EMPLOYMENT_TYPE = 10 + end + + # An enum that represents the required experience level required for the job. + module JobLevel + # The default value if the level isn't specified. + JOB_LEVEL_UNSPECIFIED = 0 + + # Entry-level individual contributors, typically with less than 2 years of + # experience in a similar role. Includes interns. + ENTRY_LEVEL = 1 + + # Experienced individual contributors, typically with 2+ years of + # experience in a similar role. + EXPERIENCED = 2 + + # Entry- to mid-level managers responsible for managing a team of people. + MANAGER = 3 + + # Senior-level managers responsible for managing teams of managers. + DIRECTOR = 4 + + # Executive-level managers and above, including C-level positions. + EXECUTIVE = 5 + end + + # An enum that represents the categorization or primary focus of specific + # role. This value is different than the "industry" associated with a role, + # which is related to the categorization of the company listing the job. + module JobCategory + # The default value if the category isn't specified. + JOB_CATEGORY_UNSPECIFIED = 0 + + # An accounting and finance job, such as an Accountant. + ACCOUNTING_AND_FINANCE = 1 + + # An administrative and office job, such as an Administrative Assistant. + ADMINISTRATIVE_AND_OFFICE = 2 + + # An advertising and marketing job, such as Marketing Manager. + ADVERTISING_AND_MARKETING = 3 + + # An animal care job, such as Veterinarian. + ANIMAL_CARE = 4 + + # An art, fashion, or design job, such as Designer. + ART_FASHION_AND_DESIGN = 5 + + # A business operations job, such as Business Operations Manager. + BUSINESS_OPERATIONS = 6 + + # A cleaning and facilities job, such as Custodial Staff. + CLEANING_AND_FACILITIES = 7 + + # A computer and IT job, such as Systems Administrator. + COMPUTER_AND_IT = 8 + + # A construction job, such as General Laborer. + CONSTRUCTION = 9 + + # A customer service job, such s Cashier. + CUSTOMER_SERVICE = 10 + + # An education job, such as School Teacher. + EDUCATION = 11 + + # An entertainment and travel job, such as Flight Attendant. + ENTERTAINMENT_AND_TRAVEL = 12 + + # A farming or outdoor job, such as Park Ranger. + FARMING_AND_OUTDOORS = 13 + + # A healthcare job, such as Registered Nurse. + HEALTHCARE = 14 + + # A human resources job, such as Human Resources Director. + HUMAN_RESOURCES = 15 + + # An installation, maintenance, or repair job, such as Electrician. + INSTALLATION_MAINTENANCE_AND_REPAIR = 16 + + # A legal job, such as Law Clerk. + LEGAL = 17 + + # A management job, often used in conjunction with another category, + # such as Store Manager. + MANAGEMENT = 18 + + # A manufacturing or warehouse job, such as Assembly Technician. + MANUFACTURING_AND_WAREHOUSE = 19 + + # A media, communications, or writing job, such as Media Relations. + MEDIA_COMMUNICATIONS_AND_WRITING = 20 + + # An oil, gas or mining job, such as Offshore Driller. + OIL_GAS_AND_MINING = 21 + + # A personal care and services job, such as Hair Stylist. + PERSONAL_CARE_AND_SERVICES = 22 + + # A protective services job, such as Security Guard. + PROTECTIVE_SERVICES = 23 + + # A real estate job, such as Buyer's Agent. + REAL_ESTATE = 24 + + # A restaurant and hospitality job, such as Restaurant Server. + RESTAURANT_AND_HOSPITALITY = 25 + + # A sales and/or retail job, such Sales Associate. + SALES_AND_RETAIL = 26 + + # A science and engineering job, such as Lab Technician. + SCIENCE_AND_ENGINEERING = 27 + + # A social services or non-profit job, such as Case Worker. + SOCIAL_SERVICES_AND_NON_PROFIT = 28 + + # A sports, fitness, or recreation job, such as Personal Trainer. + SPORTS_FITNESS_AND_RECREATION = 29 + + # A transportation or logistics job, such as Truck Driver. + TRANSPORTATION_AND_LOGISTICS = 30 + end + + # An enum that represents the job posting region. In most cases, job postings + # don't need to specify a region. If a region is given, jobs are + # eligible for searches in the specified region. + module PostingRegion + # If the region is unspecified, the job is only returned if it + # matches the {::Google::Cloud::Talent::V4::LocationFilter LocationFilter}. + POSTING_REGION_UNSPECIFIED = 0 + + # In addition to exact location matching, job posting is returned when the + # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in the search query + # is in the same administrative area as the returned job posting. For + # example, if a `ADMINISTRATIVE_AREA` job is posted in "CA, USA", it's + # returned if {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has + # "Mountain View". + # + # Administrative area refers to top-level administrative subdivision of this + # country. For example, US state, IT region, UK constituent nation and + # JP prefecture. + ADMINISTRATIVE_AREA = 1 + + # In addition to exact location matching, job is returned when + # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in search query is + # in the same country as this job. For example, if a `NATION_WIDE` job is + # posted in "USA", it's returned if + # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has 'Mountain + # View'. + NATION = 2 + + # Job allows employees to work remotely (telecommute). + # If locations are provided with this value, the job is + # considered as having a location, but telecommuting is allowed. + TELECOMMUTE = 3 + end + + # Deprecated. All resources are only visible to the owner. + # + # An enum that represents who has view access to the resource. + # @deprecated This enum is deprecated and may be removed in the next major version update. + module Visibility + # Default value. + VISIBILITY_UNSPECIFIED = 0 + + # The resource is only visible to the GCP account who owns it. + ACCOUNT_ONLY = 1 + + # The resource is visible to the owner and may be visible to other + # applications and processes at Google. + SHARED_WITH_GOOGLE = 2 + + # The resource is visible to the owner and may be visible to all other API + # clients. + SHARED_WITH_PUBLIC = 3 + end + + # Option for HTML content sanitization on user input fields, for example, job + # description. By setting this option, user can determine whether and how + # sanitization is performed on these fields. + module HtmlSanitization + # Default value. + HTML_SANITIZATION_UNSPECIFIED = 0 + + # Disables sanitization on HTML input. + HTML_SANITIZATION_DISABLED = 1 + + # Sanitizes HTML input, only accepts bold, italic, ordered list, and + # unordered list markup tags. + SIMPLE_FORMATTING_ONLY = 2 + end + + # Method for commute. Walking, biking and wheelchair accessible transit is + # still in the Preview stage. + module CommuteMethod + # Commute method isn't specified. + COMMUTE_METHOD_UNSPECIFIED = 0 + + # Commute time is calculated based on driving time. + DRIVING = 1 + + # Commute time is calculated based on public transit including bus, metro, + # subway, and so on. + TRANSIT = 2 + + # Commute time is calculated based on walking time. + WALKING = 3 + + # Commute time is calculated based on biking time. + CYCLING = 4 + + # Commute time is calculated based on public transit that is wheelchair + # accessible. + TRANSIT_ACCESSIBLE = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb new file mode 100644 index 000000000000..26cd543627a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # A Company resource represents a company in the service. A company is the + # entity that owns job postings, that is, the hiring entity responsible for + # employing applicants for the job position. + # @!attribute [rw] name + # @return [::String] + # Required during company update. + # + # The resource name for a company. This is generated by the service when a + # company is created. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the company, for example, "Google LLC". + # @!attribute [rw] external_id + # @return [::String] + # Required. Client side company identifier, used to uniquely identify the + # company. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] size + # @return [::Google::Cloud::Talent::V4::CompanySize] + # The employer's company size. + # @!attribute [rw] headquarters_address + # @return [::String] + # The street address of the company's main headquarters, which may be + # different from the job location. The service attempts + # to geolocate the provided address, and populates a more specific + # location wherever possible in + # {::Google::Cloud::Talent::V4::Company::DerivedInfo#headquarters_location DerivedInfo.headquarters_location}. + # @!attribute [rw] hiring_agency + # @return [::Boolean] + # Set to true if it is the hiring agency that post jobs for other + # employers. + # + # Defaults to false if not provided. + # @!attribute [rw] eeo_text + # @return [::String] + # Equal Employment Opportunity legal disclaimer text to be + # associated with all jobs, and typically to be displayed in all + # roles. + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] website_uri + # @return [::String] + # The URI representing the company's primary web site or home page, + # for example, "https://www.google.com". + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] career_site_uri + # @return [::String] + # The URI to employer's career site or careers page on the employer's web + # site, for example, "https://careers.google.com". + # @!attribute [rw] image_uri + # @return [::String] + # A URI that hosts the employer's company logo. + # @!attribute [rw] keyword_searchable_job_custom_attributes + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # This field is deprecated. Please set the searchability of the custom + # attribute in the + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} going + # forward. + # + # A list of keys of filterable + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}, + # whose corresponding `string_values` are used in keyword searches. Jobs with + # `string_values` under these specified field keys are returned if any + # of the values match the search keyword. Custom field values with + # parenthesis, brackets and special symbols are not searchable as-is, + # and those keyword queries must be surrounded by quotes. + # @!attribute [r] derived_info + # @return [::Google::Cloud::Talent::V4::Company::DerivedInfo] + # Output only. Derived details about the company. + # @!attribute [r] suspended + # @return [::Boolean] + # Output only. Indicates whether a company is flagged to be suspended from + # public availability by the service when job content appears suspicious, + # abusive, or spammy. + class Company + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Derived details about the company. + # @!attribute [rw] headquarters_location + # @return [::Google::Cloud::Talent::V4::Location] + # A structured headquarters location of the company, resolved from + # {::Google::Cloud::Talent::V4::Company#headquarters_address Company.headquarters_address} + # if provided. + class DerivedInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb new file mode 100644 index 000000000000..bc326d893eab --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb @@ -0,0 +1,133 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # The Request of the CreateCompany method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] company + # @return [::Google::Cloud::Talent::V4::Company] + # Required. The company to be created. + class CreateCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a company by name. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + class GetCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for updating a specified company. + # @!attribute [rw] company + # @return [::Google::Cloud::Talent::V4::Company] + # Required. The company resource to replace the current resource in the + # system. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Company Company} are + # supported. + class UpdateCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a company. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + class DeleteCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List companies for which the client has ACL visibility. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] page_token + # @return [::String] + # The starting indicator from which to return results. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @!attribute [rw] require_open_jobs + # @return [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + class ListCompaniesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The List companies response object. + # @!attribute [rw] companies + # @return [::Array<::Google::Cloud::Talent::V4::Company>] + # Companies for the current client. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListCompaniesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb new file mode 100644 index 000000000000..0cad28742065 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # Auto-complete parameters. + # @!attribute [rw] tenant + # @return [::String] + # Required. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] query + # @return [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] page_size + # @return [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @!attribute [rw] company + # @return [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # @!attribute [rw] scope + # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + class CompleteQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to specify the scope of completion. + module CompletionScope + # Default value. + COMPLETION_SCOPE_UNSPECIFIED = 0 + + # Suggestions are based only on the data provided by the client. + TENANT = 1 + + # Suggestions are based on all jobs data in the system that's visible to + # the client + PUBLIC = 2 + end + + # Enum to specify auto-completion topics. + module CompletionType + # Default value. + COMPLETION_TYPE_UNSPECIFIED = 0 + + # Suggest job titles for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::JOB_TITLE CompletionType.JOB_TITLE} + # type, only open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # are returned. + JOB_TITLE = 1 + + # Suggest company names for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME CompletionType.COMPANY_NAME} + # type, only companies having open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # are returned. + COMPANY_NAME = 2 + + # Suggest both job titles and company names for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED} + # type, only open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # or companies having open jobs with the same + # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} + # are returned. + COMBINED = 3 + end + end + + # Response of auto-complete query. + # @!attribute [rw] completion_results + # @return [::Array<::Google::Cloud::Talent::V4::CompleteQueryResponse::CompletionResult>] + # Results of the matching job/company candidates. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class CompleteQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Resource that represents completion results. + # @!attribute [rw] suggestion + # @return [::String] + # The suggestion for the query. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] + # The completion topic. + # @!attribute [rw] image_uri + # @return [::String] + # The URI of the company image for + # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME COMPANY_NAME}. + class CompletionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb new file mode 100644 index 000000000000..aaead09d2855 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb @@ -0,0 +1,179 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # An event issued when an end user interacts with the application that + # implements Cloud Talent Solution. Providing this information improves the + # quality of results for the API clients, enabling the + # service to perform optimally. The number of events sent must be consistent + # with other calls, such as job searches, issued to the service by the client. + # @!attribute [rw] request_id + # @return [::String] + # Strongly recommended for the best service experience. + # + # A unique ID generated in the API responses. It can be found in + # {::Google::Cloud::Talent::V4::ResponseMetadata#request_id ResponseMetadata.request_id}. + # @!attribute [rw] event_id + # @return [::String] + # Required. A unique identifier, generated by the client application. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Required. The timestamp of the event. + # @!attribute [rw] job_event + # @return [::Google::Cloud::Talent::V4::JobEvent] + # An event issued when a job seeker interacts with the application that + # implements Cloud Talent Solution. + # @!attribute [rw] event_notes + # @return [::String] + # Notes about the event provided by recruiters or other users, for example, + # feedback on why a job was bookmarked. + class ClientEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event issued when a job seeker interacts with the application that + # implements Cloud Talent Solution. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::JobEvent::JobEventType] + # Required. The type of the event (see + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType JobEventType}). + # @!attribute [rw] jobs + # @return [::Array<::String>] + # Required. The [job name(s)][google.cloud.talent.v4.Job.name] associated + # with this event. For example, if this is an + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression} + # event, this field contains the identifiers of all jobs shown to the job + # seeker. If this was a + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW view} event, this field + # contains the identifier of the viewed job. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}", for + # example, "projects/foo/tenants/bar/jobs/baz". + class JobEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enumeration of an event attributed to the behavior of the end user, + # such as a job seeker. + module JobEventType + # The event is unspecified by other provided values. + JOB_EVENT_TYPE_UNSPECIFIED = 0 + + # The job seeker or other entity interacting with the service has + # had a job rendered in their view, such as in a list of search results in + # a compressed or clipped format. This event is typically associated with + # the viewing of a jobs list on a single page by a job seeker. + IMPRESSION = 1 + + # The job seeker, or other entity interacting with the service, has + # viewed the details of a job, including the full description. This + # event doesn't apply to the viewing a snippet of a job appearing as a + # part of the job search results. Viewing a snippet is associated with an + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression}). + VIEW = 2 + + # The job seeker or other entity interacting with the service + # performed an action to view a job and was redirected to a different + # website for job. + VIEW_REDIRECT = 3 + + # The job seeker or other entity interacting with the service + # began the process or demonstrated the intention of applying for a job. + APPLICATION_START = 4 + + # The job seeker or other entity interacting with the service + # submitted an application for a job. + APPLICATION_FINISH = 5 + + # The job seeker or other entity interacting with the service + # submitted an application for a job with a single click without + # entering information. If a job seeker performs this action, send only + # this event to the service. Do not also send + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START} + # or + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} + # events. + APPLICATION_QUICK_SUBMISSION = 6 + + # The job seeker or other entity interacting with the service + # performed an action to apply to a job and was redirected to a different + # website to complete the application. + APPLICATION_REDIRECT = 7 + + # The job seeker or other entity interacting with the service began the + # process or demonstrated the intention of applying for a job from the + # search results page without viewing the details of the job posting. + # If sending this event, JobEventType.VIEW event shouldn't be sent. + APPLICATION_START_FROM_SEARCH = 8 + + # The job seeker, or other entity interacting with the service, performs an + # action with a single click from the search results page to apply to a job + # (without viewing the details of the job posting), and is redirected + # to a different website to complete the application. If a candidate + # performs this action, send only this event to the service. Do not also + # send + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START}, + # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} + # or {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW JobEventType.VIEW} + # events. + APPLICATION_REDIRECT_FROM_SEARCH = 9 + + # This event should be used when a company submits an application + # on behalf of a job seeker. This event is intended for use by staffing + # agencies attempting to place candidates. + APPLICATION_COMPANY_SUBMIT = 10 + + # The job seeker or other entity interacting with the service demonstrated + # an interest in a job by bookmarking or saving it. + BOOKMARK = 11 + + # The job seeker or other entity interacting with the service was + # sent a notification, such as an email alert or device notification, + # containing one or more jobs listings generated by the service. + NOTIFICATION = 12 + + # The job seeker or other entity interacting with the service was + # employed by the hiring entity (employer). Send this event + # only if the job seeker was hired through an application that was + # initiated by a search conducted through the Cloud Talent Solution + # service. + HIRED = 13 + + # A recruiter or staffing agency submitted an application on behalf of the + # candidate after interacting with the service to identify a suitable job + # posting. + SENT_CV = 14 + + # The entity interacting with the service (for example, the job seeker), + # was granted an initial interview by the hiring entity (employer). This + # event should only be sent if the job seeker was granted an interview as + # part of an application that was initiated by a search conducted through / + # recommendation provided by the Cloud Talent Solution service. + INTERVIEW_GRANTED = 15 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb new file mode 100644 index 000000000000..284850e682bb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # The report event request. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] client_event + # @return [::Google::Cloud::Talent::V4::ClientEvent] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + class CreateClientEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb new file mode 100644 index 000000000000..65be9377eb17 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb @@ -0,0 +1,392 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # The query required to perform a search query. + # @!attribute [rw] query + # @return [::String] + # The query string that matches against the job title, description, and + # location fields. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] query_language_code + # @return [::String] + # The language code of {::Google::Cloud::Talent::V4::JobQuery#query query}. For + # example, "en-US". This field helps to better interpret the query. + # + # If a value isn't specified, the query language code is automatically + # detected, which may not be accurate. + # + # Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # @!attribute [rw] companies + # @return [::Array<::String>] + # This filter specifies the company entities to search against. + # + # If a value isn't specified, jobs are searched for against all + # companies. + # + # If multiple values are specified, jobs are searched against the + # companies specified. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For + # example, "projects/foo/tenants/bar/companies/baz". + # + # At most 20 company filters are allowed. + # @!attribute [rw] location_filters + # @return [::Array<::Google::Cloud::Talent::V4::LocationFilter>] + # The location filter specifies geo-regions containing the jobs to + # search against. See {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} + # for more information. + # + # If a location value isn't specified, jobs fitting the other search + # criteria are retrieved regardless of where they're located. + # + # If multiple values are specified, jobs are retrieved from any of the + # specified locations. If different values are specified for the + # {::Google::Cloud::Talent::V4::LocationFilter#distance_in_miles LocationFilter.distance_in_miles} + # parameter, the maximum provided distance is used for all locations. + # + # At most 5 location filters are allowed. + # @!attribute [rw] job_categories + # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] + # The category filter specifies the categories of jobs to search against. + # See {::Google::Cloud::Talent::V4::JobCategory JobCategory} for more information. + # + # If a value isn't specified, jobs from any category are searched against. + # + # If multiple values are specified, jobs from any of the specified + # categories are searched against. + # @!attribute [rw] commute_filter + # @return [::Google::Cloud::Talent::V4::CommuteFilter] + # Allows filtering jobs by commute time with different travel methods (for + # example, driving or public transit). + # + # Note: This only works when you specify a + # {::Google::Cloud::Talent::V4::CommuteMethod CommuteMethod}. In this case, + # {::Google::Cloud::Talent::V4::JobQuery#location_filters location_filters} is + # ignored. + # + # Currently we don't support sorting by commute time. + # @!attribute [rw] company_display_names + # @return [::Array<::String>] + # This filter specifies the company + # {::Google::Cloud::Talent::V4::Company#display_name Company.display_name} of the + # jobs to search against. The company name must match the value exactly. + # + # Alternatively, the value being searched for can be wrapped in different + # match operators. + # `SUBSTRING_MATCH([value])` + # The company name must contain a case insensitive substring match of the + # value. Using this function may increase latency. + # + # Sample Value: `SUBSTRING_MATCH(google)` + # + # `MULTI_WORD_TOKEN_MATCH([value])` + # The value will be treated as a multi word token and the company name must + # contain a case insensitive match of the value. Using this function may + # increase latency. + # + # Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` + # + # If a value isn't specified, jobs within the search results are + # associated with any company. + # + # If multiple values are specified, jobs within the search results may be + # associated with any of the specified companies. + # + # At most 20 company display name filters are allowed. + # @!attribute [rw] compensation_filter + # @return [::Google::Cloud::Talent::V4::CompensationFilter] + # This search filter is applied only to + # {::Google::Cloud::Talent::V4::Job#compensation_info Job.compensation_info}. For + # example, if the filter is specified as "Hourly job with per-hour + # compensation > $15", only jobs meeting these criteria are searched. If a + # filter isn't defined, all open jobs are searched. + # @!attribute [rw] custom_attribute_filter + # @return [::String] + # This filter specifies a structured syntax to match against the + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} + # marked as `filterable`. + # + # The syntax for this expression is a subset of SQL syntax. + # + # Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the + # left of the operator is a custom field key and the right of the operator + # is a number or a quoted string. You must escape backslash (\\) and + # quote (\") characters. + # + # Supported functions are `LOWER([field_name])` to + # perform a case insensitive match and `EMPTY([field_name])` to filter on the + # existence of a key. + # + # Boolean expressions (AND/OR/NOT) are supported up to 3 levels of + # nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + # comparisons or functions are allowed in the expression. The expression + # must be < 10000 bytes in length. + # + # Sample Query: + # `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + # driving_years > 10` + # @!attribute [rw] disable_spell_check + # @return [::Boolean] + # This flag controls the spell-check feature. If false, the + # service attempts to correct a misspelled query, + # for example, "enginee" is corrected to "engineer". + # + # Defaults to false: a spell check is performed. + # @!attribute [rw] employment_types + # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] + # The employment type filter specifies the employment type of jobs to + # search against, such as + # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME EmploymentType.FULL_TIME}. + # + # If a value isn't specified, jobs in the search results includes any + # employment type. + # + # If multiple values are specified, jobs in the search results include + # any of the specified employment types. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # This filter specifies the locale of jobs to search against, + # for example, "en-US". + # + # If a value isn't specified, the search results can contain jobs in any + # locale. + # + # + # Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # At most 10 language code filters are allowed. + # @!attribute [rw] publish_time_range + # @return [::Google::Cloud::Talent::V4::TimestampRange] + # Jobs published within a range specified by this filter are searched + # against. + # @!attribute [rw] excluded_jobs + # @return [::Array<::String>] + # This filter specifies a list of job names to be excluded during search. + # + # At most 400 excluded job names are allowed. + class JobQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Geographic region of the search. + # @!attribute [rw] address + # @return [::String] + # The address name, such as "Mountain View" or "Bay Area". + # @!attribute [rw] region_code + # @return [::String] + # CLDR region code of the country/region. This field may be used in two ways: + # + # 1) If telecommute preference is not set, this field is used address + # ambiguity of the user-input address. For example, "Liverpool" may refer to + # "Liverpool, NY, US" or "Liverpool, UK". This region code biases the + # address resolution toward a specific country or territory. If this field is + # not set, address resolution is biased toward the United States by default. + # + # 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the + # telecommute location filter will be limited to the region specified in this + # field. If this field is not set, the telecommute job locations will not be + # + # See + # https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # The latitude and longitude of the geographic center to search from. This + # field is ignored if `address` is provided. + # @!attribute [rw] distance_in_miles + # @return [::Float] + # The distance_in_miles is applied when the location being searched for is + # identified as a city or smaller. This field is ignored if the location + # being searched for is a state or larger. + # @!attribute [rw] telecommute_preference + # @return [::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference] + # Allows the client to return jobs without a + # set location, specifically, telecommuting jobs (telecommuting is considered + # by the service as a special location). + # {::Google::Cloud::Talent::V4::Job#posting_region Job.posting_region} indicates + # if a job permits telecommuting. If this field is set to + # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_ALLOWED TelecommutePreference.TELECOMMUTE_ALLOWED}, + # telecommuting jobs are searched, and + # {::Google::Cloud::Talent::V4::LocationFilter#address address} and + # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng} are ignored. If + # not set or set to + # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_EXCLUDED TelecommutePreference.TELECOMMUTE_EXCLUDED}, + # the telecommute status of the jobs is ignored. Jobs that have + # {::Google::Cloud::Talent::V4::PostingRegion::TELECOMMUTE PostingRegion.TELECOMMUTE} + # and have additional {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} + # may still be matched based on other location filters using + # {::Google::Cloud::Talent::V4::LocationFilter#address address} or + # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng}. + # + # This filter can be used by itself to search exclusively for telecommuting + # jobs, or it can be combined with another location + # filter to search for a combination of job locations, + # such as "Mountain View" or "telecommuting" jobs. However, when used in + # combination with other location filters, telecommuting jobs can be + # treated as less relevant than other jobs in the search response. + # + # This field is only used for job search requests. + class LocationFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specify whether to include telecommute jobs. + module TelecommutePreference + # Default value if the telecommute preference isn't specified. + TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 + + # Deprecated: Ignore telecommute status of jobs. Use + # TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. + TELECOMMUTE_EXCLUDED = 1 + + # Allow telecommute jobs. + TELECOMMUTE_ALLOWED = 2 + + # Exclude telecommute jobs. + TELECOMMUTE_JOBS_EXCLUDED = 3 + end + end + + # Filter on job compensation type and amount. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4::CompensationFilter::FilterType] + # Required. Type of filter. + # @!attribute [rw] units + # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit>] + # Required. Specify desired `base compensation entry's` + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] + # Compensation range. + # @!attribute [rw] include_jobs_with_unspecified_compensation_range + # @return [::Boolean] + # If set to true, jobs with unspecified compensation range fields are + # included. + class CompensationFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specify the type of filtering. + module FilterType + # Filter type unspecified. Position holder, INVALID, should never be used. + FILTER_TYPE_UNSPECIFIED = 0 + + # Filter by `base compensation entry's` unit. A job is a match if and + # only if the job contains a base CompensationEntry and the base + # CompensationEntry's unit matches provided + # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. Populate one or + # more {::Google::Cloud::Talent::V4::CompensationFilter#units units}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} + # for definition of base compensation entry. + UNIT_ONLY = 1 + + # Filter by `base compensation entry's` unit and amount / range. A job + # is a match if and only if the job contains a base CompensationEntry, and + # the base entry's unit matches provided + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationUnit} + # and amount or range overlaps with provided + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange CompensationRange}. + # + # See + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} + # for definition of base compensation entry. + # + # Set exactly one {::Google::Cloud::Talent::V4::CompensationFilter#units units} + # and populate {::Google::Cloud::Talent::V4::CompensationFilter#range range}. + UNIT_AND_AMOUNT = 2 + + # Filter by annualized base compensation amount and `base compensation + # entry's` unit. Populate + # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more + # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. + ANNUALIZED_BASE_AMOUNT = 3 + + # Filter by annualized total compensation amount and `base compensation + # entry's` unit . Populate + # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more + # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. + ANNUALIZED_TOTAL_AMOUNT = 4 + end + end + + # Parameters needed for commute search. + # @!attribute [rw] commute_method + # @return [::Google::Cloud::Talent::V4::CommuteMethod] + # Required. The method of transportation to calculate the commute time for. + # @!attribute [rw] start_coordinates + # @return [::Google::Type::LatLng] + # Required. The latitude and longitude of the location to calculate the + # commute time from. + # @!attribute [rw] travel_duration + # @return [::Google::Protobuf::Duration] + # Required. The maximum travel time in seconds. The maximum allowed value is + # `3600s` (one hour). Format is `123s`. + # @!attribute [rw] allow_imprecise_addresses + # @return [::Boolean] + # If `true`, jobs without street level addresses may also be returned. + # For city level addresses, the city center is used. For state and coarser + # level addresses, text matching is used. + # If this field is set to `false` or isn't specified, only jobs that include + # street level addresses will be returned by commute search. + # @!attribute [rw] road_traffic + # @return [::Google::Cloud::Talent::V4::CommuteFilter::RoadTraffic] + # Specifies the traffic density to use when calculating commute time. + # + # Note: The following fields are mutually exclusive: `road_traffic`, `departure_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] departure_time + # @return [::Google::Type::TimeOfDay] + # The departure time used to calculate traffic impact, represented as + # {::Google::Type::TimeOfDay google.type.TimeOfDay} in local time zone. + # + # Currently traffic model is restricted to hour level resolution. + # + # Note: The following fields are mutually exclusive: `departure_time`, `road_traffic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class CommuteFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The traffic density to use when calculating commute time. + module RoadTraffic + # Road traffic situation isn't specified. + ROAD_TRAFFIC_UNSPECIFIED = 0 + + # Optimal commute time without considering any traffic impact. + TRAFFIC_FREE = 1 + + # Commute time calculation takes in account the peak traffic impact. + BUSY_HOUR = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb new file mode 100644 index 000000000000..486c5466ca9e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # The histogram request. + # @!attribute [rw] histogram_query + # @return [::String] + # An expression specifies a histogram request against matching jobs for + # searches. + # + # See + # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries} + # for details about syntax. + class HistogramQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Histogram result that matches + # {::Google::Cloud::Talent::V4::HistogramQuery HistogramQuery} specified in + # searches. + # @!attribute [rw] histogram_query + # @return [::String] + # Requested histogram expression. + # @!attribute [rw] histogram + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # A map from the values of the facet associated with distinct values to the + # number of matching entries with corresponding value. + # + # The key format is: + # + # * (for string histogram) string values stored in the field. + # * (for named numeric bucket) name specified in `bucket()` function, like + # for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. + # * (for anonymous numeric bucket) range formatted as `-`, for + # example, `0-1000`, `MIN-0`, and `0-MAX`. + class HistogramQueryResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class HistogramEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb new file mode 100644 index 000000000000..bf21f608f3bf --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb @@ -0,0 +1,392 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # A Job resource represents a job posting (also referred to as a "job listing" + # or "job requisition"). A job belongs to a + # {::Google::Cloud::Talent::V4::Company Company}, which is the hiring entity + # responsible for the job. + # @!attribute [rw] name + # @return [::String] + # Required during job update. + # + # The resource name for the job. This is generated by the service when a + # job is created. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # Use of this field in job queries and API calls is preferred over the use of + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} since this + # value is unique. + # @!attribute [rw] company + # @return [::String] + # Required. The resource name of the company listing the job. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For + # example, "projects/foo/tenants/bar/companies/baz". + # @!attribute [rw] requisition_id + # @return [::String] + # Required. The requisition ID, also referred to as the posting ID, is + # assigned by the client to identify a job. This field is intended to be used + # by clients for client identification and tracking of postings. A job isn't + # allowed to be created if there is another job with the same + # {::Google::Cloud::Talent::V4::Job#name company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the job, such as "Software Engineer" + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] description + # @return [::String] + # Required. The description of the job, which typically includes a + # multi-paragraph description of the company and related information. + # Separate fields are provided on the job object for + # {::Google::Cloud::Talent::V4::Job#responsibilities responsibilities}, + # {::Google::Cloud::Talent::V4::Job#qualifications qualifications}, and other job + # characteristics. Use of these separate job fields is recommended. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 100,000. + # @!attribute [rw] addresses + # @return [::Array<::String>] + # Strongly recommended for the best service experience. + # + # Location(s) where the employer is looking to hire for this job posting. + # + # Specifying the full street address(es) of the hiring location enables + # better API results, especially job searches by commute time. + # + # At most 50 locations are allowed for best search performance. If a job has + # more locations, it is suggested to split it into multiple jobs with unique + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}s (e.g. 'ReqA' + # becomes 'ReqA-1', 'ReqA-2', and so on.) as multiple jobs with the same + # {::Google::Cloud::Talent::V4::Job#company company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} are not + # allowed. If the original + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} must be + # preserved, a custom field should be used for storage. It is also suggested + # to group the locations that close to each other in the same job for better + # search experience. + # + # Jobs with multiple addresses must have their addresses with the same + # {::Google::Cloud::Talent::V4::Location::LocationType LocationType} to allow + # location filtering to work properly. (For example, a Job with addresses + # "1600 Amphitheatre Parkway, Mountain View, CA, USA" and "London, UK" may + # not have location filters applied correctly at search time since the first + # is a + # {::Google::Cloud::Talent::V4::Location::LocationType::STREET_ADDRESS LocationType.STREET_ADDRESS} + # and the second is a + # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}.) + # If a job needs to have multiple addresses, it is suggested to split it into + # multiple jobs with same LocationTypes. + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] application_info + # @return [::Google::Cloud::Talent::V4::Job::ApplicationInfo] + # Job application information. + # @!attribute [rw] job_benefits + # @return [::Array<::Google::Cloud::Talent::V4::JobBenefit>] + # The benefits included with the job. + # @!attribute [rw] compensation_info + # @return [::Google::Cloud::Talent::V4::CompensationInfo] + # Job compensation information (a.k.a. "pay rate") i.e., the compensation + # that will paid to the employee. + # @!attribute [rw] custom_attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Talent::V4::CustomAttribute}] + # A map of fields to hold both filterable and non-filterable custom job + # attributes that are not covered by the provided structured fields. + # + # The keys of the map are strings up to 64 bytes and must match the + # pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or + # KEY_1_LIKE_THIS. + # + # At most 100 filterable and at most 100 unfilterable keys are supported. + # For filterable `string_values`, across all keys at most 200 values are + # allowed, with each string no more than 255 characters. For unfilterable + # `string_values`, the maximum total size of `string_values` across all keys + # is 50KB. + # @!attribute [rw] degree_types + # @return [::Array<::Google::Cloud::Talent::V4::DegreeType>] + # The desired education degrees for the job, such as Bachelors, Masters. + # @!attribute [rw] department + # @return [::String] + # The department or functional area within the company with the open + # position. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] employment_types + # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] + # The employment type(s) of a job, for example, + # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME full time} or + # {::Google::Cloud::Talent::V4::EmploymentType::PART_TIME part time}. + # @!attribute [rw] incentives + # @return [::String] + # A description of bonus, commission, and other compensation + # incentives associated with the job not including salary or pay. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] language_code + # @return [::String] + # The language of the posting. This field is distinct from + # any requirements for fluency that are associated with the job. + # + # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: + # class="external" target="_blank" }. + # + # If this field is unspecified and + # {::Google::Cloud::Talent::V4::Job#description Job.description} is present, + # detected language code based on + # {::Google::Cloud::Talent::V4::Job#description Job.description} is assigned, + # otherwise defaults to 'en_US'. + # @!attribute [rw] job_level + # @return [::Google::Cloud::Talent::V4::JobLevel] + # The experience level associated with the job, such as "Entry Level". + # @!attribute [rw] promotion_value + # @return [::Integer] + # A promotion value of the job, as determined by the client. + # The value determines the sort order of the jobs returned when searching for + # jobs using the featured jobs search call, with higher promotional values + # being returned first and ties being resolved by relevance sort. Only the + # jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. + # + # Default value is 0, and negative values are treated as 0. + # @!attribute [rw] qualifications + # @return [::String] + # A description of the qualifications required to perform the + # job. The use of this field is recommended + # as an alternative to using the more general + # {::Google::Cloud::Talent::V4::Job#description description} field. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] responsibilities + # @return [::String] + # A description of job responsibilities. The use of this field is + # recommended as an alternative to using the more general + # {::Google::Cloud::Talent::V4::Job#description description} field. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] posting_region + # @return [::Google::Cloud::Talent::V4::PostingRegion] + # The job {::Google::Cloud::Talent::V4::PostingRegion PostingRegion} (for example, + # state, country) throughout which the job is available. If this field is + # set, a {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in a search + # query within the job region finds this job posting if an exact location + # match isn't specified. If this field is set to + # {::Google::Cloud::Talent::V4::PostingRegion::NATION PostingRegion.NATION} or + # {::Google::Cloud::Talent::V4::PostingRegion::ADMINISTRATIVE_AREA PostingRegion.ADMINISTRATIVE_AREA}, + # setting job {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} to the + # same location level as this field is strongly recommended. + # @!attribute [rw] visibility + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Talent::V4::Visibility] + # Deprecated. The job is only visible to the owner. + # + # The visibility of the job. + # + # Defaults to + # {::Google::Cloud::Talent::V4::Visibility::ACCOUNT_ONLY Visibility.ACCOUNT_ONLY} + # if not specified. + # @!attribute [rw] job_start_time + # @return [::Google::Protobuf::Timestamp] + # The start timestamp of the job in UTC time zone. Typically this field + # is used for contracting engagements. Invalid timestamps are ignored. + # @!attribute [rw] job_end_time + # @return [::Google::Protobuf::Timestamp] + # The end timestamp of the job. Typically this field is used for contracting + # engagements. Invalid timestamps are ignored. + # @!attribute [rw] posting_publish_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp this job posting was most recently published. The default + # value is the time the request arrives at the server. Invalid timestamps are + # ignored. + # @!attribute [rw] posting_expire_time + # @return [::Google::Protobuf::Timestamp] + # Strongly recommended for the best service experience. + # + # The expiration timestamp of the job. After this timestamp, the + # job is marked as expired, and it no longer appears in search results. The + # expired job can't be listed by the + # {::Google::Cloud::Talent::V4::JobService::Client#list_jobs ListJobs} API, but it can be + # retrieved with the {::Google::Cloud::Talent::V4::JobService::Client#get_job GetJob} API + # or updated with the + # {::Google::Cloud::Talent::V4::JobService::Client#update_job UpdateJob} API or deleted + # with the {::Google::Cloud::Talent::V4::JobService::Client#delete_job DeleteJob} API. An + # expired job can be updated and opened again by using a future expiration + # timestamp. Updating an expired job fails if there is another existing open + # job with same {::Google::Cloud::Talent::V4::Job#company company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. + # + # The expired jobs are retained in our system for 90 days. However, the + # overall expired job count cannot exceed 3 times the maximum number of + # open jobs over previous 7 days. If this threshold is exceeded, + # expired jobs are cleaned out in order of earliest expire time. + # Expired jobs are no longer accessible after they are cleaned + # out. + # + # Invalid timestamps are ignored, and treated as expire time not provided. + # + # If the timestamp is before the instant request is made, the job + # is treated as expired immediately on creation. This kind of job can + # not be updated. And when creating a job with past timestamp, the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time posting_publish_time} + # must be set before + # {::Google::Cloud::Talent::V4::Job#posting_expire_time posting_expire_time}. The + # purpose of this feature is to allow other objects, such as + # {::Google::Cloud::Talent::V4::Job::ApplicationInfo ApplicationInfo}, to refer a + # job that didn't exist in the system prior to becoming expired. If you want + # to modify a job that was expired on creation, delete it and create a new + # one. + # + # If this value isn't provided at the time of job creation or is invalid, + # the job posting expires after 30 days from the job's creation time. For + # example, if the job was created on 2017/01/01 13:00AM UTC with an + # unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. + # + # If this value isn't provided on job update, it depends on the field masks + # set by + # {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask UpdateJobRequest.update_mask}. + # If the field masks include + # {::Google::Cloud::Talent::V4::Job#job_end_time job_end_time}, or the masks are + # empty meaning that every field is updated, the job posting expires after 30 + # days from the job's last update time. Otherwise the expiration date isn't + # updated. + # @!attribute [r] posting_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this job posting was created. + # @!attribute [r] posting_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this job posting was last updated. + # @!attribute [r] company_display_name + # @return [::String] + # Output only. Display name of the company listing the job. + # @!attribute [r] derived_info + # @return [::Google::Cloud::Talent::V4::Job::DerivedInfo] + # Output only. Derived details about the job posting. + # @!attribute [rw] processing_options + # @return [::Google::Cloud::Talent::V4::Job::ProcessingOptions] + # Options for job processing. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Application related details of a job posting. + # @!attribute [rw] emails + # @return [::Array<::String>] + # Use this field to specify email address(es) to which resumes or + # applications can be sent. + # + # The maximum number of allowed characters for each entry is 255. + # @!attribute [rw] instruction + # @return [::String] + # Use this field to provide instructions, such as "Mail your application + # to ...", that a candidate can follow to apply for the job. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 3,000. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Use this URI field to direct an applicant to a website, for example to + # link to an online application form. + # + # The maximum number of allowed characters for each entry is 2,000. + class ApplicationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Derived details about the job posting. + # @!attribute [rw] locations + # @return [::Array<::Google::Cloud::Talent::V4::Location>] + # Structured locations of the job, resolved from + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}. + # + # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations locations} are exactly + # matched to {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} in the + # same order. + # @!attribute [rw] job_categories + # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] + # Job categories derived from {::Google::Cloud::Talent::V4::Job#title Job.title} + # and {::Google::Cloud::Talent::V4::Job#description Job.description}. + class DerivedInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for job processing. + # @!attribute [rw] disable_street_address_resolution + # @return [::Boolean] + # If set to `true`, the service does not attempt to resolve a + # more precise address for the job. + # @!attribute [rw] html_sanitization + # @return [::Google::Cloud::Talent::V4::HtmlSanitization] + # Option for job HTML content sanitization. Applied fields are: + # + # * description + # * applicationInfo.instruction + # * incentives + # * qualifications + # * responsibilities + # + # HTML tags in these fields may be stripped if sanitiazation isn't + # disabled. + # + # Defaults to + # {::Google::Cloud::Talent::V4::HtmlSanitization::SIMPLE_FORMATTING_ONLY HtmlSanitization.SIMPLE_FORMATTING_ONLY}. + class ProcessingOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Talent::V4::CustomAttribute] + class CustomAttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb new file mode 100644 index 000000000000..8f673511ad12 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # Create job request. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Required. The Job to be created. + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Get job request. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Update job request. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Required. The Job to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise + # all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Delete job request. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List jobs request. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] filter + # @return [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @!attribute [rw] page_token + # @return [::String] + # The starting point of a query result. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @!attribute [rw] job_view + # @return [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no + # value is specified. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List jobs response. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4::Job>] + # The Jobs for a given company. + # + # The maximum number of items returned is based on the limit field + # provided in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Request body of the `SearchJobs` call. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] search_mode + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @!attribute [rw] request_metadata + # @return [::Google::Cloud::Talent::V4::RequestMetadata] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @!attribute [rw] job_query + # @return [::Google::Cloud::Talent::V4::JobQuery] + # Query used to search against jobs, such as keyword, location filters, etc. + # @!attribute [rw] enable_broadening + # @return [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @!attribute [rw] histogram_queries + # @return [::Array<::Google::Cloud::Talent::V4::HistogramQuery>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for + # example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", + # "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, + # "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @!attribute [rw] job_view + # @return [::Google::Cloud::Talent::V4::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if + # no value is specified. + # @!attribute [rw] offset + # @return [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @!attribute [rw] max_page_size + # @return [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @!attribute [rw] page_token + # @return [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @!attribute [rw] order_by + # @return [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. + # @!attribute [rw] diversification_level + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @!attribute [rw] custom_ranking_info + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @!attribute [rw] disable_keyword_match + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @!attribute [rw] keyword_match_mode + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. If both keyword_match_mode and + # disable_keyword_match are set, keyword_match_mode will take precedence. + # + # Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @!attribute [rw] relevance_threshold + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + class SearchJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Custom ranking information for + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] importance_level + # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo::ImportanceLevel] + # Required. Controls over how important the score of + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression} + # gets applied to job's final ranking position. + # + # An error is thrown if not specified. + # @!attribute [rw] ranking_expression + # @return [::String] + # Required. Controls over how job documents get ranked on top of existing + # relevance score (determined by API algorithm). A combination of the + # ranking expression and relevance score is used to determine job's final + # ranking position. + # + # The syntax for this expression is a subset of Google SQL syntax. + # + # Supported operators are: +, -, *, /, where the left and right side of + # the operator is either a numeric + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} + # key, integer/double value or an expression that can be evaluated to a + # number. + # + # Parenthesis are supported to adjust calculation precedence. The + # expression must be < 200 characters in length. + # + # The expression is considered invalid for a job if the expression + # references custom attributes that are not populated on the job or if the + # expression results in a divide by zero. If an expression is invalid for a + # job, that job is demoted to the end of the results. + # + # Sample ranking expression + # (year + 25) * 0.25 - (freshness / 0.5) + class CustomRankingInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The importance level for + # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression}. + module ImportanceLevel + # Default value if the importance level isn't specified. + IMPORTANCE_LEVEL_UNSPECIFIED = 0 + + # The given ranking expression is of None importance, existing relevance + # score (determined by API algorithm) dominates job's final ranking + # position. + NONE = 1 + + # The given ranking expression is of Low importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + LOW = 2 + + # The given ranking expression is of Mild importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + MILD = 3 + + # The given ranking expression is of Medium importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + MEDIUM = 4 + + # The given ranking expression is of High importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + HIGH = 5 + + # The given ranking expression is of Extreme importance, and dominates + # job's final ranking position with existing relevance + # score (determined by API algorithm) ignored. + EXTREME = 6 + end + end + + # A string-represented enumeration of the job search mode. The service + # operate differently for different modes of service. + module SearchMode + # The mode of the search method isn't specified. The default search + # behavior is identical to JOB_SEARCH search behavior. + SEARCH_MODE_UNSPECIFIED = 0 + + # The job search matches against all jobs, and featured jobs + # (jobs with promotionValue > 0) are not specially handled. + JOB_SEARCH = 1 + + # The job search matches only against featured jobs (jobs with a + # promotionValue > 0). This method doesn't return any jobs having a + # promotionValue <= 0. The search results order is determined by the + # promotionValue (jobs with a higher promotionValue are returned higher up + # in the search results), with relevance being used as a tiebreaker. + FEATURED_JOB_SEARCH = 2 + end + + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # If you are using pageToken to page through the result set, + # latency might be lower but we can't guarantee that all results are + # returned. If you are using page offset, latency might be higher but all + # results are returned. + module DiversificationLevel + # The diversification level isn't specified. + DIVERSIFICATION_LEVEL_UNSPECIFIED = 0 + + # Disables diversification. Jobs that would normally be pushed to the last + # page would not have their positions altered. This may result in highly + # similar jobs appearing in sequence in the search results. + DISABLED = 1 + + # Default diversifying behavior. The result list is ordered so that + # highly similar results are pushed to the end of the last page of search + # results. + SIMPLE = 2 + + # Only one job from the same company will be shown at once, other jobs + # under same company are pushed to the end of the last page of search + # result. + ONE_PER_COMPANY = 3 + + # Similar to ONE_PER_COMPANY, but it allows at most two jobs in the + # same company to be shown at once, the other jobs under same company are + # pushed to the end of the last page of search result. + TWO_PER_COMPANY = 4 + + # Similar to ONE_PER_COMPANY, but it allows at most three jobs in the + # same company to be shown at once, the other jobs under same company are + # dropped. + MAX_THREE_PER_COMPANY = 6 + + # The result list is ordered such that somewhat similar results are pushed + # to the end of the last page of the search results. This option is + # recommended if SIMPLE diversification does not diversify enough. + DIVERSIFY_BY_LOOSER_SIMILARITY = 5 + end + + # Controls what keyword matching behavior the search has. When keyword + # matching is enabled, a keyword match returns jobs that may not match given + # category filters when there are matching keywords. For example, for the + # query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a + # job posting with the title "software developer," which doesn't fall into + # "program manager" ontology, and "program manager" appearing in its + # description will be surfaced. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this enum's value. + # + # Use + # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + module KeywordMatchMode + # The keyword match option isn't specified. Defaults to + # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # behavior. + KEYWORD_MATCH_MODE_UNSPECIFIED = 0 + + # Disables keyword matching. + KEYWORD_MATCH_DISABLED = 1 + + # Enable keyword matching over + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}, + # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}, and + # keyword searchable + # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} + # fields. + KEYWORD_MATCH_ALL = 2 + + # Only enable keyword matching over + # {::Google::Cloud::Talent::V4::Job#title Job.title}. + KEYWORD_MATCH_TITLE_ONLY = 3 + end + + # The relevance threshold of the search results. The higher relevance + # threshold is, the higher relevant results are shown and the less number of + # results are returned. + module RelevanceThreshold + # Default value. In this case, server behavior defaults to Google defined + # threshold. + RELEVANCE_THRESHOLD_UNSPECIFIED = 0 + + # Lowest relevance threshold. + LOWEST = 1 + + # Low relevance threshold. + LOW = 2 + + # Medium relevance threshold. + MEDIUM = 3 + + # High relevance threshold. + HIGH = 4 + end + end + + # Response for SearchJob method. + # @!attribute [rw] matching_jobs + # @return [::Array<::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob>] + # The Job entities that match the specified + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] histogram_query_results + # @return [::Array<::Google::Cloud::Talent::V4::HistogramQueryResult>] + # The histogram results that match with specified + # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries}. + # @!attribute [rw] next_page_token + # @return [::String] + # The token that specifies the starting position of the next page of results. + # This field is empty if there are no more results. + # @!attribute [rw] location_filters + # @return [::Array<::Google::Cloud::Talent::V4::Location>] + # The location filters that the service applied to the specified query. If + # any filters are lat-lng based, the + # {::Google::Cloud::Talent::V4::Location#location_type Location.location_type} is + # {::Google::Cloud::Talent::V4::Location::LocationType::LOCATION_TYPE_UNSPECIFIED Location.LocationType.LOCATION_TYPE_UNSPECIFIED}. + # @!attribute [rw] total_size + # @return [::Integer] + # Number of jobs that match the specified query. + # + # Note: This size is precise only if the total is less than 100,000. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + # @!attribute [rw] broadened_query_jobs_count + # @return [::Integer] + # If query broadening is enabled, we may append additional results from the + # broadened query. This number indicates how many of the jobs returned in the + # jobs field are from the broadened query. These results are always at the + # end of the jobs list. In particular, a value of 0, or if the field isn't + # set, all the jobs in the jobs list are from the original + # (without broadening) query. If this field is non-zero, subsequent requests + # with offset after this result set should contain all broadened results. + # @!attribute [rw] spell_correction + # @return [::Google::Cloud::Talent::V4::SpellingCorrection] + # The spell checking result, and correction. + class SearchJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Job entry with metadata inside + # {::Google::Cloud::Talent::V4::SearchJobsResponse SearchJobsResponse}. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Job resource that matches the specified + # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] job_summary + # @return [::String] + # A summary of the job with core information that's displayed on the search + # results listing page. + # @!attribute [rw] job_title_snippet + # @return [::String] + # Contains snippets of text from the + # {::Google::Cloud::Talent::V4::Job#title Job.title} field most closely matching + # a search query's keywords, if available. The matching query keywords are + # enclosed in HTML bold tags. + # @!attribute [rw] search_text_snippet + # @return [::String] + # Contains snippets of text from the + # {::Google::Cloud::Talent::V4::Job#description Job.description} and similar + # fields that most closely match a search query's keywords, if available. + # All HTML tags in the original fields are stripped when returned in this + # field, and matching query keywords are enclosed in HTML bold tags. + # @!attribute [rw] commute_info + # @return [::Google::Cloud::Talent::V4::SearchJobsResponse::CommuteInfo] + # Commute information which is generated based on specified + # {::Google::Cloud::Talent::V4::CommuteFilter CommuteFilter}. + class MatchingJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Commute details related to this job. + # @!attribute [rw] job_location + # @return [::Google::Cloud::Talent::V4::Location] + # Location used as the destination in the commute calculation. + # @!attribute [rw] travel_duration + # @return [::Google::Protobuf::Duration] + # The number of seconds required to travel to the job location from the + # query location. A duration of 0 seconds indicates that the job isn't + # reachable within the requested duration, but was returned as part of an + # expanded query. + class CommuteInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request to create a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4::Job>] + # Required. The jobs to be created. + # A maximum of 200 jobs can be created in a batch. + class BatchCreateJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4::Job>] + # Required. The jobs to be updated. + # A maximum of 200 jobs can be updated in a batch. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} + # are updated. Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. + # + # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside + # {::Google::Cloud::Talent::V4::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, + # which can yield a very large response. + class BatchUpdateJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenants/bar". + # + # The parent of all of the jobs specified in `names` must match this field. + # @!attribute [rw] names + # @return [::Array<::String>] + # The names of the jobs to delete. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". + # For example, "projects/foo/tenants/bar/jobs/baz". + # + # A maximum of 200 jobs can be deleted in a batch. + class BatchDeleteJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mutation result of a job from a batch operation. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4::Job] + # Here {::Google::Cloud::Talent::V4::Job Job} only contains basic information + # including {::Google::Cloud::Talent::V4::Job#name name}, + # {::Google::Cloud::Talent::V4::Job#company company}, + # {::Google::Cloud::Talent::V4::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}, use getJob + # method to retrieve detailed information of the created/updated job. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status of the job processed. This field is populated if the + # processing of the {::Google::Cloud::Talent::V4::JobResult#job job} fails. + class JobResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of + # {::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs JobService.BatchCreateJobs}. + # It's used to replace + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # in case of success. + # @!attribute [rw] job_results + # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] + # List of job mutation results from a batch create operation. It can change + # until operation status is FINISHED, FAILED or CANCELLED. + class BatchCreateJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of + # {::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs JobService.BatchUpdateJobs}. + # It's used to replace + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # in case of success. + # @!attribute [rw] job_results + # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] + # List of job mutation results from a batch update operation. It can change + # until operation status is FINISHED, FAILED or CANCELLED. + class BatchUpdateJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of + # {::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs JobService.BatchDeleteJobs}. + # It's used to replace + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # in case of success. + # @!attribute [rw] job_results + # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] + # List of job mutation results from a batch delete operation. It can change + # until operation status is FINISHED, FAILED or CANCELLED. + class BatchDeleteJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An enum that specifies the job attributes that are returned in the + # {::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob#job MatchingJob.job} + # or {::Google::Cloud::Talent::V4::ListJobsResponse#jobs ListJobsResponse.jobs} + # fields. + module JobView + # Default value. + JOB_VIEW_UNSPECIFIED = 0 + + # A ID only view of job, with following attributes: + # {::Google::Cloud::Talent::V4::Job#name Job.name}, + # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. + JOB_VIEW_ID_ONLY = 1 + + # A minimal view of the job, with the following attributes: + # {::Google::Cloud::Talent::V4::Job#name Job.name}, + # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#company Job.company}, + # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. + JOB_VIEW_MINIMAL = 2 + + # A small view of the job, with the following attributes in the search + # results: {::Google::Cloud::Talent::V4::Job#name Job.name}, + # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4::Job#title Job.title}, + # {::Google::Cloud::Talent::V4::Job#company Job.company}, + # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, + # {::Google::Cloud::Talent::V4::Job#visibility Job.visibility}, + # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, + # {::Google::Cloud::Talent::V4::Job#description Job.description}. + JOB_VIEW_SMALL = 3 + + # All available attributes are included in the search results. + JOB_VIEW_FULL = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb new file mode 100644 index 000000000000..75689dcc538b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # A Tenant resource represents a tenant in the service. A tenant is a group or + # entity that shares common access with specific privileges for resources like + # jobs. Customer may create multiple tenants to provide data isolation for + # different groups. + # @!attribute [rw] name + # @return [::String] + # Required during tenant update. + # + # The resource name for a tenant. This is generated by the service when a + # tenant is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] external_id + # @return [::String] + # Required. Client side tenant identifier, used to uniquely identify the + # tenant. + # + # The maximum number of allowed characters is 255. + class Tenant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb new file mode 100644 index 000000000000..69e01584823c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4 + # The Request of the CreateTenant method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @!attribute [rw] tenant + # @return [::Google::Cloud::Talent::V4::Tenant] + # Required. The tenant to be created. + class CreateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a tenant by name. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + class GetTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for updating a specified tenant. + # @!attribute [rw] tenant + # @return [::Google::Cloud::Talent::V4::Tenant] + # Required. The tenant resource to replace the current resource in the + # system. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is + # provided, only the specified fields in + # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. + # Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. + class UpdateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a tenant. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + class DeleteTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List tenants for which the client has ACL visibility. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @!attribute [rw] page_token + # @return [::String] + # The starting indicator from which to return results. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + class ListTenantsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The List tenants response object. + # @!attribute [rw] tenants + # @return [::Array<::Google::Cloud::Talent::V4::Tenant>] + # Tenants for the current client. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListTenantsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-talent-v4/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..1b485b0c3456 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..c15e78a39a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # An object that represents a latitude/longitude pair. This is expressed as a + # pair of doubles to represent degrees latitude and degrees longitude. Unless + # specified otherwise, this must conform to the + # WGS84 + # standard. Values must be within normalized ranges. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude in degrees. It must be in the range [-90.0, +90.0]. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude in degrees. It must be in the range [-180.0, +180.0]. + class LatLng + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb new file mode 100644 index 000000000000..56a32eee300d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 an amount of money with its currency type. + # @!attribute [rw] currency_code + # @return [::String] + # The three-letter currency code defined in ISO 4217. + # @!attribute [rw] units + # @return [::Integer] + # The whole units of the amount. + # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + # @!attribute [rw] nanos + # @return [::Integer] + # Number of nano (10^-9) units of the amount. + # The value must be between -999,999,999 and +999,999,999 inclusive. + # If `units` is positive, `nanos` must be positive or zero. + # If `units` is zero, `nanos` can be positive, zero, or negative. + # If `units` is negative, `nanos` must be negative or zero. + # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + class Money + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb new file mode 100644 index 000000000000..9cd0c16495dd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 postal address, e.g. for postal delivery or payments addresses. + # Given a postal address, a postal service can deliver items to a premise, P.O. + # Box or similar. + # It is not intended to model geographical locations (roads, towns, + # mountains). + # + # In typical usage an address would be created via user input or from importing + # existing data, depending on the type of process. + # + # Advice on address input / editing: + # - Use an i18n-ready address widget such as + # https://github.com/google/libaddressinput) + # - Users should not be presented with UI elements for input or editing of + # fields outside countries where that field is used. + # + # For more guidance on how to use this schema, please see: + # https://support.google.com/business/answer/6397478 + # @!attribute [rw] revision + # @return [::Integer] + # The schema revision of the `PostalAddress`. This must be set to 0, which is + # the latest revision. + # + # All new revisions **must** be backward compatible with old revisions. + # @!attribute [rw] region_code + # @return [::String] + # Required. CLDR region code of the country/region of the address. This + # is never inferred and it is up to the user to ensure the value is + # correct. See http://cldr.unicode.org/ and + # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] language_code + # @return [::String] + # Optional. BCP-47 language code of the contents of this address (if + # known). This is often the UI language of the input form or is expected + # to match one of the languages used in the address' country/region, or their + # transliterated equivalents. + # This can affect formatting in certain countries, but is not critical + # to the correctness of the data and will never affect any validation or + # other non-formatting related operations. + # + # If this value is not known, it should be omitted (rather than specifying a + # possibly incorrect default). + # + # Examples: "zh-Hant", "ja", "ja-Latn", "en". + # @!attribute [rw] postal_code + # @return [::String] + # Optional. Postal code of the address. Not all countries use or require + # postal codes to be present, but where they are used, they may trigger + # additional validation with other parts of the address (e.g. state/zip + # validation in the U.S.A.). + # @!attribute [rw] sorting_code + # @return [::String] + # Optional. Additional, country-specific, sorting code. This is not used + # in most regions. Where it is used, the value is either a string like + # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + # alone, representing the "sector code" (Jamaica), "delivery area indicator" + # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + # @!attribute [rw] administrative_area + # @return [::String] + # Optional. Highest administrative subdivision which is used for postal + # addresses of a country or region. + # For example, this can be a state, a province, an oblast, or a prefecture. + # Specifically, for Spain this is the province and not the autonomous + # community (e.g. "Barcelona" and not "Catalonia"). + # Many countries don't use an administrative area in postal addresses. E.g. + # in Switzerland this should be left unpopulated. + # @!attribute [rw] locality + # @return [::String] + # Optional. Generally refers to the city/town portion of the address. + # Examples: US city, IT comune, UK post town. + # In regions of the world where localities are not well defined or do not fit + # into this structure well, leave locality empty and use address_lines. + # @!attribute [rw] sublocality + # @return [::String] + # Optional. Sublocality of the address. + # For example, this can be neighborhoods, boroughs, districts. + # @!attribute [rw] address_lines + # @return [::Array<::String>] + # Unstructured address lines describing the lower levels of an address. + # + # Because values in address_lines do not have type information and may + # sometimes contain multiple values in a single field (e.g. + # "Austin, TX"), it is important that the line order is clear. The order of + # address lines should be "envelope order" for the country/region of the + # address. In places where this can vary (e.g. Japan), address_language is + # used to make it explicit (e.g. "ja" for large-to-small ordering and + # "ja-Latn" or "en" for small-to-large). This way, the most specific line of + # an address can be selected based on the language. + # + # The minimum permitted structural representation of an address consists + # of a region_code with all remaining information placed in the + # address_lines. It would be possible to format such an address very + # approximately without geocoding, but no semantic reasoning could be + # made about any of the address components until it was at least + # partially resolved. + # + # Creating an address only containing a region_code and address_lines, and + # then geocoding is the recommended way to handle completely unstructured + # addresses (as opposed to guessing which parts of the address should be + # localities or administrative areas). + # @!attribute [rw] recipients + # @return [::Array<::String>] + # Optional. The recipient at the address. + # This field may, under certain circumstances, contain multiline information. + # For example, it might contain "care of" information. + # @!attribute [rw] organization + # @return [::String] + # Optional. The name of the organization at the address. + class PostalAddress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile b/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile new file mode 100644 index 000000000000..b3bffd08bc08 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4", path: "../" +else + gem "google-cloud-talent-v4" +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-talent-v4/snippets/company_service/create_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb new file mode 100644 index 000000000000..e56a55c05094 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_CreateCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_company call in the CompanyService 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::Talent::V4::CompanyService::Client#create_company. +# +def create_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateCompanyRequest.new + + # Call the create_company method. + result = client.create_company request + + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end +# [END jobs_v4_generated_CompanyService_CreateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb new file mode 100644 index 000000000000..40fdb75b8cc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_DeleteCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the delete_company call in the CompanyService 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::Talent::V4::CompanyService::Client#delete_company. +# +def delete_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new + + # Call the delete_company method. + result = client.delete_company request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4_generated_CompanyService_DeleteCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb new file mode 100644 index 000000000000..9c22acb2386a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_GetCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the get_company call in the CompanyService 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::Talent::V4::CompanyService::Client#get_company. +# +def get_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetCompanyRequest.new + + # Call the get_company method. + result = client.get_company request + + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end +# [END jobs_v4_generated_CompanyService_GetCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb new file mode 100644 index 000000000000..020a9f51d83c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_ListCompanies_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the list_companies call in the CompanyService 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::Talent::V4::CompanyService::Client#list_companies. +# +def list_companies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListCompaniesRequest.new + + # Call the list_companies method. + result = client.list_companies 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::Talent::V4::Company. + p item + end +end +# [END jobs_v4_generated_CompanyService_ListCompanies_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb new file mode 100644 index 000000000000..8b646272a21b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_UpdateCompany_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the update_company call in the CompanyService 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::Talent::V4::CompanyService::Client#update_company. +# +def update_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new + + # Call the update_company method. + result = client.update_company request + + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end +# [END jobs_v4_generated_CompanyService_UpdateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb new file mode 100644 index 000000000000..43f84207b6e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_Completion_CompleteQuery_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the complete_query call in the Completion 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::Talent::V4::Completion::Client#complete_query. +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::Completion::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CompleteQueryRequest.new + + # Call the complete_query method. + result = client.complete_query request + + # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. + p result +end +# [END jobs_v4_generated_Completion_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb new file mode 100644 index 000000000000..ade74776472e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_EventService_CreateClientEvent_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_client_event call in the EventService 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::Talent::V4::EventService::Client#create_client_event. +# +def create_client_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::EventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateClientEventRequest.new + + # Call the create_client_event method. + result = client.create_client_event request + + # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. + p result +end +# [END jobs_v4_generated_EventService_CreateClientEvent_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb new file mode 100644 index 000000000000..21835b11ffce --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_BatchCreateJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the batch_create_jobs call in the JobService 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::Talent::V4::JobService::Client#batch_create_jobs. +# +def batch_create_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new + + # Call the batch_create_jobs method. + result = client.batch_create_jobs 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 jobs_v4_generated_JobService_BatchCreateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb new file mode 100644 index 000000000000..0cb9e4d13b0b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_BatchDeleteJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the batch_delete_jobs call in the JobService 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::Talent::V4::JobService::Client#batch_delete_jobs. +# +def batch_delete_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new + + # Call the batch_delete_jobs method. + result = client.batch_delete_jobs 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 jobs_v4_generated_JobService_BatchDeleteJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb new file mode 100644 index 000000000000..bb184ab697d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_BatchUpdateJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the batch_update_jobs call in the JobService 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::Talent::V4::JobService::Client#batch_update_jobs. +# +def batch_update_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new + + # Call the batch_update_jobs method. + result = client.batch_update_jobs 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 jobs_v4_generated_JobService_BatchUpdateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb new file mode 100644 index 000000000000..aba1bba6ca7b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_CreateJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_job call in the JobService 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::Talent::V4::JobService::Client#create_job. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end +# [END jobs_v4_generated_JobService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb new file mode 100644 index 000000000000..1391253de76b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_DeleteJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the delete_job call in the JobService 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::Talent::V4::JobService::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::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 jobs_v4_generated_JobService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb new file mode 100644 index 000000000000..16f9c7382f55 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_GetJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the get_job call in the JobService 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::Talent::V4::JobService::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end +# [END jobs_v4_generated_JobService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb new file mode 100644 index 000000000000..2445a495de35 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_ListJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the list_jobs call in the JobService 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::Talent::V4::JobService::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::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::Talent::V4::Job. + p item + end +end +# [END jobs_v4_generated_JobService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb new file mode 100644 index 000000000000..6b29ad36b790 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_SearchJobs_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the search_jobs call in the JobService 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::Talent::V4::JobService::Client#search_jobs. +# +def search_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::SearchJobsRequest.new + + # Call the search_jobs method. + result = client.search_jobs request + + # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + p result +end +# [END jobs_v4_generated_JobService_SearchJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb new file mode 100644 index 000000000000..3e422ee69d93 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_SearchJobsForAlert_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the search_jobs_for_alert call in the JobService 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::Talent::V4::JobService::Client#search_jobs_for_alert. +# +def search_jobs_for_alert + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::SearchJobsRequest.new + + # Call the search_jobs_for_alert method. + result = client.search_jobs_for_alert request + + # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + p result +end +# [END jobs_v4_generated_JobService_SearchJobsForAlert_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb new file mode 100644 index 000000000000..7be182860d89 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_UpdateJob_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the update_job call in the JobService 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::Talent::V4::JobService::Client#update_job. +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end +# [END jobs_v4_generated_JobService_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json b/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json new file mode 100644 index 000000000000..282652fed372 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json @@ -0,0 +1,895 @@ +{ + "client_library": { + "name": "google-cloud-talent-v4", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.talent.v4", + "version": "v4" + } + ] + }, + "snippets": [ + { + "region_tag": "jobs_v4_generated_CompanyService_CreateCompany_sync", + "title": "Snippet for the create_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#create_company.", + "file": "company_service/create_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#create_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "CreateCompany", + "full_name": "google.cloud.talent.v4.CompanyService.CreateCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_GetCompany_sync", + "title": "Snippet for the get_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#get_company.", + "file": "company_service/get_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#get_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::GetCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "GetCompany", + "full_name": "google.cloud.talent.v4.CompanyService.GetCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_UpdateCompany_sync", + "title": "Snippet for the update_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#update_company.", + "file": "company_service/update_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#update_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::UpdateCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "UpdateCompany", + "full_name": "google.cloud.talent.v4.CompanyService.UpdateCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_DeleteCompany_sync", + "title": "Snippet for the delete_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#delete_company.", + "file": "company_service/delete_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_company", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#delete_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::DeleteCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "DeleteCompany", + "full_name": "google.cloud.talent.v4.CompanyService.DeleteCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_CompanyService_ListCompanies_sync", + "title": "Snippet for the list_companies call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#list_companies.", + "file": "company_service/list_companies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_companies", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#list_companies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::ListCompaniesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ListCompaniesResponse", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" + }, + "method": { + "short_name": "ListCompanies", + "full_name": "google.cloud.talent.v4.CompanyService.ListCompanies", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_Completion_CompleteQuery_sync", + "title": "Snippet for the complete_query call in the Completion service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::Completion::Client#complete_query.", + "file": "completion/complete_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "complete_query", + "full_name": "::Google::Cloud::Talent::V4::Completion::Client#complete_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CompleteQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::CompleteQueryResponse", + "client": { + "short_name": "Completion::Client", + "full_name": "::Google::Cloud::Talent::V4::Completion::Client" + }, + "method": { + "short_name": "CompleteQuery", + "full_name": "google.cloud.talent.v4.Completion.CompleteQuery", + "service": { + "short_name": "Completion", + "full_name": "google.cloud.talent.v4.Completion" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_EventService_CreateClientEvent_sync", + "title": "Snippet for the create_client_event call in the EventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::EventService::Client#create_client_event.", + "file": "event_service/create_client_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_client_event", + "full_name": "::Google::Cloud::Talent::V4::EventService::Client#create_client_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateClientEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ClientEvent", + "client": { + "short_name": "EventService::Client", + "full_name": "::Google::Cloud::Talent::V4::EventService::Client" + }, + "method": { + "short_name": "CreateClientEvent", + "full_name": "google.cloud.talent.v4.EventService.CreateClientEvent", + "service": { + "short_name": "EventService", + "full_name": "google.cloud.talent.v4.EventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_CreateJob_sync", + "title": "Snippet for the create_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#create_job.", + "file": "job_service/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.talent.v4.JobService.CreateJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_BatchCreateJobs_sync", + "title": "Snippet for the batch_create_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs.", + "file": "job_service/batch_create_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::BatchCreateJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "BatchCreateJobs", + "full_name": "google.cloud.talent.v4.JobService.BatchCreateJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_GetJob_sync", + "title": "Snippet for the get_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#get_job.", + "file": "job_service/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.talent.v4.JobService.GetJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_UpdateJob_sync", + "title": "Snippet for the update_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#update_job.", + "file": "job_service/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.talent.v4.JobService.UpdateJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_BatchUpdateJobs_sync", + "title": "Snippet for the batch_update_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs.", + "file": "job_service/batch_update_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::BatchUpdateJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "BatchUpdateJobs", + "full_name": "google.cloud.talent.v4.JobService.BatchUpdateJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_DeleteJob_sync", + "title": "Snippet for the delete_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#delete_job.", + "file": "job_service/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.talent.v4.JobService.DeleteJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_BatchDeleteJobs_sync", + "title": "Snippet for the batch_delete_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs.", + "file": "job_service/batch_delete_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::BatchDeleteJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "BatchDeleteJobs", + "full_name": "google.cloud.talent.v4.JobService.BatchDeleteJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_ListJobs_sync", + "title": "Snippet for the list_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#list_jobs.", + "file": "job_service/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ListJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.talent.v4.JobService.ListJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_SearchJobs_sync", + "title": "Snippet for the search_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs.", + "file": "job_service/search_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_jobs", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "SearchJobs", + "full_name": "google.cloud.talent.v4.JobService.SearchJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_JobService_SearchJobsForAlert_sync", + "title": "Snippet for the search_jobs_for_alert call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert.", + "file": "job_service/search_jobs_for_alert.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_jobs_for_alert", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4::JobService::Client" + }, + "method": { + "short_name": "SearchJobsForAlert", + "full_name": "google.cloud.talent.v4.JobService.SearchJobsForAlert", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_CreateTenant_sync", + "title": "Snippet for the create_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#create_tenant.", + "file": "tenant_service/create_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#create_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::CreateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "CreateTenant", + "full_name": "google.cloud.talent.v4.TenantService.CreateTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_GetTenant_sync", + "title": "Snippet for the get_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#get_tenant.", + "file": "tenant_service/get_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#get_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::GetTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "GetTenant", + "full_name": "google.cloud.talent.v4.TenantService.GetTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_UpdateTenant_sync", + "title": "Snippet for the update_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#update_tenant.", + "file": "tenant_service/update_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#update_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::UpdateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "UpdateTenant", + "full_name": "google.cloud.talent.v4.TenantService.UpdateTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_DeleteTenant_sync", + "title": "Snippet for the delete_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#delete_tenant.", + "file": "tenant_service/delete_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tenant", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#delete_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::DeleteTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "DeleteTenant", + "full_name": "google.cloud.talent.v4.TenantService.DeleteTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4_generated_TenantService_ListTenants_sync", + "title": "Snippet for the list_tenants call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#list_tenants.", + "file": "tenant_service/list_tenants.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tenants", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#list_tenants", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4::ListTenantsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4::ListTenantsResponse", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" + }, + "method": { + "short_name": "ListTenants", + "full_name": "google.cloud.talent.v4.TenantService.ListTenants", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb new file mode 100644 index 000000000000..665aba99974d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_CreateTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the create_tenant call in the TenantService 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::Talent::V4::TenantService::Client#create_tenant. +# +def create_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateTenantRequest.new + + # Call the create_tenant method. + result = client.create_tenant request + + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end +# [END jobs_v4_generated_TenantService_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb new file mode 100644 index 000000000000..f0ee2dc8605a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_DeleteTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the delete_tenant call in the TenantService 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::Talent::V4::TenantService::Client#delete_tenant. +# +def delete_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteTenantRequest.new + + # Call the delete_tenant method. + result = client.delete_tenant request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4_generated_TenantService_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb new file mode 100644 index 000000000000..92928f5b47d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_GetTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the get_tenant call in the TenantService 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::Talent::V4::TenantService::Client#get_tenant. +# +def get_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetTenantRequest.new + + # Call the get_tenant method. + result = client.get_tenant request + + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end +# [END jobs_v4_generated_TenantService_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb new file mode 100644 index 000000000000..4cfc79e6fc24 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_ListTenants_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the list_tenants call in the TenantService 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::Talent::V4::TenantService::Client#list_tenants. +# +def list_tenants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListTenantsRequest.new + + # Call the list_tenants method. + result = client.list_tenants 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::Talent::V4::Tenant. + p item + end +end +# [END jobs_v4_generated_TenantService_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb new file mode 100644 index 000000000000..19154714e44b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_UpdateTenant_sync] +require "google/cloud/talent/v4" + +## +# Snippet for the update_tenant call in the TenantService 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::Talent::V4::TenantService::Client#update_tenant. +# +def update_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateTenantRequest.new + + # Call the update_tenant method. + result = client.update_tenant request + + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end +# [END jobs_v4_generated_TenantService_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb new file mode 100644 index 000000000000..51d748c725d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service" + +class ::Google::Cloud::Talent::V4::CompanyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb new file mode 100644 index 000000000000..55e30df49147 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" +require "google/cloud/talent/v4/company_service/rest" + + +class ::Google::Cloud::Talent::V4::CompanyService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + company = {} + + create_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_create_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_company({ parent: parent, company: company }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_company parent: parent, company: company do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_company({ parent: parent, company: company }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_company_client_stub.call_count + end + end + end + + def test_get_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_get_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_company({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_company name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_company({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_company(::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_company_client_stub.call_count + end + end + end + + def test_update_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + company = {} + update_mask = {} + + update_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_update_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_company({ company: company, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_company company: company, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_company({ company: company, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_company_client_stub.call_count + end + end + end + + def test_delete_company + # 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_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_delete_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_company({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_company name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_company({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_company_client_stub.call_count + end + end + end + + def test_list_companies + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + require_open_jobs = true + + list_companies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_list_companies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_companies_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_companies_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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb new file mode 100644 index 000000000000..e4827e8d8ef9 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb @@ -0,0 +1,409 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" +require "google/cloud/talent/v4/company_service" + +class ::Google::Cloud::Talent::V4::CompanyService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Company.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" + company = {} + + create_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_company, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateCompanyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_company({ parent: parent, company: company }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_company parent: parent, company: company do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_company({ parent: parent, company: company }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_company_client_stub.call_rpc_count + end + end + + def test_get_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Company.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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_company, name + assert_kind_of ::Google::Cloud::Talent::V4::GetCompanyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_company({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_company name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_company({ 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_company(::Google::Cloud::Talent::V4::GetCompanyRequest.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_company_client_stub.call_rpc_count + end + end + + def test_update_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Company.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. + company = {} + update_mask = {} + + update_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_company, name + assert_kind_of ::Google::Cloud::Talent::V4::UpdateCompanyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_company({ company: company, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_company company: company, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company({ company: company, 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_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company_client_stub.call_rpc_count + end + end + + def test_delete_company + # 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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_company, name + assert_kind_of ::Google::Cloud::Talent::V4::DeleteCompanyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_company({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_company name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_company({ 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_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.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_company_client_stub.call_rpc_count + end + end + + def test_list_companies + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::ListCompaniesResponse.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_token = "hello world" + page_size = 42 + require_open_jobs = true + + list_companies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_companies, name + assert_kind_of ::Google::Cloud::Talent::V4::ListCompaniesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal true, request["require_open_jobs"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_companies_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) 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_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs 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_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) 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_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, 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_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), 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_companies_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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::CompanyService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb new file mode 100644 index 000000000000..aeb6b9d2f969 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion" + +class ::Google::Cloud::Talent::V4::Completion::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb new file mode 100644 index 000000000000..4a17510d2b0d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" +require "google/cloud/talent/v4/completion/rest" + + +class ::Google::Cloud::Talent::V4::Completion::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tenant = "hello world" + query = "hello world" + language_codes = ["hello world"] + page_size = 42 + company = "hello world" + scope = :COMPLETION_SCOPE_UNSPECIFIED + type = :COMPLETION_TYPE_UNSPECIFIED + + complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::Completion::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, complete_query_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::Talent::V4::Completion::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::Talent::V4::Completion::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb new file mode 100644 index 000000000000..1099c4c1ade7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" +require "google/cloud/talent/v4/completion" + +class ::Google::Cloud::Talent::V4::Completion::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::CompleteQueryResponse.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. + tenant = "hello world" + query = "hello world" + language_codes = ["hello world"] + page_size = 42 + company = "hello world" + scope = :COMPLETION_SCOPE_UNSPECIFIED + type = :COMPLETION_TYPE_UNSPECIFIED + + complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :complete_query, name + assert_kind_of ::Google::Cloud::Talent::V4::CompleteQueryRequest, request + assert_equal "hello world", request["tenant"] + assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["language_codes"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["company"] + assert_equal :COMPLETION_SCOPE_UNSPECIFIED, request["scope"] + assert_equal :COMPLETION_TYPE_UNSPECIFIED, request["type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, complete_query_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::Talent::V4::Completion::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::Talent::V4::Completion::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::Completion::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb new file mode 100644 index 000000000000..9812de9567dd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service" + +class ::Google::Cloud::Talent::V4::EventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb new file mode 100644 index 000000000000..9d149f603fb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" +require "google/cloud/talent/v4/event_service/rest" + + +class ::Google::Cloud::Talent::V4::EventService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_client_event + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ClientEvent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + client_event = {} + + create_client_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::EventService::Rest::ServiceStub.stub :transcode_create_client_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_client_event_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_client_event({ parent: parent, client_event: client_event }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_client_event parent: parent, client_event: client_event do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_client_event({ parent: parent, client_event: client_event }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_client_event_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::Talent::V4::EventService::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::Talent::V4::EventService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb new file mode 100644 index 000000000000..90ae40a15d96 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" +require "google/cloud/talent/v4/event_service" + +class ::Google::Cloud::Talent::V4::EventService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_client_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::ClientEvent.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" + client_event = {} + + create_client_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_client_event, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateClientEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::ClientEvent), request["client_event"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_client_event_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_client_event({ parent: parent, client_event: client_event }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_client_event parent: parent, client_event: client_event do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_client_event({ parent: parent, client_event: client_event }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_client_event_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::Talent::V4::EventService::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::Talent::V4::EventService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::EventService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb new file mode 100644 index 000000000000..21555365b3e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service_services_pb" +require "google/cloud/talent/v4/job_service" + +class ::Google::Cloud::Talent::V4::JobService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb new file mode 100644 index 000000000000..c7a1a286edc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service" + +class ::Google::Cloud::Talent::V4::JobService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + end + end + + def test_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", tenant: "value1", job: "value2" + assert_equal "projects/value0/tenants/value1/jobs/value2", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb new file mode 100644 index 000000000000..f898410562ca --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb @@ -0,0 +1,679 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service/rest" + + +class ::Google::Cloud::Talent::V4::JobService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job: job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_batch_create_jobs + # 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" + jobs = [{}] + + batch_create_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_create_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_jobs({ parent: parent, jobs: jobs }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_jobs parent: parent, jobs: jobs do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_jobs({ parent: parent, jobs: jobs }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_jobs_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Talent::V4::GetJobRequest.new(name: name), 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_update_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_job 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::Talent::V4::UpdateJobRequest.new(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({ 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::Talent::V4::UpdateJobRequest.new(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_batch_update_jobs + # 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" + jobs = [{}] + update_mask = {} + + batch_update_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_update_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_jobs_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. + name = "hello world" + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name), 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_batch_delete_jobs + # 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" + names = ["hello world"] + + batch_delete_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_delete_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_delete_jobs({ parent: parent, names: names }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_delete_jobs parent: parent, names: names do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_delete_jobs({ parent: parent, names: names }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_jobs_client_stub.call_count + end + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + job_view = :JOB_VIEW_UNSPECIFIED + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_jobs_client_stub.call_count + end + end + end + + def test_search_jobs_for_alert + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_for_alert_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_jobs_for_alert_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_jobs_for_alert_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::Talent::V4::JobService::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::Talent::V4::JobService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb new file mode 100644 index 000000000000..d450c7816e63 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb @@ -0,0 +1,798 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" +require "google/cloud/talent/v4/job_service" + +class ::Google::Cloud::Talent::V4::JobService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::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. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Job), request["job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job: job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_batch_create_jobs + # 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" + jobs = [{}] + + batch_create_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_jobs({ parent: parent, jobs: jobs }) 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.batch_create_jobs parent: parent, jobs: jobs 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.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) 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.batch_create_jobs({ parent: parent, jobs: jobs }, 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.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), 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, batch_create_jobs_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::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. + name = "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::Talent::V4::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ 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_job(::Google::Cloud::Talent::V4::GetJobRequest.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_job_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::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. + 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::Talent::V4::UpdateJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::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::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ 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 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::Talent::V4::UpdateJobRequest.new(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({ 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::Talent::V4::UpdateJobRequest.new(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_batch_update_jobs + # 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" + jobs = [{}] + update_mask = {} + + batch_update_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) 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.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask 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.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) 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.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, 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.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), 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, batch_update_jobs_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. + name = "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::Talent::V4::DeleteJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ 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_job(::Google::Cloud::Talent::V4::DeleteJobRequest.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_job_client_stub.call_rpc_count + end + end + + def test_batch_delete_jobs + # 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" + names = ["hello world"] + + batch_delete_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_delete_jobs({ parent: parent, names: names }) 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.batch_delete_jobs parent: parent, names: names 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.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) 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.batch_delete_jobs({ parent: parent, names: names }, 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.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), 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, batch_delete_jobs_client_stub.call_rpc_count + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::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. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + job_view = :JOB_VIEW_UNSPECIFIED + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) 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 parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view 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::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) 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({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, 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::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.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" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] + assert_equal true, request["enable_broadening"] + assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + assert_equal 42, request["offset"] + assert_equal 42, request["max_page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] + assert_equal true, request["disable_keyword_match"] + assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_jobs_client_stub.call_rpc_count + end + end + + def test_search_jobs_for_alert + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.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" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + max_page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_for_alert_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_jobs_for_alert, name + assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] + assert_equal true, request["enable_broadening"] + assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + assert_equal 42, request["offset"] + assert_equal 42, request["max_page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] + assert_equal true, request["disable_keyword_match"] + assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_jobs_for_alert_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_jobs_for_alert_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::Talent::V4::JobService::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::Talent::V4::JobService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::JobService::Client, client + assert_equal creds, client.configure.credentials + end + 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::Talent::V4::JobService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Talent::V4::JobService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb new file mode 100644 index 000000000000..0b082784d6bd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service" + +class ::Google::Cloud::Talent::V4::TenantService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb new file mode 100644 index 000000000000..ea21ef440774 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" +require "google/cloud/talent/v4/tenant_service/rest" + + +class ::Google::Cloud::Talent::V4::TenantService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tenant = {} + + create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tenant({ parent: parent, tenant: tenant }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tenant parent: parent, tenant: tenant do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant: tenant }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_count + end + end + end + + def test_get_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tenant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tenant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tenant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tenant_client_stub.call_count + end + end + end + + def test_update_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tenant = {} + update_mask = {} + + update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tenant tenant: tenant, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tenant({ tenant: tenant, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tenant_client_stub.call_count + end + end + end + + def test_delete_tenant + # 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_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tenant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tenant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tenant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tenant_client_stub.call_count + end + end + end + + def test_list_tenants + # Create test objects. + client_result = ::Google::Cloud::Talent::V4::ListTenantsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_tenants_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::Talent::V4::TenantService::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::Talent::V4::TenantService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb new file mode 100644 index 000000000000..9f48a5264f89 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb @@ -0,0 +1,407 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" +require "google/cloud/talent/v4/tenant_service" + +class ::Google::Cloud::Talent::V4::TenantService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Tenant.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" + tenant = {} + + create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::CreateTenantRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tenant({ parent: parent, tenant: tenant }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tenant parent: parent, tenant: tenant do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant: tenant }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_rpc_count + end + end + + def test_get_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Tenant.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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::GetTenantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tenant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tenant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tenant({ 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_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.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_tenant_client_stub.call_rpc_count + end + end + + def test_update_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::Tenant.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. + tenant = {} + update_mask = {} + + update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::UpdateTenantRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_tenant tenant: tenant, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, 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_tenant({ tenant: tenant, 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_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, 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_tenant_client_stub.call_rpc_count + end + end + + def test_delete_tenant + # 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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4::DeleteTenantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tenant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tenant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tenant({ 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_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.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_tenant_client_stub.call_rpc_count + end + end + + def test_list_tenants + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4::ListTenantsResponse.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_token = "hello world" + page_size = 42 + + list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tenants, name + assert_kind_of ::Google::Cloud::Talent::V4::ListTenantsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) 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_tenants parent: parent, page_token: page_token, page_size: page_size 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_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_tenants({ parent: parent, page_token: page_token, page_size: page_size }, 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_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_tenants_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::Talent::V4::TenantService::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::Talent::V4::TenantService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4::TenantService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/helper.rb b/owl-bot-staging/google-cloud-talent-v4/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/.gitignore b/owl-bot-staging/google-cloud-talent-v4beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/.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-talent-v4beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-talent-v4beta1/.repo-metadata.json new file mode 100644 index 000000000000..64fc84b59ea7 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "jobs.googleapis.com", + "api_shortname": "jobs", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest", + "distribution_name": "google-cloud-talent-v4beta1", + "is_cloud": true, + "language": "ruby", + "name": "jobs", + "name_pretty": "Cloud Talent Solution V4beta1 API", + "product_documentation": "https://cloud.google.com/solutions/talent-solution", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TALENT", + "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml b/owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml new file mode 100644 index 000000000000..8fe2d7ec9ecd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-talent-v4beta1.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-talent-v4beta1.rb" diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb b/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/.yardopts b/owl-bot-staging/google-cloud-talent-v4beta1/.yardopts new file mode 100644 index 000000000000..72b9d2c72c9c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Talent Solution V4beta1 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-talent-v4beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent-v4beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..26b135cba9b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-talent-v4beta1 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-talent-v4beta1 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/talent/v4beta1" + +client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/talent/v4beta1" + +::Google::Cloud::Talent::V4beta1::CompanyService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Talent::V4beta1::CompanyService::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-talent-v4beta1 +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/talent/v4beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Talent::V4beta1::CompanyService::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-talent-v4beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-talent-v4beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile b/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-talent-v4beta1/LICENSE.md b/owl-bot-staging/google-cloud-talent-v4beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/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-talent-v4beta1/README.md b/owl-bot-staging/google-cloud-talent-v4beta1/README.md new file mode 100644 index 000000000000..5a72cfcb8d08 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Talent Solution V4beta1 API + +Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. + +Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. + +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 Talent Solution V4beta1 API. Most users should consider using +the main client gem, +[google-cloud-talent](https://rubygems.org/gems/google-cloud-talent). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-talent-v4beta1 +``` + +## 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/jobs.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/talent/v4beta1" + +client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new +request = ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new # (request fields as keyword arguments...) +response = client.create_company request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/talent/v4beta1" +require "logger" + +client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-talent`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-talent-v4beta1`. +_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-talent`. +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-talent-v4beta1`. + +### 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-talent-v4beta1/Rakefile b/owl-bot-staging/google-cloud-talent-v4beta1/Rakefile new file mode 100644 index 000000000000..fa2bfbd46707 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TALENT_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TALENT_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/talent/v4beta1/company_service/credentials" + ::Google::Cloud::Talent::V4beta1::CompanyService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TALENT_PROJECT"] = project + ENV["TALENT_TEST_PROJECT"] = project + ENV["TALENT_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-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-talent-v4beta1" + header "google-cloud-talent-v4beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-talent-v4beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-talent-v4beta1/gapic_metadata.json new file mode 100644 index 000000000000..91c70fb53d53 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/gapic_metadata.json @@ -0,0 +1,164 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.talent.v4beta1", + "libraryPackage": "::Google::Cloud::Talent::V4beta1", + "services": { + "CompanyService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4beta1::CompanyService::Client", + "rpcs": { + "CreateCompany": { + "methods": [ + "create_company" + ] + }, + "GetCompany": { + "methods": [ + "get_company" + ] + }, + "UpdateCompany": { + "methods": [ + "update_company" + ] + }, + "DeleteCompany": { + "methods": [ + "delete_company" + ] + }, + "ListCompanies": { + "methods": [ + "list_companies" + ] + } + } + } + } + }, + "Completion": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4beta1::Completion::Client", + "rpcs": { + "CompleteQuery": { + "methods": [ + "complete_query" + ] + } + } + } + } + }, + "EventService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4beta1::EventService::Client", + "rpcs": { + "CreateClientEvent": { + "methods": [ + "create_client_event" + ] + } + } + } + } + }, + "JobService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4beta1::JobService::Client", + "rpcs": { + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "BatchCreateJobs": { + "methods": [ + "batch_create_jobs" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "BatchUpdateJobs": { + "methods": [ + "batch_update_jobs" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "BatchDeleteJobs": { + "methods": [ + "batch_delete_jobs" + ] + }, + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "SearchJobs": { + "methods": [ + "search_jobs" + ] + }, + "SearchJobsForAlert": { + "methods": [ + "search_jobs_for_alert" + ] + } + } + } + } + }, + "TenantService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Talent::V4beta1::TenantService::Client", + "rpcs": { + "CreateTenant": { + "methods": [ + "create_tenant" + ] + }, + "GetTenant": { + "methods": [ + "get_tenant" + ] + }, + "UpdateTenant": { + "methods": [ + "update_tenant" + ] + }, + "DeleteTenant": { + "methods": [ + "delete_tenant" + ] + }, + "ListTenants": { + "methods": [ + "list_tenants" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec b/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec new file mode 100644 index 000000000000..377804f34680 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/talent/v4beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-talent-v4beta1" + gem.version = Google::Cloud::Talent::V4beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details." + gem.summary = "Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb new file mode 100644 index 000000000000..53968619b7a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1" diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb new file mode 100644 index 000000000000..52a7a7baa5bd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service" +require "google/cloud/talent/v4beta1/completion" +require "google/cloud/talent/v4beta1/event_service" +require "google/cloud/talent/v4beta1/job_service" +require "google/cloud/talent/v4beta1/tenant_service" +require "google/cloud/talent/v4beta1/version" + +module Google + module Cloud + module Talent + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/talent/v4beta1" + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/talent/v4beta1" + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + module V4beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v4beta1", "_helpers.rb" +require "google/cloud/talent/v4beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb new file mode 100644 index 000000000000..1371b5a492c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/batch.proto + +require 'google/protobuf' + + +descriptor_data = "\n\'google/cloud/talent/v4beta1/batch.proto\x12\x1bgoogle.cloud.talent.v4beta1Bn\n\x1f\x63om.google.cloud.talent.v4beta1B\nBatchProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ + ] + 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 Talent + module V4beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb new file mode 100644 index 000000000000..02b00f41a380 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/type/latlng_pb' +require 'google/type/money_pb' +require 'google/type/postal_address_pb' + + +descriptor_data = "\n(google/cloud/talent/v4beta1/common.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x18google/type/latlng.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"n\n\x0eTimestampRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb7\x03\n\x08Location\x12I\n\rlocation_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.Location.LocationType\x12\x32\n\x0epostal_address\x18\x02 \x01(\x0b\x32\x1a.google.type.PostalAddress\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x14\n\x0cradius_miles\x18\x04 \x01(\x01\"\xef\x01\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OUNTRY\x10\x01\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x02\x12\x1b\n\x17SUB_ADMINISTRATIVE_AREA\x10\x03\x12\x0c\n\x08LOCALITY\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x10\n\x0cSUB_LOCALITY\x10\x06\x12\x12\n\x0eSUB_LOCALITY_1\x10\x07\x12\x12\n\x0eSUB_LOCALITY_2\x10\x08\x12\x10\n\x0cNEIGHBORHOOD\x10\t\x12\x12\n\x0eSTREET_ADDRESS\x10\n\"\x9f\x01\n\x0fRequestMetadata\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x19\n\x11\x61llow_missing_ids\x18\x04 \x01(\x08\x12<\n\x0b\x64\x65vice_info\x18\x05 \x01(\x0b\x32\'.google.cloud.talent.v4beta1.DeviceInfo\"&\n\x10ResponseMetadata\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\xcf\x01\n\nDeviceInfo\x12G\n\x0b\x64\x65vice_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.DeviceInfo.DeviceType\x12\n\n\x02id\x18\x02 \x01(\t\"l\n\nDeviceType\x12\x1b\n\x17\x44\x45VICE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0e\n\nMOBILE_WEB\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x07\n\x03IOS\x10\x04\x12\x07\n\x03\x42OT\x10\x05\x12\t\n\x05OTHER\x10\x06\"m\n\x0f\x43ustomAttribute\x12\x15\n\rstring_values\x18\x01 \x03(\t\x12\x13\n\x0blong_values\x18\x02 \x03(\x03\x12\x12\n\nfilterable\x18\x03 \x01(\x08\x12\x1a\n\x12keyword_searchable\x18\x04 \x01(\x08\"W\n\x12SpellingCorrection\x12\x11\n\tcorrected\x18\x01 \x01(\x08\x12\x16\n\x0e\x63orrected_text\x18\x02 \x01(\t\x12\x16\n\x0e\x63orrected_html\x18\x03 \x01(\t\"\xa6\t\n\x10\x43ompensationInfo\x12P\n\x07\x65ntries\x18\x01 \x03(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry\x12p\n\"annualized_base_compensation_range\x18\x02 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x12q\n#annualized_total_compensation_range\x18\x03 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x1a\x92\x03\n\x11\x43ompensationEntry\x12L\n\x04type\x18\x01 \x01(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationType\x12L\n\x04unit\x18\x02 \x01(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit\x12$\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12P\n\x05range\x18\x04 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12=\n\x17\x65xpected_units_per_year\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValueB\x15\n\x13\x63ompensation_amount\x1ao\n\x11\x43ompensationRange\x12,\n\x10max_compensation\x18\x02 \x01(\x0b\x32\x12.google.type.Money\x12,\n\x10min_compensation\x18\x01 \x01(\x0b\x32\x12.google.type.Money\"\xb5\x01\n\x10\x43ompensationType\x12!\n\x1d\x43OMPENSATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42\x41SE\x10\x01\x12\t\n\x05\x42ONUS\x10\x02\x12\x11\n\rSIGNING_BONUS\x10\x03\x12\n\n\x06\x45QUITY\x10\x04\x12\x12\n\x0ePROFIT_SHARING\x10\x05\x12\x0f\n\x0b\x43OMMISSIONS\x10\x06\x12\x08\n\x04TIPS\x10\x07\x12\x1b\n\x17OTHER_COMPENSATION_TYPE\x10\x08\"\x9c\x01\n\x10\x43ompensationUnit\x12!\n\x1d\x43OMPENSATION_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06HOURLY\x10\x01\x12\t\n\x05\x44\x41ILY\x10\x02\x12\n\n\x06WEEKLY\x10\x03\x12\x0b\n\x07MONTHLY\x10\x04\x12\n\n\x06YEARLY\x10\x05\x12\x0c\n\x08ONE_TIME\x10\x06\x12\x1b\n\x17OTHER_COMPENSATION_UNIT\x10\x07\"\xcc\x03\n\x16\x42\x61tchOperationMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.BatchOperationMetadata.State\x12\x19\n\x11state_description\x18\x02 \x01(\t\x12\x15\n\rsuccess_count\x18\x03 \x01(\x05\x12\x15\n\rfailure_count\x18\x04 \x01(\x05\x12\x13\n\x0btotal_count\x18\x05 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"z\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06*y\n\x0b\x43ompanySize\x12\x1c\n\x18\x43OMPANY_SIZE_UNSPECIFIED\x10\x00\x12\x08\n\x04MINI\x10\x01\x12\t\n\x05SMALL\x10\x02\x12\x0b\n\x07SMEDIUM\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x07\n\x03\x42IG\x10\x05\x12\n\n\x06\x42IGGER\x10\x06\x12\t\n\x05GIANT\x10\x07*\xe2\x01\n\nJobBenefit\x12\x1b\n\x17JOB_BENEFIT_UNSPECIFIED\x10\x00\x12\x0e\n\nCHILD_CARE\x10\x01\x12\n\n\x06\x44\x45NTAL\x10\x02\x12\x14\n\x10\x44OMESTIC_PARTNER\x10\x03\x12\x12\n\x0e\x46LEXIBLE_HOURS\x10\x04\x12\x0b\n\x07MEDICAL\x10\x05\x12\x12\n\x0eLIFE_INSURANCE\x10\x06\x12\x12\n\x0ePARENTAL_LEAVE\x10\x07\x12\x13\n\x0fRETIREMENT_PLAN\x10\x08\x12\r\n\tSICK_DAYS\x10\t\x12\x0c\n\x08VACATION\x10\n\x12\n\n\x06VISION\x10\x0b*\x8e\x02\n\nDegreeType\x12\x1b\n\x17\x44\x45GREE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PRIMARY_EDUCATION\x10\x01\x12\x1d\n\x19LOWER_SECONDARY_EDUCATION\x10\x02\x12\x1d\n\x19UPPER_SECONDARY_EDUCATION\x10\x03\x12\x1c\n\x18\x41\x44ULT_REMEDIAL_EDUCATION\x10\x04\x12\x1c\n\x18\x41SSOCIATES_OR_EQUIVALENT\x10\x05\x12\x1b\n\x17\x42\x41\x43HELORS_OR_EQUIVALENT\x10\x06\x12\x19\n\x15MASTERS_OR_EQUIVALENT\x10\x07\x12\x1a\n\x16\x44OCTORAL_OR_EQUIVALENT\x10\x08*\xdc\x01\n\x0e\x45mploymentType\x12\x1f\n\x1b\x45MPLOYMENT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFULL_TIME\x10\x01\x12\r\n\tPART_TIME\x10\x02\x12\x0e\n\nCONTRACTOR\x10\x03\x12\x14\n\x10\x43ONTRACT_TO_HIRE\x10\x04\x12\r\n\tTEMPORARY\x10\x05\x12\n\n\x06INTERN\x10\x06\x12\r\n\tVOLUNTEER\x10\x07\x12\x0c\n\x08PER_DIEM\x10\x08\x12\x12\n\x0e\x46LY_IN_FLY_OUT\x10\t\x12\x19\n\x15OTHER_EMPLOYMENT_TYPE\x10\n*q\n\x08JobLevel\x12\x19\n\x15JOB_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45NTRY_LEVEL\x10\x01\x12\x0f\n\x0b\x45XPERIENCED\x10\x02\x12\x0b\n\x07MANAGER\x10\x03\x12\x0c\n\x08\x44IRECTOR\x10\x04\x12\r\n\tEXECUTIVE\x10\x05*\xba\x06\n\x0bJobCategory\x12\x1c\n\x18JOB_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41\x43\x43OUNTING_AND_FINANCE\x10\x01\x12\x1d\n\x19\x41\x44MINISTRATIVE_AND_OFFICE\x10\x02\x12\x1d\n\x19\x41\x44VERTISING_AND_MARKETING\x10\x03\x12\x0f\n\x0b\x41NIMAL_CARE\x10\x04\x12\x1a\n\x16\x41RT_FASHION_AND_DESIGN\x10\x05\x12\x17\n\x13\x42USINESS_OPERATIONS\x10\x06\x12\x1b\n\x17\x43LEANING_AND_FACILITIES\x10\x07\x12\x13\n\x0f\x43OMPUTER_AND_IT\x10\x08\x12\x10\n\x0c\x43ONSTRUCTION\x10\t\x12\x14\n\x10\x43USTOMER_SERVICE\x10\n\x12\r\n\tEDUCATION\x10\x0b\x12\x1c\n\x18\x45NTERTAINMENT_AND_TRAVEL\x10\x0c\x12\x18\n\x14\x46\x41RMING_AND_OUTDOORS\x10\r\x12\x0e\n\nHEALTHCARE\x10\x0e\x12\x13\n\x0fHUMAN_RESOURCES\x10\x0f\x12\'\n#INSTALLATION_MAINTENANCE_AND_REPAIR\x10\x10\x12\t\n\x05LEGAL\x10\x11\x12\x0e\n\nMANAGEMENT\x10\x12\x12\x1f\n\x1bMANUFACTURING_AND_WAREHOUSE\x10\x13\x12$\n MEDIA_COMMUNICATIONS_AND_WRITING\x10\x14\x12\x16\n\x12OIL_GAS_AND_MINING\x10\x15\x12\x1e\n\x1aPERSONAL_CARE_AND_SERVICES\x10\x16\x12\x17\n\x13PROTECTIVE_SERVICES\x10\x17\x12\x0f\n\x0bREAL_ESTATE\x10\x18\x12\x1e\n\x1aRESTAURANT_AND_HOSPITALITY\x10\x19\x12\x14\n\x10SALES_AND_RETAIL\x10\x1a\x12\x1b\n\x17SCIENCE_AND_ENGINEERING\x10\x1b\x12\"\n\x1eSOCIAL_SERVICES_AND_NON_PROFIT\x10\x1c\x12!\n\x1dSPORTS_FITNESS_AND_RECREATION\x10\x1d\x12 \n\x1cTRANSPORTATION_AND_LOGISTICS\x10\x1e*e\n\rPostingRegion\x12\x1e\n\x1aPOSTING_REGION_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x01\x12\n\n\x06NATION\x10\x02\x12\x0f\n\x0bTELECOMMUTE\x10\x03*n\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x41\x43\x43OUNT_ONLY\x10\x01\x12\x16\n\x12SHARED_WITH_GOOGLE\x10\x02\x12\x16\n\x12SHARED_WITH_PUBLIC\x10\x03\x1a\x02\x18\x01*q\n\x10HtmlSanitization\x12!\n\x1dHTML_SANITIZATION_UNSPECIFIED\x10\x00\x12\x1e\n\x1aHTML_SANITIZATION_DISABLED\x10\x01\x12\x1a\n\x16SIMPLE_FORMATTING_ONLY\x10\x02*c\n\rCommuteMethod\x12\x1e\n\x1a\x43OMMUTE_METHOD_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44RIVING\x10\x01\x12\x0b\n\x07TRANSIT\x10\x02\x12\x0b\n\x07WALKING\x10\x03\x12\x0b\n\x07\x43YCLING\x10\x04\x42o\n\x1f\x63om.google.cloud.talent.v4beta1B\x0b\x43ommonProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.type.PostalAddress", "google/type/postal_address.proto"], + ["google.type.LatLng", "google/type/latlng.proto"], + ["google.type.Money", "google/type/money.proto"], + ["google.protobuf.DoubleValue", "google/protobuf/wrappers.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 Talent + module V4beta1 + TimestampRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.TimestampRange").msgclass + Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Location").msgclass + Location::LocationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Location.LocationType").enummodule + RequestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.RequestMetadata").msgclass + ResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ResponseMetadata").msgclass + DeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeviceInfo").msgclass + DeviceInfo::DeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeviceInfo.DeviceType").enummodule + CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CustomAttribute").msgclass + SpellingCorrection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SpellingCorrection").msgclass + CompensationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo").msgclass + CompensationInfo::CompensationEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry").msgclass + CompensationInfo::CompensationRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationRange").msgclass + CompensationInfo::CompensationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationType").enummodule + CompensationInfo::CompensationUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit").enummodule + BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchOperationMetadata").msgclass + BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchOperationMetadata.State").enummodule + CompanySize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompanySize").enummodule + JobBenefit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobBenefit").enummodule + DegreeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DegreeType").enummodule + EmploymentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.EmploymentType").enummodule + JobLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobLevel").enummodule + JobCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobCategory").enummodule + PostingRegion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.PostingRegion").enummodule + Visibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Visibility").enummodule + HtmlSanitization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.HtmlSanitization").enummodule + CommuteMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CommuteMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb new file mode 100644 index 000000000000..2201405030f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/company.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4beta1/common_pb' + + +descriptor_data = "\n)google/cloud/talent/v4beta1/company.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\"\x80\x05\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x65xternal_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x04size\x18\x04 \x01(\x0e\x32(.google.cloud.talent.v4beta1.CompanySize\x12\x1c\n\x14headquarters_address\x18\x05 \x01(\t\x12\x15\n\rhiring_agency\x18\x06 \x01(\x08\x12\x10\n\x08\x65\x65o_text\x18\x07 \x01(\t\x12\x13\n\x0bwebsite_uri\x18\x08 \x01(\t\x12\x17\n\x0f\x63\x61reer_site_uri\x18\t \x01(\t\x12\x11\n\timage_uri\x18\n \x01(\t\x12\x34\n(keyword_searchable_job_custom_attributes\x18\x0b \x03(\tB\x02\x18\x01\x12K\n\x0c\x64\x65rived_info\x18\x0c \x01(\x0b\x32\x30.google.cloud.talent.v4beta1.Company.DerivedInfoB\x03\xe0\x41\x03\x12\x16\n\tsuspended\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x1aS\n\x0b\x44\x65rivedInfo\x12\x44\n\x15headquarters_location\x18\x01 \x01(\x0b\x32%.google.cloud.talent.v4beta1.Location:\x81\x01\xea\x41~\n\x1bjobs.googleapis.com/Company\x12\x37projects/{project}/tenants/{tenant}/companies/{company}\x12&projects/{project}/companies/{company}Bx\n\x1f\x63om.google.cloud.talent.v4beta1B\x14\x43ompanyResourceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Location", "google/cloud/talent/v4beta1/common.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 Talent + module V4beta1 + Company = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company").msgclass + Company::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company.DerivedInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb new file mode 100644 index 000000000000..4478c38d82e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/company_service/credentials" +require "google/cloud/talent/v4beta1/company_service/paths" +require "google/cloud/talent/v4beta1/company_service/client" +require "google/cloud/talent/v4beta1/company_service/rest" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service that handles company management, including CRUD and enumeration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4beta1/company_service" + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4beta1/company_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + module CompanyService + end + end + end + end +end + +helper_path = ::File.join __dir__, "company_service", "helpers.rb" +require "google/cloud/talent/v4beta1/company_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb new file mode 100644 index 000000000000..9763c82b34b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb @@ -0,0 +1,920 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module CompanyService + ## + # Client for the CompanyService service. + # + # A service that handles company management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :company_service_stub + + ## + # Configure the CompanyService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::CompanyService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompanyService clients + # ::Google::Cloud::Talent::V4beta1::CompanyService::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", "Talent", "V4beta1"] + 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_company.timeout = 30.0 + + default_config.rpcs.get_company.timeout = 30.0 + default_config.rpcs.get_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_company.timeout = 30.0 + + default_config.rpcs.delete_company.timeout = 30.0 + default_config.rpcs.delete_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_companies.timeout = 30.0 + default_config.rpcs.list_companies.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompanyService 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::Talent::V4beta1::CompanyService::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 + @company_service_stub.universe_domain + end + + ## + # Create a new CompanyService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompanyService 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/talent/v4beta1/company_service_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 + + @company_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4beta1::CompanyService::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, + logger: @config.logger + ) + + @company_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @company_service_stub.logger + end + + # Service calls + + ## + # Creates a new company entity. + # + # @overload create_company(request, options = nil) + # Pass arguments to `create_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) + # Pass arguments to `create_company` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created, for example, "projects/foo". + # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] + # Required. The company to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new + # + # # Call the create_company method. + # result = client.create_company request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + # p result + # + def create_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :create_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified company. + # + # @overload get_company(request, options = nil) + # Pass arguments to `get_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::GetCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `get_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/api-test-project/companies/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new + # + # # Call the get_company method. + # result = client.get_company request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + # p result + # + def get_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :get_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified company. + # + # @overload update_company(request, options = nil) + # Pass arguments to `update_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) + # Pass arguments to `update_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] + # Required. The company resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are + # updated. Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Company Company} are + # supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Company] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new + # + # # Call the update_company method. + # result = client.update_company request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + # p result + # + def update_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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.company&.name + header_params["company.name"] = request.company.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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :update_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified company. + # Prerequisite: The company has no jobs associated with it. + # + # @overload delete_company(request, options = nil) + # Pass arguments to `delete_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `delete_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo/companies/bar". + # + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new + # + # # Call the delete_company method. + # result = client.delete_company request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :delete_company, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all companies associated with the project. + # + # @overload list_companies(request, options = nil) + # Pass arguments to `list_companies` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) + # Pass arguments to `list_companies` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". + # + # If tenant id is unspecified, the default tenant will be used, for + # example, "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @param require_open_jobs [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new + # + # # Call the list_companies method. + # result = client.list_companies 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::Talent::V4beta1::Company. + # p item + # end + # + def list_companies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest + + # Converts hash 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_companies.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::Talent::V4beta1::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_companies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_companies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.call_rpc :list_companies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @company_service_stub, :list_companies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CompanyService API. + # + # This class represents the configuration for CompanyService, + # 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::Talent::V4beta1::CompanyService::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_company to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::CompanyService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CompanyService 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_company` + # @return [::Gapic::Config::Method] + # + attr_reader :create_company + ## + # RPC-specific configuration for `get_company` + # @return [::Gapic::Config::Method] + # + attr_reader :get_company + ## + # RPC-specific configuration for `update_company` + # @return [::Gapic::Config::Method] + # + attr_reader :update_company + ## + # RPC-specific configuration for `delete_company` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_company + ## + # RPC-specific configuration for `list_companies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_companies + + # @private + def initialize parent_rpcs = nil + create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company + @create_company = ::Gapic::Config::Method.new create_company_config + get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company + @get_company = ::Gapic::Config::Method.new get_company_config + update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company + @update_company = ::Gapic::Config::Method.new update_company_config + delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company + @delete_company = ::Gapic::Config::Method.new delete_company_config + list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies + @list_companies = ::Gapic::Config::Method.new list_companies_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb new file mode 100644 index 000000000000..9856588eab54 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module CompanyService + # Credentials for the CompanyService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb new file mode 100644 index 000000000000..dee2daa131de --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module CompanyService + # Path helper methods for the CompanyService API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # @overload company_path(project:, tenant:, company:) + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @overload company_path(project:, company:) + # The resource will be in the following format: + # + # `projects/{project}/companies/{company}` + # + # @param project [String] + # @param company [String] + # + # @return [::String] + def company_path **args + resources = { + "company:project:tenant" => (proc do |project:, tenant:, company:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end), + "company:project" => (proc do |project:, company:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/companies/#{company}" + 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 Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb new file mode 100644 index 000000000000..e0bde75185ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/company_service/credentials" +require "google/cloud/talent/v4beta1/company_service/paths" +require "google/cloud/talent/v4beta1/company_service/rest/client" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service that handles company management, including CRUD and enumeration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4beta1/company_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + module CompanyService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4beta1/company_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb new file mode 100644 index 000000000000..df00c372ce9f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb @@ -0,0 +1,842 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" +require "google/cloud/talent/v4beta1/company_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4beta1 + module CompanyService + module Rest + ## + # REST client for the CompanyService service. + # + # A service that handles company management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :company_service_stub + + ## + # Configure the CompanyService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CompanyService clients + # ::Google::Cloud::Talent::V4beta1::CompanyService::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", "Talent", "V4beta1"] + 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_company.timeout = 30.0 + + default_config.rpcs.get_company.timeout = 30.0 + default_config.rpcs.get_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_company.timeout = 30.0 + + default_config.rpcs.delete_company.timeout = 30.0 + default_config.rpcs.delete_company.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_companies.timeout = 30.0 + default_config.rpcs.list_companies.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CompanyService 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::Talent::V4beta1::CompanyService::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 + @company_service_stub.universe_domain + end + + ## + # Create a new CompanyService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CompanyService 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 + + @company_service_stub = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @company_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @company_service_stub.logger + end + + # Service calls + + ## + # Creates a new company entity. + # + # @overload create_company(request, options = nil) + # Pass arguments to `create_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) + # Pass arguments to `create_company` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created, for example, "projects/foo". + # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] + # Required. The company to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new + # + # # Call the create_company method. + # result = client.create_company request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + # p result + # + def create_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.create_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified company. + # + # @overload get_company(request, options = nil) + # Pass arguments to `get_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::GetCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `get_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/api-test-project/companies/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new + # + # # Call the get_company method. + # result = client.get_company request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + # p result + # + def get_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.get_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified company. + # + # @overload update_company(request, options = nil) + # Pass arguments to `update_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) + # Pass arguments to `update_company` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] + # Required. The company resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are + # updated. Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Company Company} are + # supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new + # + # # Call the update_company method. + # result = client.update_company request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + # p result + # + def update_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.update_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified company. + # Prerequisite: The company has no jobs associated with it. + # + # @overload delete_company(request, options = nil) + # Pass arguments to `delete_company` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_company(name: nil) + # Pass arguments to `delete_company` via keyword arguments. Note that at + # least one keyword argument is 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 company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo/companies/bar". + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new + # + # # Call the delete_company method. + # result = client.delete_company request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_company request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest + + # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_company.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.delete_company request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all companies associated with the project. + # + # @overload list_companies(request, options = nil) + # Pass arguments to `list_companies` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) + # Pass arguments to `list_companies` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". + # + # If tenant id is unspecified, the default tenant will be used, for + # example, "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @param require_open_jobs [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new + # + # # Call the list_companies method. + # result = client.list_companies 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::Talent::V4beta1::Company. + # p item + # end + # + def list_companies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest + + # Converts hash 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_companies.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::Talent::V4beta1::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_companies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_companies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @company_service_stub.list_companies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CompanyService REST API. + # + # This class represents the configuration for CompanyService 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::Talent::V4beta1::CompanyService::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_company to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_company.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CompanyService 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_company` + # @return [::Gapic::Config::Method] + # + attr_reader :create_company + ## + # RPC-specific configuration for `get_company` + # @return [::Gapic::Config::Method] + # + attr_reader :get_company + ## + # RPC-specific configuration for `update_company` + # @return [::Gapic::Config::Method] + # + attr_reader :update_company + ## + # RPC-specific configuration for `delete_company` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_company + ## + # RPC-specific configuration for `list_companies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_companies + + # @private + def initialize parent_rpcs = nil + create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company + @create_company = ::Gapic::Config::Method.new create_company_config + get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company + @get_company = ::Gapic::Config::Method.new get_company_config + update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company + @update_company = ::Gapic::Config::Method.new update_company_config + delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company + @delete_company = ::Gapic::Config::Method.new delete_company_config + list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies + @list_companies = ::Gapic::Config::Method.new list_companies_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb new file mode 100644 index 000000000000..34eb591b219f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb @@ -0,0 +1,425 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module CompanyService + module Rest + ## + # REST service stub for the CompanyService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest] + # 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::Talent::V4beta1::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # A result object deserialized from the server's reply + def create_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_company_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, + method_name: "create_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::GetCompanyRequest] + # 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::Talent::V4beta1::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # A result object deserialized from the server's reply + def get_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_company_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, + method_name: "get_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest] + # 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::Talent::V4beta1::Company] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Company] + # A result object deserialized from the server's reply + def update_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_company_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, + method_name: "update_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest] + # 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_company request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_company_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, + method_name: "delete_company", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_companies REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest] + # 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::Talent::V4beta1::ListCompaniesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::ListCompaniesResponse] + # A result object deserialized from the server's reply + def list_companies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_companies_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, + method_name: "list_companies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/companies", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/companies", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::GetCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v4beta1/{company.name}", + body: "*", + matches: [ + ["company.name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v4beta1/{company.name}", + body: "*", + matches: [ + ["company.name", %r{^projects/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_company REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest] + # 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_company_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/companies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_companies REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest] + # 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_companies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{parent}/companies", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{parent}/companies", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb new file mode 100644 index 000000000000..8297b6a2911e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/company_service.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/talent/v4beta1/common_pb' +require 'google/cloud/talent/v4beta1/company_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n1google/cloud/talent/v4beta1/company_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a)google/cloud/talent/v4beta1/company.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x87\x01\n\x14\x43reateCompanyRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12:\n\x07\x63ompany\x18\x02 \x01(\x0b\x32$.google.cloud.talent.v4beta1.CompanyB\x03\xe0\x41\x02\"F\n\x11GetCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x83\x01\n\x14UpdateCompanyRequest\x12:\n\x07\x63ompany\x18\x01 \x01(\x0b\x32$.google.cloud.talent.v4beta1.CompanyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x14\x44\x65leteCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x8d\x01\n\x14ListCompaniesRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x19\n\x11require_open_jobs\x18\x04 \x01(\x08\"\xaa\x01\n\x15ListCompaniesResponse\x12\x37\n\tcompanies\x18\x01 \x03(\x0b\x32$.google.cloud.talent.v4beta1.Company\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata2\xd2\t\n\x0e\x43ompanyService\x12\xe3\x01\n\rCreateCompany\x12\x31.google.cloud.talent.v4beta1.CreateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"y\xda\x41\x0eparent,company\x82\xd3\xe4\x93\x02\x62\"0/v4beta1/{parent=projects/*/tenants/*}/companies:\x01*Z+\"&/v4beta1/{parent=projects/*}/companies:\x01*\x12\xcd\x01\n\nGetCompany\x12..google.cloud.talent.v4beta1.GetCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{name=projects/*/tenants/*/companies/*}Z(\x12&/v4beta1/{name=projects/*/companies/*}\x12\xed\x01\n\rUpdateCompany\x12\x31.google.cloud.talent.v4beta1.UpdateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"\x82\x01\xda\x41\x07\x63ompany\x82\xd3\xe4\x93\x02r28/v4beta1/{company.name=projects/*/tenants/*/companies/*}:\x01*Z32./v4beta1/{company.name=projects/*/companies/*}:\x01*\x12\xc5\x01\n\rDeleteCompany\x12\x31.google.cloud.talent.v4beta1.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\*0/v4beta1/{name=projects/*/tenants/*/companies/*}Z(*&/v4beta1/{name=projects/*/companies/*}\x12\xe3\x01\n\rListCompanies\x12\x31.google.cloud.talent.v4beta1.ListCompaniesRequest\x1a\x32.google.cloud.talent.v4beta1.ListCompaniesResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{parent=projects/*/tenants/*}/companiesZ(\x12&/v4beta1/{parent=projects/*}/companies\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBw\n\x1f\x63om.google.cloud.talent.v4beta1B\x13\x43ompanyServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Company", "google/cloud/talent/v4beta1/company.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.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 Talent + module V4beta1 + CreateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateCompanyRequest").msgclass + GetCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetCompanyRequest").msgclass + UpdateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateCompanyRequest").msgclass + DeleteCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteCompanyRequest").msgclass + ListCompaniesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesRequest").msgclass + ListCompaniesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb new file mode 100644 index 000000000000..1ca2bca7f790 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4beta1/company_service.proto for package 'google.cloud.talent.v4beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4beta1/company_service_pb' + +module Google + module Cloud + module Talent + module V4beta1 + module CompanyService + # A service that handles company management, including CRUD and enumeration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4beta1.CompanyService' + + # Creates a new company entity. + rpc :CreateCompany, ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company + # Retrieves specified company. + rpc :GetCompany, ::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company + # Updates specified company. + rpc :UpdateCompany, ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company + # Deletes specified company. + # Prerequisite: The company has no jobs associated with it. + rpc :DeleteCompany, ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Google::Protobuf::Empty + # Lists all companies associated with the project. + rpc :ListCompanies, ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb new file mode 100644 index 000000000000..962a8cd878ed --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/completion/credentials" +require "google/cloud/talent/v4beta1/completion/paths" +require "google/cloud/talent/v4beta1/completion/client" +require "google/cloud/talent/v4beta1/completion/rest" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service handles auto completion. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4beta1/completion" + # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4beta1/completion/rest" + # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new + # + module Completion + end + end + end + end +end + +helper_path = ::File.join __dir__, "completion", "helpers.rb" +require "google/cloud/talent/v4beta1/completion/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb new file mode 100644 index 000000000000..8823298d5537 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb @@ -0,0 +1,516 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module Completion + ## + # Client for the Completion service. + # + # A service handles auto completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_stub + + ## + # Configure the Completion Client class. + # + # See {::Google::Cloud::Talent::V4beta1::Completion::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Completion clients + # ::Google::Cloud::Talent::V4beta1::Completion::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", "Talent", "V4beta1"] + 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.complete_query.timeout = 30.0 + default_config.rpcs.complete_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Completion 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::Talent::V4beta1::Completion::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 + @completion_stub.universe_domain + end + + ## + # Create a new Completion client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Completion 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/talent/v4beta1/completion_service_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 + + @completion_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4beta1::Completion::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, + logger: @config.logger + ) + + @completion_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @completion_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload complete_query(parent: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo". + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param language_codes [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @param page_size [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @param company [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo". + # @param scope [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @param type [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::Completion::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest + + # Converts hash 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.complete_query.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::Talent::V4beta1::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.complete_query.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_stub.call_rpc :complete_query, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Completion API. + # + # This class represents the configuration for Completion, + # 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::Talent::V4beta1::Completion::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 + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::Completion::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 Completion 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 `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb new file mode 100644 index 000000000000..1ad8d592642a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module Completion + # Credentials for the Completion API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb new file mode 100644 index 000000000000..119c1f449fff --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module Completion + # Path helper methods for the Completion API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # @overload company_path(project:, tenant:, company:) + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @overload company_path(project:, company:) + # The resource will be in the following format: + # + # `projects/{project}/companies/{company}` + # + # @param project [String] + # @param company [String] + # + # @return [::String] + def company_path **args + resources = { + "company:project:tenant" => (proc do |project:, tenant:, company:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end), + "company:project" => (proc do |project:, company:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/companies/#{company}" + 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 Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb new file mode 100644 index 000000000000..d14c1d1d8a77 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/completion/credentials" +require "google/cloud/talent/v4beta1/completion/paths" +require "google/cloud/talent/v4beta1/completion/rest/client" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service handles auto completion. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4beta1/completion/rest" + # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new + # + module Completion + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4beta1/completion/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb new file mode 100644 index 000000000000..88bd8c435600 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb @@ -0,0 +1,466 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" +require "google/cloud/talent/v4beta1/completion/rest/service_stub" + +module Google + module Cloud + module Talent + module V4beta1 + module Completion + module Rest + ## + # REST client for the Completion service. + # + # A service handles auto completion. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :completion_stub + + ## + # Configure the Completion Client class. + # + # See {::Google::Cloud::Talent::V4beta1::Completion::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Completion clients + # ::Google::Cloud::Talent::V4beta1::Completion::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", "Talent", "V4beta1"] + 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.complete_query.timeout = 30.0 + default_config.rpcs.complete_query.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Completion 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::Talent::V4beta1::Completion::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 + @completion_stub.universe_domain + end + + ## + # Create a new Completion REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Completion 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 + + @completion_stub = ::Google::Cloud::Talent::V4beta1::Completion::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @completion_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @completion_stub.logger + end + + # Service calls + + ## + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + # + # @overload complete_query(request, options = nil) + # Pass arguments to `complete_query` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload complete_query(parent: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) + # Pass arguments to `complete_query` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo". + # @param query [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @param language_codes [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @param page_size [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @param company [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo". + # @param scope [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @param type [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new + # + # # Call the complete_query method. + # result = client.complete_query request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. + # p result + # + def complete_query request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest + + # Converts hash 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.complete_query.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::Talent::V4beta1::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.complete_query.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_query.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @completion_stub.complete_query request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Completion REST API. + # + # This class represents the configuration for Completion 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::Talent::V4beta1::Completion::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 + # # complete_query to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.complete_query.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 Completion 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 `complete_query` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_query + + # @private + def initialize parent_rpcs = nil + complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query + @complete_query = ::Gapic::Config::Method.new complete_query_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb new file mode 100644 index 000000000000..c6c52bc71a69 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module Completion + module Rest + ## + # REST service stub for the Completion service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the complete_query REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest] + # 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::Talent::V4beta1::CompleteQueryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] + # A result object deserialized from the server's reply + def complete_query request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_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, + method_name: "complete_query", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the complete_query REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_complete_query_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{parent}:complete", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{parent}:complete", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb new file mode 100644 index 000000000000..672958f7e967 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/completion_service.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/talent/v4beta1/common_pb' + + +descriptor_data = "\n4google/cloud/talent/v4beta1/completion_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\"\x93\x04\n\x14\x43ompleteQueryRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12P\n\x05scope\x18\x06 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope\x12N\n\x04type\x18\x07 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType\"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02\"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03\"\xc5\x02\n\x15\x43ompleteQueryResponse\x12_\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult\x12?\n\x08metadata\x18\x02 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x1a\x89\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12N\n\x04type\x18\x02 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xd5\x02\n\nCompletion\x12\xd8\x01\n\rCompleteQuery\x12\x31.google.cloud.talent.v4beta1.CompleteQueryRequest\x1a\x32.google.cloud.talent.v4beta1.CompleteQueryResponse\"`\x82\xd3\xe4\x93\x02Z\x12//v4beta1/{parent=projects/*/tenants/*}:completeZ\'\x12%/v4beta1/{parent=projects/*}:complete\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBz\n\x1f\x63om.google.cloud.talent.v4beta1B\x16\x43ompletionServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.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 Talent + module V4beta1 + CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest").msgclass + CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope").enummodule + CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType").enummodule + CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryResponse").msgclass + CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb new file mode 100644 index 000000000000..cb146eb364f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb @@ -0,0 +1,46 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4beta1/completion_service.proto for package 'google.cloud.talent.v4beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4beta1/completion_service_pb' + +module Google + module Cloud + module Talent + module V4beta1 + module Completion + # A service handles auto completion. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4beta1.Completion' + + # Completes the specified prefix with keyword suggestions. + # Intended for use by a job search auto-complete search box. + rpc :CompleteQuery, ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb new file mode 100644 index 000000000000..a8549bc825db --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\'google/cloud/talent/v4beta1/event.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc8\x01\n\x0b\x43lientEvent\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12:\n\tjob_event\x18\x05 \x01(\x0b\x32%.google.cloud.talent.v4beta1.JobEventH\x00\x12\x13\n\x0b\x65vent_notes\x18\t \x01(\tB\x07\n\x05\x65vent\"\xf6\x03\n\x08JobEvent\x12\x45\n\x04type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.JobEvent.JobEventTypeB\x03\xe0\x41\x02\x12\x11\n\x04jobs\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x0f\n\x07profile\x18\x03 \x01(\t\"\xfe\x02\n\x0cJobEventType\x12\x1e\n\x1aJOB_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x11\n\rVIEW_REDIRECT\x10\x03\x12\x15\n\x11\x41PPLICATION_START\x10\x04\x12\x16\n\x12\x41PPLICATION_FINISH\x10\x05\x12 \n\x1c\x41PPLICATION_QUICK_SUBMISSION\x10\x06\x12\x18\n\x14\x41PPLICATION_REDIRECT\x10\x07\x12!\n\x1d\x41PPLICATION_START_FROM_SEARCH\x10\x08\x12$\n APPLICATION_REDIRECT_FROM_SEARCH\x10\t\x12\x1e\n\x1a\x41PPLICATION_COMPANY_SUBMIT\x10\n\x12\x0c\n\x08\x42OOKMARK\x10\x0b\x12\x10\n\x0cNOTIFICATION\x10\x0c\x12\t\n\x05HIRED\x10\r\x12\x0b\n\x07SENT_CV\x10\x0e\x12\x15\n\x11INTERVIEW_GRANTED\x10\x0f\x42n\n\x1f\x63om.google.cloud.talent.v4beta1B\nEventProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 Talent + module V4beta1 + ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ClientEvent").msgclass + JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobEvent").msgclass + JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobEvent.JobEventType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb new file mode 100644 index 000000000000..b3704c176961 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/event_service/credentials" +require "google/cloud/talent/v4beta1/event_service/paths" +require "google/cloud/talent/v4beta1/event_service/client" +require "google/cloud/talent/v4beta1/event_service/rest" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service handles client event report. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4beta1/event_service" + # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4beta1/event_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new + # + module EventService + end + end + end + end +end + +helper_path = ::File.join __dir__, "event_service", "helpers.rb" +require "google/cloud/talent/v4beta1/event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb new file mode 100644 index 000000000000..d94cdcbc9010 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb @@ -0,0 +1,489 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module EventService + ## + # Client for the EventService service. + # + # A service handles client event report. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :event_service_stub + + ## + # Configure the EventService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::EventService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EventService clients + # ::Google::Cloud::Talent::V4beta1::EventService::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", "Talent", "V4beta1"] + 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_client_event.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EventService 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::Talent::V4beta1::EventService::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 + @event_service_stub.universe_domain + end + + ## + # Create a new EventService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EventService 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/talent/v4beta1/event_service_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 + + @event_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4beta1::EventService::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, + logger: @config.logger + ) + + @event_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @event_service_stub.logger + end + + # Service calls + + ## + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + # + # @overload create_client_event(request, options = nil) + # Pass arguments to `create_client_event` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateClientEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) + # Pass arguments to `create_client_event` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created, for example, "projects/foo". + # @param client_event [::Google::Cloud::Talent::V4beta1::ClientEvent, ::Hash] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::ClientEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::EventService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new + # + # # Call the create_client_event method. + # result = client.create_client_event request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. + # p result + # + def create_client_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest + + # Converts hash 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_client_event.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::Talent::V4beta1::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_client_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_client_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @event_service_stub.call_rpc :create_client_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EventService API. + # + # This class represents the configuration for EventService, + # 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::Talent::V4beta1::EventService::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_client_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::EventService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 EventService 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_client_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_client_event + + # @private + def initialize parent_rpcs = nil + create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event + @create_client_event = ::Gapic::Config::Method.new create_client_event_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb new file mode 100644 index 000000000000..052cdab2a579 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module EventService + # Credentials for the EventService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb new file mode 100644 index 000000000000..a4194eda5367 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module EventService + # Path helper methods for the EventService API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb new file mode 100644 index 000000000000..5239cc30ff54 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/event_service/credentials" +require "google/cloud/talent/v4beta1/event_service/paths" +require "google/cloud/talent/v4beta1/event_service/rest/client" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service handles client event report. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4beta1/event_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new + # + module EventService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4beta1/event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb new file mode 100644 index 000000000000..ceb888dfea87 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb @@ -0,0 +1,439 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" +require "google/cloud/talent/v4beta1/event_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4beta1 + module EventService + module Rest + ## + # REST client for the EventService service. + # + # A service handles client event report. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :event_service_stub + + ## + # Configure the EventService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::EventService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EventService clients + # ::Google::Cloud::Talent::V4beta1::EventService::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", "Talent", "V4beta1"] + 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_client_event.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EventService 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::Talent::V4beta1::EventService::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 + @event_service_stub.universe_domain + end + + ## + # Create a new EventService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EventService 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 + + @event_service_stub = ::Google::Cloud::Talent::V4beta1::EventService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @event_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @event_service_stub.logger + end + + # Service calls + + ## + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + # + # @overload create_client_event(request, options = nil) + # Pass arguments to `create_client_event` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateClientEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) + # Pass arguments to `create_client_event` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created, for example, "projects/foo". + # @param client_event [::Google::Cloud::Talent::V4beta1::ClientEvent, ::Hash] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::ClientEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new + # + # # Call the create_client_event method. + # result = client.create_client_event request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. + # p result + # + def create_client_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest + + # Converts hash 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_client_event.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::Talent::V4beta1::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_client_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_client_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @event_service_stub.create_client_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the EventService REST API. + # + # This class represents the configuration for EventService 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::Talent::V4beta1::EventService::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_client_event to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_client_event.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 EventService 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_client_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_client_event + + # @private + def initialize parent_rpcs = nil + create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event + @create_client_event = ::Gapic::Config::Method.new create_client_event_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb new file mode 100644 index 000000000000..0cc940fc633c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module EventService + module Rest + ## + # REST service stub for the EventService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_client_event REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest] + # 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::Talent::V4beta1::ClientEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] + # A result object deserialized from the server's reply + def create_client_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_client_event_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, + method_name: "create_client_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ClientEvent.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_client_event REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest] + # 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_client_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/clientEvents", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/clientEvents", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb new file mode 100644 index 000000000000..708fe89b9de8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/event_service.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/talent/v4beta1/event_pb' + + +descriptor_data = "\n/google/cloud/talent/v4beta1/event_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/talent/v4beta1/event.proto\"\x94\x01\n\x18\x43reateClientEventRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12\x43\n\x0c\x63lient_event\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4beta1.ClientEventB\x03\xe0\x41\x02\x32\xfa\x02\n\x0c\x45ventService\x12\xfb\x01\n\x11\x43reateClientEvent\x12\x35.google.cloud.talent.v4beta1.CreateClientEventRequest\x1a(.google.cloud.talent.v4beta1.ClientEvent\"\x84\x01\xda\x41\x13parent,client_event\x82\xd3\xe4\x93\x02h\"3/v4beta1/{parent=projects/*/tenants/*}/clientEvents:\x01*Z.\")/v4beta1/{parent=projects/*}/clientEvents:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBu\n\x1f\x63om.google.cloud.talent.v4beta1B\x11\x45ventServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.ClientEvent", "google/cloud/talent/v4beta1/event.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 Talent + module V4beta1 + CreateClientEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateClientEventRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb new file mode 100644 index 000000000000..d4e95cc457ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4beta1/event_service.proto for package 'google.cloud.talent.v4beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4beta1/event_service_pb' + +module Google + module Cloud + module Talent + module V4beta1 + module EventService + # A service handles client event report. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4beta1.EventService' + + # Report events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. You may inspect the created events in + # [self service + # tools](https://console.cloud.google.com/talent-solution/overview). + # [Learn + # more](https://cloud.google.com/talent-solution/docs/management-tools) + # about self service tools. + rpc :CreateClientEvent, ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Google::Cloud::Talent::V4beta1::ClientEvent + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb new file mode 100644 index 000000000000..acd792c42ff1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/filters.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/talent/v4beta1/common_pb' +require 'google/protobuf/duration_pb' +require 'google/type/latlng_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n)google/cloud/talent/v4beta1/filters.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x18google/type/latlng.proto\x1a\x1bgoogle/type/timeofday.proto\"\x80\x05\n\x08JobQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x1b\n\x13query_language_code\x18\x0e \x01(\t\x12\x11\n\tcompanies\x18\x02 \x03(\t\x12\x45\n\x10location_filters\x18\x03 \x03(\x0b\x32+.google.cloud.talent.v4beta1.LocationFilter\x12@\n\x0ejob_categories\x18\x04 \x03(\x0e\x32(.google.cloud.talent.v4beta1.JobCategory\x12\x42\n\x0e\x63ommute_filter\x18\x05 \x01(\x0b\x32*.google.cloud.talent.v4beta1.CommuteFilter\x12\x1d\n\x15\x63ompany_display_names\x18\x06 \x03(\t\x12L\n\x13\x63ompensation_filter\x18\x07 \x01(\x0b\x32/.google.cloud.talent.v4beta1.CompensationFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x08 \x01(\t\x12\x1b\n\x13\x64isable_spell_check\x18\t \x01(\x08\x12\x45\n\x10\x65mployment_types\x18\n \x03(\x0e\x32+.google.cloud.talent.v4beta1.EmploymentType\x12\x16\n\x0elanguage_codes\x18\x0b \x03(\t\x12G\n\x12publish_time_range\x18\x0c \x01(\x0b\x32+.google.cloud.talent.v4beta1.TimestampRange\x12\x15\n\rexcluded_jobs\x18\r \x03(\t\"\x83\x03\n\x0eLocationFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x19\n\x11\x64istance_in_miles\x18\x04 \x01(\x01\x12\x61\n\x16telecommute_preference\x18\x05 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference\x12\x0f\n\x07negated\x18\x06 \x01(\x08\"\x95\x01\n\x15TelecommutePreference\x12&\n\"TELECOMMUTE_PREFERENCE_UNSPECIFIED\x10\x00\x12\x1c\n\x14TELECOMMUTE_EXCLUDED\x10\x01\x1a\x02\x08\x01\x12\x17\n\x13TELECOMMUTE_ALLOWED\x10\x02\x12\x1d\n\x19TELECOMMUTE_JOBS_EXCLUDED\x10\x03\"\xca\x03\n\x12\x43ompensationFilter\x12M\n\x04type\x18\x01 \x01(\x0e\x32:.google.cloud.talent.v4beta1.CompensationFilter.FilterTypeB\x03\xe0\x41\x02\x12R\n\x05units\x18\x02 \x03(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnitB\x03\xe0\x41\x02\x12N\n\x05range\x18\x03 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange\x12\x38\n0include_jobs_with_unspecified_compensation_range\x18\x04 \x01(\x08\"\x86\x01\n\nFilterType\x12\x1b\n\x17\x46ILTER_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tUNIT_ONLY\x10\x01\x12\x13\n\x0fUNIT_AND_AMOUNT\x10\x02\x12\x1a\n\x16\x41NNUALIZED_BASE_AMOUNT\x10\x03\x12\x1b\n\x17\x41NNUALIZED_TOTAL_AMOUNT\x10\x04\"\xcb\x03\n\rCommuteFilter\x12G\n\x0e\x63ommute_method\x18\x01 \x01(\x0e\x32*.google.cloud.talent.v4beta1.CommuteMethodB\x03\xe0\x41\x02\x12\x33\n\x11start_coordinates\x18\x02 \x01(\x0b\x32\x13.google.type.LatLngB\x03\xe0\x41\x02\x12\x37\n\x0ftravel_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12!\n\x19\x61llow_imprecise_addresses\x18\x04 \x01(\x08\x12N\n\x0croad_traffic\x18\x05 \x01(\x0e\x32\x36.google.cloud.talent.v4beta1.CommuteFilter.RoadTrafficH\x00\x12\x30\n\x0e\x64\x65parture_time\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00\"L\n\x0bRoadTraffic\x12\x1c\n\x18ROAD_TRAFFIC_UNSPECIFIED\x10\x00\x12\x10\n\x0cTRAFFIC_FREE\x10\x01\x12\r\n\tBUSY_HOUR\x10\x02\x42\x10\n\x0etraffic_optionBp\n\x1f\x63om.google.cloud.talent.v4beta1B\x0c\x46iltersProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.TimestampRange", "google/cloud/talent/v4beta1/common.proto"], + ["google.type.LatLng", "google/type/latlng.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.type.TimeOfDay", "google/type/timeofday.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 Talent + module V4beta1 + JobQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobQuery").msgclass + LocationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.LocationFilter").msgclass + LocationFilter::TelecommutePreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference").enummodule + CompensationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationFilter").msgclass + CompensationFilter::FilterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationFilter.FilterType").enummodule + CommuteFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CommuteFilter").msgclass + CommuteFilter::RoadTraffic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb new file mode 100644 index 000000000000..5e0b5ae20689 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/histogram.proto + +require 'google/protobuf' + + +descriptor_data = "\n+google/cloud/talent/v4beta1/histogram.proto\x12\x1bgoogle.cloud.talent.v4beta1\")\n\x0eHistogramQuery\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\"\xb6\x01\n\x14HistogramQueryResult\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\x12S\n\thistogram\x18\x02 \x03(\x0b\x32@.google.cloud.talent.v4beta1.HistogramQueryResult.HistogramEntry\x1a\x30\n\x0eHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42r\n\x1f\x63om.google.cloud.talent.v4beta1B\x0eHistogramProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ + ] + 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 Talent + module V4beta1 + HistogramQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.HistogramQuery").msgclass + HistogramQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.HistogramQueryResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb new file mode 100644 index 000000000000..c20d962040c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/talent/v4beta1/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n%google/cloud/talent/v4beta1/job.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe0\x0f\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x07\x63ompany\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12\x1b\n\x0erequisition_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\taddresses\x18\x06 \x03(\t\x12J\n\x10\x61pplication_info\x18\x07 \x01(\x0b\x32\x30.google.cloud.talent.v4beta1.Job.ApplicationInfo\x12=\n\x0cjob_benefits\x18\x08 \x03(\x0e\x32\'.google.cloud.talent.v4beta1.JobBenefit\x12H\n\x11\x63ompensation_info\x18\t \x01(\x0b\x32-.google.cloud.talent.v4beta1.CompensationInfo\x12Q\n\x11\x63ustom_attributes\x18\n \x03(\x0b\x32\x36.google.cloud.talent.v4beta1.Job.CustomAttributesEntry\x12=\n\x0c\x64\x65gree_types\x18\x0b \x03(\x0e\x32\'.google.cloud.talent.v4beta1.DegreeType\x12\x12\n\ndepartment\x18\x0c \x01(\t\x12\x45\n\x10\x65mployment_types\x18\r \x03(\x0e\x32+.google.cloud.talent.v4beta1.EmploymentType\x12\x12\n\nincentives\x18\x0e \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12\x38\n\tjob_level\x18\x10 \x01(\x0e\x32%.google.cloud.talent.v4beta1.JobLevel\x12\x17\n\x0fpromotion_value\x18\x11 \x01(\x05\x12\x16\n\x0equalifications\x18\x12 \x01(\t\x12\x18\n\x10responsibilities\x18\x13 \x01(\t\x12\x42\n\x0eposting_region\x18\x14 \x01(\x0e\x32*.google.cloud.talent.v4beta1.PostingRegion\x12?\n\nvisibility\x18\x15 \x01(\x0e\x32\'.google.cloud.talent.v4beta1.VisibilityB\x02\x18\x01\x12\x32\n\x0ejob_start_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cjob_end_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14posting_publish_time\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x13posting_expire_time\x18\x19 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x13posting_create_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13posting_update_time\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12!\n\x14\x63ompany_display_name\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12G\n\x0c\x64\x65rived_info\x18\x1d \x01(\x0b\x32,.google.cloud.talent.v4beta1.Job.DerivedInfoB\x03\xe0\x41\x03\x12N\n\x12processing_options\x18\x1e \x01(\x0b\x32\x32.google.cloud.talent.v4beta1.Job.ProcessingOptions\x1a\x44\n\x0f\x41pplicationInfo\x12\x0e\n\x06\x65mails\x18\x01 \x03(\t\x12\x13\n\x0binstruction\x18\x02 \x01(\t\x12\x0c\n\x04uris\x18\x03 \x03(\t\x1a\x89\x01\n\x0b\x44\x65rivedInfo\x12\x38\n\tlocations\x18\x01 \x03(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12@\n\x0ejob_categories\x18\x03 \x03(\x0e\x32(.google.cloud.talent.v4beta1.JobCategory\x1a\x88\x01\n\x11ProcessingOptions\x12)\n!disable_street_address_resolution\x18\x01 \x01(\x08\x12H\n\x11html_sanitization\x18\x02 \x01(\x0e\x32-.google.cloud.talent.v4beta1.HtmlSanitization\x1a\x65\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.talent.v4beta1.CustomAttribute:\x02\x38\x01:k\xea\x41h\n\x17jobs.googleapis.com/Job\x12.projects/{project}/tenants/{tenant}/jobs/{job}\x12\x1dprojects/{project}/jobs/{job}Bt\n\x1f\x63om.google.cloud.talent.v4beta1B\x10JobResourceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.CompensationInfo", "google/cloud/talent/v4beta1/common.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 Talent + module V4beta1 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job").msgclass + Job::ApplicationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job.ApplicationInfo").msgclass + Job::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job.DerivedInfo").msgclass + Job::ProcessingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job.ProcessingOptions").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb new file mode 100644 index 000000000000..e0b6ed615036 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/job_service/credentials" +require "google/cloud/talent/v4beta1/job_service/paths" +require "google/cloud/talent/v4beta1/job_service/operations" +require "google/cloud/talent/v4beta1/job_service/client" +require "google/cloud/talent/v4beta1/job_service/rest" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service handles job management, including job CRUD, enumeration and search. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4beta1/job_service" + # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4beta1/job_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + module JobService + end + end + end + end +end + +helper_path = ::File.join __dir__, "job_service", "helpers.rb" +require "google/cloud/talent/v4beta1/job_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb new file mode 100644 index 000000000000..184abd491294 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb @@ -0,0 +1,2083 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module JobService + ## + # Client for the JobService service. + # + # A service handles job management, including job CRUD, enumeration and search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::JobService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::Talent::V4beta1::JobService::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", "Talent", "V4beta1"] + 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_job.timeout = 30.0 + + default_config.rpcs.batch_create_jobs.timeout = 30.0 + + default_config.rpcs.get_job.timeout = 30.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_job.timeout = 30.0 + + default_config.rpcs.batch_update_jobs.timeout = 30.0 + + default_config.rpcs.delete_job.timeout = 30.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_delete_jobs.timeout = 30.0 + + default_config.rpcs.list_jobs.timeout = 30.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_jobs.timeout = 30.0 + + default_config.rpcs.search_jobs_for_alert.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobService 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::Talent::V4beta1::JobService::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_service_stub.universe_domain + end + + ## + # Create a new JobService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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/talent/v4beta1/job_service_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_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4beta1::JobService::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, + logger: @config.logger + ) + + @job_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4beta1::JobService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) + # Pass arguments to `create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified a default tenant + # is created. For example, "projects/foo". + # @param job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] + # Required. The Job to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateJobRequest + + # Converts hash 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_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::Talent::V4beta1::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_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :create_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch create jobs operation. + # + # @overload batch_create_jobs(request, options = nil) + # Pass arguments to `batch_create_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_create_jobs(parent: nil, jobs: nil) + # Pass arguments to `batch_create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] + # Required. The jobs to be created. + # + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new + # + # # Call the batch_create_jobs method. + # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest + + # Converts hash 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.batch_create_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::Talent::V4beta1::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.batch_create_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_create_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/jobs/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_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_service_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(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 job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] + # Required. The Job to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. + # Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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.job&.name + header_params["job.name"] = request.job.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_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_service_stub.call_rpc :update_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch update jobs operation. + # + # @overload batch_update_jobs(request, options = nil) + # Pass arguments to `batch_update_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) + # Pass arguments to `batch_update_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] + # Required. The jobs to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the + # fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. + # + # If + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4beta1::Job Job} inside + # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4beta1::Job Job} will include all fields, + # which can yield a very large response. + # + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new + # + # # Call the batch_update_jobs method. + # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest + + # Converts hash 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.batch_update_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::Talent::V4beta1::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.batch_update_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_update_jobs, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/jobs/bar". + # + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_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_service_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a list of {::Google::Cloud::Talent::V4beta1::Job Job}s by filter. + # + # @overload batch_delete_jobs(request, options = nil) + # Pass arguments to `batch_delete_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_delete_jobs(parent: nil, filter: nil) + # Pass arguments to `batch_delete_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param filter [::String] + # Required. The filter string specifies the jobs to be deleted. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` (Required) + # * `requisitionId` (Required) + # + # Sample Query: companyName = "projects/foo/companies/bar" AND + # requisitionId = "req-1" + # + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new + # + # # Call the batch_delete_jobs method. + # result = client.batch_delete_jobs request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def batch_delete_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest + + # Converts hash 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.batch_delete_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::Talent::V4beta1::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.batch_delete_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :batch_delete_jobs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists jobs by filter. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param filter [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @param page_token [::String] + # The starting point of a query result. + # @param page_size [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4beta1::ListJobsRequest#job_view job_view} is set + # to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} + # if no value is specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_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_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # + # This call constrains the + # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in + # the database, and only returns jobs that the caller has permission to + # search against. + # + # @overload search_jobs(request, options = nil) + # Pass arguments to `search_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_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 parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param require_precise_result_size [::Boolean] + # This field is deprecated. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, + # for example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for + # example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, + # "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for + # example, "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} + # if no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is + # unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + # + # # Call the search_jobs method. + # result = client.search_jobs request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + # p result + # + def search_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest + + # Converts hash 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.search_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::Talent::V4beta1::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.search_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :search_jobs, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), and has different algorithmic + # adjustments that are targeted to passive job seekers. + # + # This call constrains the + # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in + # the database, and only returns jobs the caller has permission to search + # against. + # + # @overload search_jobs_for_alert(request, options = nil) + # Pass arguments to `search_jobs_for_alert` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param require_precise_result_size [::Boolean] + # This field is deprecated. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, + # for example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for + # example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, + # "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for + # example, "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} + # if no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is + # unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + # + # # Call the search_jobs_for_alert method. + # result = client.search_jobs_for_alert request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + # p result + # + def search_jobs_for_alert request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest + + # Converts hash 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.search_jobs_for_alert.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::Talent::V4beta1::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.search_jobs_for_alert.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.call_rpc :search_jobs_for_alert, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the JobService API. + # + # This class represents the configuration for JobService, + # 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::Talent::V4beta1::JobService::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_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::JobService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 JobService 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_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `batch_create_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `batch_update_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_jobs + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `batch_delete_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_jobs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `search_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs + ## + # RPC-specific configuration for `search_jobs_for_alert` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs_for_alert + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs + @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs + @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs + @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs + @search_jobs = ::Gapic::Config::Method.new search_jobs_config + search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert + @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb new file mode 100644 index 000000000000..b63aa1a22303 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module JobService + # Credentials for the JobService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb new file mode 100644 index 000000000000..ccad6093971e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module JobService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobService 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 JobService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::Talent::V4beta1::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? + throw :response, 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::Talent::V4beta1::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? + throw :response, 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::Talent::V4beta1::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? + 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::Talent::V4beta1::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? + 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::Talent::V4beta1::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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb new file mode 100644 index 000000000000..71e690c1552a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb @@ -0,0 +1,146 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module JobService + # Path helper methods for the JobService API. + module Paths + ## + # Create a fully-qualified Company resource string. + # + # @overload company_path(project:, tenant:, company:) + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/companies/{company}` + # + # @param project [String] + # @param tenant [String] + # @param company [String] + # + # @overload company_path(project:, company:) + # The resource will be in the following format: + # + # `projects/{project}/companies/{company}` + # + # @param project [String] + # @param company [String] + # + # @return [::String] + def company_path **args + resources = { + "company:project:tenant" => (proc do |project:, tenant:, company:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/companies/#{company}" + end), + "company:project" => (proc do |project:, company:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/companies/#{company}" + 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 Job resource string. + # + # @overload job_path(project:, tenant:, job:) + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}/jobs/{job}` + # + # @param project [String] + # @param tenant [String] + # @param job [String] + # + # @overload job_path(project:, job:) + # The resource will be in the following format: + # + # `projects/{project}/jobs/{job}` + # + # @param project [String] + # @param job [String] + # + # @return [::String] + def job_path **args + resources = { + "job:project:tenant" => (proc do |project:, tenant:, job:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}/jobs/#{job}" + end), + "job:project" => (proc do |project:, job:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/jobs/#{job}" + 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 Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb new file mode 100644 index 000000000000..f2f14e59264e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/job_service/credentials" +require "google/cloud/talent/v4beta1/job_service/paths" +require "google/cloud/talent/v4beta1/job_service/rest/operations" +require "google/cloud/talent/v4beta1/job_service/rest/client" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service handles job management, including job CRUD, enumeration and search. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4beta1/job_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + module JobService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4beta1/job_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb new file mode 100644 index 000000000000..3c6fdb997cbc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb @@ -0,0 +1,1970 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" +require "google/cloud/talent/v4beta1/job_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4beta1 + module JobService + module Rest + ## + # REST client for the JobService service. + # + # A service handles job management, including job CRUD, enumeration and search. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :job_service_stub + + ## + # Configure the JobService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::JobService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobService clients + # ::Google::Cloud::Talent::V4beta1::JobService::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", "Talent", "V4beta1"] + 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_job.timeout = 30.0 + + default_config.rpcs.batch_create_jobs.timeout = 30.0 + + default_config.rpcs.get_job.timeout = 30.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_job.timeout = 30.0 + + default_config.rpcs.batch_update_jobs.timeout = 30.0 + + default_config.rpcs.delete_job.timeout = 30.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.batch_delete_jobs.timeout = 30.0 + + default_config.rpcs.list_jobs.timeout = 30.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_jobs.timeout = 30.0 + + default_config.rpcs.search_jobs_for_alert.timeout = 30.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobService 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::Talent::V4beta1::JobService::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_service_stub.universe_domain + end + + ## + # Create a new JobService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobService 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::Talent::V4beta1::JobService::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_service_stub = ::Google::Cloud::Talent::V4beta1::JobService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @job_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Talent::V4beta1::JobService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @job_service_stub.logger + end + + # Service calls + + ## + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) + # Pass arguments to `create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified a default tenant + # is created. For example, "projects/foo". + # @param job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] + # Required. The Job to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateJobRequest + + # Converts hash 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_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::Talent::V4beta1::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_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.create_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch create jobs operation. + # + # @overload batch_create_jobs(request, options = nil) + # Pass arguments to `batch_create_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_create_jobs(parent: nil, jobs: nil) + # Pass arguments to `batch_create_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] + # Required. The jobs to be created. + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new + # + # # Call the batch_create_jobs method. + # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest + + # Converts hash 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.batch_create_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::Talent::V4beta1::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.batch_create_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_create_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/jobs/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(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 job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] + # Required. The Job to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. + # Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.update_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Begins executing a batch update jobs operation. + # + # @overload batch_update_jobs(request, options = nil) + # Pass arguments to `batch_update_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) + # Pass arguments to `batch_update_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] + # Required. The jobs to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the + # fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. + # + # If + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4beta1::Job Job} inside + # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4beta1::Job Job} will include all fields, + # which can yield a very large response. + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new + # + # # Call the batch_update_jobs method. + # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest + + # Converts hash 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.batch_update_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::Talent::V4beta1::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.batch_update_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_update_jobs request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/jobs/bar". + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.delete_job request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a list of {::Google::Cloud::Talent::V4beta1::Job Job}s by filter. + # + # @overload batch_delete_jobs(request, options = nil) + # Pass arguments to `batch_delete_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_delete_jobs(parent: nil, filter: nil) + # Pass arguments to `batch_delete_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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param filter [::String] + # Required. The filter string specifies the jobs to be deleted. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` (Required) + # * `requisitionId` (Required) + # + # Sample Query: companyName = "projects/foo/companies/bar" AND + # requisitionId = "req-1" + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new + # + # # Call the batch_delete_jobs method. + # result = client.batch_delete_jobs request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def batch_delete_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest + + # Converts hash 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.batch_delete_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::Talent::V4beta1::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.batch_delete_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.batch_delete_jobs request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists jobs by filter. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param filter [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @param page_token [::String] + # The starting point of a query result. + # @param page_size [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4beta1::ListJobsRequest#job_view job_view} is set + # to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} + # if no value is specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_jobs, "jobs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # + # This call constrains the + # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in + # the database, and only returns jobs that the caller has permission to + # search against. + # + # @overload search_jobs(request, options = nil) + # Pass arguments to `search_jobs` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_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 parent [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param require_precise_result_size [::Boolean] + # This field is deprecated. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, + # for example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for + # example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, + # "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for + # example, "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} + # if no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is + # unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + # + # # Call the search_jobs method. + # result = client.search_jobs request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + # p result + # + def search_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest + + # Converts hash 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.search_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::Talent::V4beta1::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.search_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.search_jobs request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches for jobs using the provided + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), and has different algorithmic + # adjustments that are targeted to passive job seekers. + # + # This call constrains the + # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in + # the database, and only returns jobs the caller has permission to search + # against. + # + # @overload search_jobs_for_alert(request, options = nil) + # Pass arguments to `search_jobs_for_alert` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) + # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] + # Query used to search against jobs, such as keyword, location filters, etc. + # @param enable_broadening [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @param require_precise_result_size [::Boolean] + # This field is deprecated. + # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, + # for example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for + # example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, + # "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for + # example, "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} + # if no value is specified. + # @param offset [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is + # unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @param page_size [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @param page_token [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @param order_by [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. + # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @param disable_keyword_match [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + # + # # Call the search_jobs_for_alert method. + # result = client.search_jobs_for_alert request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + # p result + # + def search_jobs_for_alert request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest + + # Converts hash 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.search_jobs_for_alert.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::Talent::V4beta1::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.search_jobs_for_alert.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_service_stub.search_jobs_for_alert request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the JobService REST API. + # + # This class represents the configuration for JobService 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::Talent::V4beta1::JobService::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_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 JobService 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_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `batch_create_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_jobs + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `batch_update_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_jobs + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `batch_delete_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_jobs + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `search_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs + ## + # RPC-specific configuration for `search_jobs_for_alert` + # @return [::Gapic::Config::Method] + # + attr_reader :search_jobs_for_alert + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs + @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs + @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs + @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs + @search_jobs = ::Gapic::Config::Method.new search_jobs_config + search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert + @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb new file mode 100644 index 000000000000..c761a2506531 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module JobService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobService 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 JobService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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::Talent::V4beta1::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? + throw :response, 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::Talent::V4beta1::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? + throw :response, 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::Talent::V4beta1::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? + 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::Talent::V4beta1::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? + 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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{^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: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/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{^operations(?:/.*)?$}, true] + ] + ) + 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", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb new file mode 100644 index 000000000000..34c521a34b94 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb @@ -0,0 +1,774 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module JobService + module Rest + ## + # REST service stub for the JobService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateJobRequest] + # 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::Talent::V4beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Job] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_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, + method_name: "create_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_create_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest] + # 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 batch_create_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_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, + method_name: "batch_create_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::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, + method_name: "get_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::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, + method_name: "update_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_update_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest] + # 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 batch_update_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_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, + method_name: "batch_update_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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, + method_name: "delete_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_delete_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest] + # 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 batch_delete_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_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, + method_name: "batch_delete_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::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, + method_name: "list_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] + # 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::Talent::V4beta1::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # A result object deserialized from the server's reply + def search_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_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, + method_name: "search_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_jobs_for_alert REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] + # 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::Talent::V4beta1::SearchJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] + # A result object deserialized from the server's reply + def search_jobs_for_alert request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_for_alert_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, + method_name: "search_jobs_for_alert", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateJobRequest] + # 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_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_create_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{job.name}", + body: "*", + matches: [ + ["job.name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v4beta1/{job.name}", + body: "*", + matches: [ + ["job.name", %r{^projects/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_update_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_delete_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:batchDelete", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_jobs REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:search", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:search", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_jobs_for_alert REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_jobs_for_alert_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:searchForAlert", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/jobs:searchForAlert", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb new file mode 100644 index 000000000000..ead68c23f2d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/job_service.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/talent/v4beta1/common_pb' +require 'google/cloud/talent/v4beta1/filters_pb' +require 'google/cloud/talent/v4beta1/histogram_pb' +require 'google/cloud/talent/v4beta1/job_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n-google/cloud/talent/v4beta1/job_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a)google/cloud/talent/v4beta1/filters.proto\x1a+google/cloud/talent/v4beta1/histogram.proto\x1a%google/cloud/talent/v4beta1/job.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"w\n\x10\x43reateJobRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x32\n\x03job\x18\x02 \x01(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\">\n\rGetJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"w\n\x10UpdateJobRequest\x12\x32\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"A\n\x10\x44\x65leteJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"^\n\x16\x42\x61tchDeleteJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xb6\x01\n\x0fListJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x36\n\x08job_view\x18\x05 \x01(\x0e\x32$.google.cloud.talent.v4beta1.JobView\"\x9c\x01\n\x10ListJobsResponse\x12.\n\x04jobs\x18\x01 \x03(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\"\x86\r\n\x11SearchJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12N\n\x0bsearch_mode\x18\x02 \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode\x12K\n\x10request_metadata\x18\x03 \x01(\x0b\x32,.google.cloud.talent.v4beta1.RequestMetadataB\x03\xe0\x41\x02\x12\x38\n\tjob_query\x18\x04 \x01(\x0b\x32%.google.cloud.talent.v4beta1.JobQuery\x12\x19\n\x11\x65nable_broadening\x18\x05 \x01(\x08\x12\'\n\x1brequire_precise_result_size\x18\x06 \x01(\x08\x42\x02\x18\x01\x12\x46\n\x11histogram_queries\x18\x07 \x03(\x0b\x32+.google.cloud.talent.v4beta1.HistogramQuery\x12\x36\n\x08job_view\x18\x08 \x01(\x0e\x32$.google.cloud.talent.v4beta1.JobView\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x11\n\tpage_size\x18\n \x01(\x05\x12\x12\n\npage_token\x18\x0b \x01(\t\x12\x10\n\x08order_by\x18\x0c \x01(\t\x12\x62\n\x15\x64iversification_level\x18\r \x01(\x0e\x32\x43.google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel\x12]\n\x13\x63ustom_ranking_info\x18\x0e \x01(\x0b\x32@.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo\x12\x1d\n\x15\x64isable_keyword_match\x18\x10 \x01(\x08\x12[\n\x12keyword_match_mode\x18\x12 \x01(\x0e\x32?.google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode\x12\x63\n\x13relevance_threshold\x18\x13 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.SearchJobsRequest.RelevanceThresholdB\x03\xe0\x41\x01\x1a\x9a\x02\n\x11\x43ustomRankingInfo\x12o\n\x10importance_level\x18\x01 \x01(\x0e\x32P.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevelB\x03\xe0\x41\x02\x12\x1f\n\x12ranking_expression\x18\x02 \x01(\tB\x03\xe0\x41\x02\"s\n\x0fImportanceLevel\x12 \n\x1cIMPORTANCE_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\x08\n\x04MILD\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\x0b\n\x07\x45XTREME\x10\x06\"R\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nJOB_SEARCH\x10\x01\x12\x17\n\x13\x46\x45\x41TURED_JOB_SEARCH\x10\x02\"W\n\x14\x44iversificationLevel\x12%\n!DIVERSIFICATION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\n\n\x06SIMPLE\x10\x02\"\x87\x01\n\x10KeywordMatchMode\x12\"\n\x1eKEYWORD_MATCH_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16KEYWORD_MATCH_DISABLED\x10\x01\x12\x15\n\x11KEYWORD_MATCH_ALL\x10\x02\x12\x1c\n\x18KEYWORD_MATCH_TITLE_ONLY\x10\x03\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\xd7\x06\n\x12SearchJobsResponse\x12R\n\rmatching_jobs\x18\x01 \x03(\x0b\x32;.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob\x12R\n\x17histogram_query_results\x18\x02 \x03(\x0b\x32\x31.google.cloud.talent.v4beta1.HistogramQueryResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12?\n\x10location_filters\x18\x04 \x03(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12\x1c\n\x14\x65stimated_total_size\x18\x05 \x01(\x05\x12\x12\n\ntotal_size\x18\x06 \x01(\x05\x12?\n\x08metadata\x18\x07 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x12\"\n\x1a\x62roadened_query_jobs_count\x18\x08 \x01(\x05\x12I\n\x10spell_correction\x18\t \x01(\x0b\x32/.google.cloud.talent.v4beta1.SpellingCorrection\x1a\xdc\x01\n\x0bMatchingJob\x12-\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\x13\n\x0bjob_summary\x18\x02 \x01(\t\x12\x19\n\x11job_title_snippet\x18\x03 \x01(\t\x12\x1b\n\x13search_text_snippet\x18\x04 \x01(\t\x12Q\n\x0c\x63ommute_info\x18\x05 \x01(\x0b\x32;.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo\x1a~\n\x0b\x43ommuteInfo\x12;\n\x0cjob_location\x18\x01 \x01(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12\x32\n\x0ftravel_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"~\n\x16\x42\x61tchCreateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x33\n\x04jobs\x18\x02 \x03(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\"\xaf\x01\n\x16\x42\x61tchUpdateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x33\n\x04jobs\x18\x02 \x03(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xc4\x01\n\x12JobOperationResult\x12N\n\x0bjob_results\x18\x01 \x03(\x0b\x32\x39.google.cloud.talent.v4beta1.JobOperationResult.JobResult\x1a^\n\tJobResult\x12-\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status*v\n\x07JobView\x12\x18\n\x14JOB_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_VIEW_ID_ONLY\x10\x01\x12\x14\n\x10JOB_VIEW_MINIMAL\x10\x02\x12\x12\n\x0eJOB_VIEW_SMALL\x10\x03\x12\x11\n\rJOB_VIEW_FULL\x10\x04\x32\xce\x12\n\nJobService\x12\xc9\x01\n\tCreateJob\x12-.google.cloud.talent.v4beta1.CreateJobRequest\x1a .google.cloud.talent.v4beta1.Job\"k\xda\x41\nparent,job\x82\xd3\xe4\x93\x02X\"+/v4beta1/{parent=projects/*/tenants/*}/jobs:\x01*Z&\"!/v4beta1/{parent=projects/*}/jobs:\x01*\x12\x9b\x02\n\x0f\x42\x61tchCreateJobs\x12\x33.google.cloud.talent.v4beta1.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchCreate:\x01*\x12\xb7\x01\n\x06GetJob\x12*.google.cloud.talent.v4beta1.GetJobRequest\x1a .google.cloud.talent.v4beta1.Job\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#\x12!/v4beta1/{name=projects/*/jobs/*}\x12\xca\x01\n\tUpdateJob\x12-.google.cloud.talent.v4beta1.UpdateJobRequest\x1a .google.cloud.talent.v4beta1.Job\"l\xda\x41\x03job\x82\xd3\xe4\x93\x02`2//v4beta1/{job.name=projects/*/tenants/*/jobs/*}:\x01*Z*2%/v4beta1/{job.name=projects/*/jobs/*}:\x01*\x12\x9b\x02\n\x0f\x42\x61tchUpdateJobs\x12\x33.google.cloud.talent.v4beta1.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchUpdate:\x01*\x12\xb3\x01\n\tDeleteJob\x12-.google.cloud.talent.v4beta1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R*+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#*!/v4beta1/{name=projects/*/jobs/*}\x12\xe4\x01\n\x0f\x42\x61tchDeleteJobs\x12\x33.google.cloud.talent.v4beta1.BatchDeleteJobsRequest\x1a\x16.google.protobuf.Empty\"\x83\x01\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02m\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*Z/\"-/v4beta1/{parent=projects/*}/jobs:batchDelete\x12\xd1\x01\n\x08ListJobs\x12,.google.cloud.talent.v4beta1.ListJobsRequest\x1a-.google.cloud.talent.v4beta1.ListJobsResponse\"h\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{parent=projects/*/tenants/*}/jobsZ#\x12!/v4beta1/{parent=projects/*}/jobs\x12\xdb\x01\n\nSearchJobs\x12..google.cloud.talent.v4beta1.SearchJobsRequest\x1a/.google.cloud.talent.v4beta1.SearchJobsResponse\"l\x82\xd3\xe4\x93\x02\x66\"2/v4beta1/{parent=projects/*/tenants/*}/jobs:search:\x01*Z-\"(/v4beta1/{parent=projects/*}/jobs:search:\x01*\x12\xf3\x01\n\x12SearchJobsForAlert\x12..google.cloud.talent.v4beta1.SearchJobsRequest\x1a/.google.cloud.talent.v4beta1.SearchJobsResponse\"|\x82\xd3\xe4\x93\x02v\":/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert:\x01*Z5\"0/v4beta1/{parent=projects/*}/jobs:searchForAlert:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBs\n\x1f\x63om.google.cloud.talent.v4beta1B\x0fJobServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Job", "google/cloud/talent/v4beta1/job.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.proto"], + ["google.cloud.talent.v4beta1.JobQuery", "google/cloud/talent/v4beta1/filters.proto"], + ["google.cloud.talent.v4beta1.HistogramQuery", "google/cloud/talent/v4beta1/histogram.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.rpc.Status", "google/rpc/status.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 Talent + module V4beta1 + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateJobRequest").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetJobRequest").msgclass + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteJobRequest").msgclass + BatchDeleteJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchDeleteJobsRequest").msgclass + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListJobsResponse").msgclass + SearchJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest").msgclass + SearchJobsRequest::CustomRankingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo").msgclass + SearchJobsRequest::CustomRankingInfo::ImportanceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel").enummodule + SearchJobsRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode").enummodule + SearchJobsRequest::DiversificationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel").enummodule + SearchJobsRequest::KeywordMatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode").enummodule + SearchJobsRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.RelevanceThreshold").enummodule + SearchJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsResponse").msgclass + SearchJobsResponse::MatchingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob").msgclass + SearchJobsResponse::CommuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo").msgclass + BatchCreateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchCreateJobsRequest").msgclass + BatchUpdateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchUpdateJobsRequest").msgclass + JobOperationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobOperationResult").msgclass + JobOperationResult::JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobOperationResult.JobResult").msgclass + JobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobView").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb new file mode 100644 index 000000000000..27cb94167602 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb @@ -0,0 +1,90 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4beta1/job_service.proto for package 'google.cloud.talent.v4beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4beta1/job_service_pb' + +module Google + module Cloud + module Talent + module V4beta1 + module JobService + # A service handles job management, including job CRUD, enumeration and search. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4beta1.JobService' + + # Creates a new job. + # + # Typically, the job becomes searchable within 10 seconds, but it may take + # up to 5 minutes. + rpc :CreateJob, ::Google::Cloud::Talent::V4beta1::CreateJobRequest, ::Google::Cloud::Talent::V4beta1::Job + # Begins executing a batch create jobs operation. + rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, ::Google::Longrunning::Operation + # Retrieves the specified job, whose status is OPEN or recently EXPIRED + # within the last 90 days. + rpc :GetJob, ::Google::Cloud::Talent::V4beta1::GetJobRequest, ::Google::Cloud::Talent::V4beta1::Job + # Updates specified job. + # + # Typically, updated contents become visible in search results within 10 + # seconds, but it may take up to 5 minutes. + rpc :UpdateJob, ::Google::Cloud::Talent::V4beta1::UpdateJobRequest, ::Google::Cloud::Talent::V4beta1::Job + # Begins executing a batch update jobs operation. + rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, ::Google::Longrunning::Operation + # Deletes the specified job. + # + # Typically, the job becomes unsearchable within 10 seconds, but it may take + # up to 5 minutes. + rpc :DeleteJob, ::Google::Cloud::Talent::V4beta1::DeleteJobRequest, ::Google::Protobuf::Empty + # Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter. + rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, ::Google::Protobuf::Empty + # Lists jobs by filter. + rpc :ListJobs, ::Google::Cloud::Talent::V4beta1::ListJobsRequest, ::Google::Cloud::Talent::V4beta1::ListJobsResponse + # Searches for jobs using the provided + # [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. + # + # This call constrains the + # [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs present in + # the database, and only returns jobs that the caller has permission to + # search against. + rpc :SearchJobs, ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Google::Cloud::Talent::V4beta1::SearchJobsResponse + # Searches for jobs using the provided + # [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. + # + # This API call is intended for the use case of targeting passive job + # seekers (for example, job seekers who have signed up to receive email + # alerts about potential job opportunities), and has different algorithmic + # adjustments that are targeted to passive job seekers. + # + # This call constrains the + # [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs present in + # the database, and only returns jobs the caller has permission to search + # against. + rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Google::Cloud::Talent::V4beta1::SearchJobsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb new file mode 100644 index 000000000000..c4ff5205d5b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service/rest" +require "google/cloud/talent/v4beta1/completion/rest" +require "google/cloud/talent/v4beta1/event_service/rest" +require "google/cloud/talent/v4beta1/job_service/rest" +require "google/cloud/talent/v4beta1/tenant_service/rest" +require "google/cloud/talent/v4beta1/version" + +module Google + module Cloud + module Talent + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/talent/v4beta1/rest" + # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new + # + module V4beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb new file mode 100644 index 000000000000..8d4effb8ff24 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/tenant.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n(google/cloud/talent/v4beta1/tenant.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc3\x02\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\nusage_type\x18\x03 \x01(\x0e\x32\x31.google.cloud.talent.v4beta1.Tenant.DataUsageType\x12\x34\n,keyword_searchable_profile_custom_attributes\x18\x04 \x03(\t\"N\n\rDataUsageType\x12\x1f\n\x1b\x44\x41TA_USAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nAGGREGATED\x10\x01\x12\x0c\n\x08ISOLATED\x10\x02:D\xea\x41\x41\n\x1ajobs.googleapis.com/Tenant\x12#projects/{project}/tenants/{tenant}Bw\n\x1f\x63om.google.cloud.talent.v4beta1B\x13TenantResourceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ + ] + 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 Talent + module V4beta1 + Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant").msgclass + Tenant::DataUsageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant.DataUsageType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb new file mode 100644 index 000000000000..5edb4c257b75 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/tenant_service/credentials" +require "google/cloud/talent/v4beta1/tenant_service/paths" +require "google/cloud/talent/v4beta1/tenant_service/client" +require "google/cloud/talent/v4beta1/tenant_service/rest" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service that handles tenant management, including CRUD and enumeration. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/talent/v4beta1/tenant_service" + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/talent/v4beta1/tenant_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + module TenantService + end + end + end + end +end + +helper_path = ::File.join __dir__, "tenant_service", "helpers.rb" +require "google/cloud/talent/v4beta1/tenant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb new file mode 100644 index 000000000000..49716d04c024 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb @@ -0,0 +1,899 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module TenantService + ## + # Client for the TenantService service. + # + # A service that handles tenant management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tenant_service_stub + + ## + # Configure the TenantService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::TenantService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TenantService clients + # ::Google::Cloud::Talent::V4beta1::TenantService::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", "Talent", "V4beta1"] + 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_tenant.timeout = 30.0 + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tenants.timeout = 30.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TenantService 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::Talent::V4beta1::TenantService::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 + @tenant_service_stub.universe_domain + end + + ## + # Create a new TenantService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TenantService 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/talent/v4beta1/tenant_service_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 + + @tenant_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Talent::V4beta1::TenantService::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, + logger: @config.logger + ) + + @tenant_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tenant_service_stub.logger + end + + # Service calls + + ## + # Creates a new tenant entity. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] + # Required. The tenant to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] + # Required. The tenant resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are + # updated. Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Tenant Tenant} are + # supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Talent::V4beta1::Tenant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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.tenant&.name + header_params["tenant.name"] = request.tenant.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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all tenants associated with the project. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants 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::Talent::V4beta1::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListTenantsRequest + + # Converts hash 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_tenants.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::Talent::V4beta1::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_tenants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TenantService API. + # + # This class represents the configuration for TenantService, + # 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::Talent::V4beta1::TenantService::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_tenant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::TenantService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TenantService 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_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + + # @private + def initialize parent_rpcs = nil + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb new file mode 100644 index 000000000000..7d5457070044 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module TenantService + # Credentials for the TenantService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/jobs" + ] + self.env_vars = [ + "TALENT_CREDENTIALS", + "TALENT_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TALENT_CREDENTIALS_JSON", + "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb new file mode 100644 index 000000000000..8e720c2b714d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + module TenantService + # Path helper methods for the TenantService API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Tenant resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/tenants/{tenant}` + # + # @param project [String] + # @param tenant [String] + # + # @return [::String] + def tenant_path project:, tenant: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/tenants/#{tenant}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb new file mode 100644 index 000000000000..7171b337cbab --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" + +require "google/cloud/talent/v4beta1/tenant_service/credentials" +require "google/cloud/talent/v4beta1/tenant_service/paths" +require "google/cloud/talent/v4beta1/tenant_service/rest/client" + +module Google + module Cloud + module Talent + module V4beta1 + ## + # A service that handles tenant management, including CRUD and enumeration. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/talent/v4beta1/tenant_service/rest" + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + module TenantService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/talent/v4beta1/tenant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb new file mode 100644 index 000000000000..be540584dba9 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb @@ -0,0 +1,821 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" +require "google/cloud/talent/v4beta1/tenant_service/rest/service_stub" + +module Google + module Cloud + module Talent + module V4beta1 + module TenantService + module Rest + ## + # REST client for the TenantService service. + # + # A service that handles tenant management, including CRUD and enumeration. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tenant_service_stub + + ## + # Configure the TenantService Client class. + # + # See {::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TenantService clients + # ::Google::Cloud::Talent::V4beta1::TenantService::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", "Talent", "V4beta1"] + 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_tenant.timeout = 30.0 + + default_config.rpcs.get_tenant.timeout = 30.0 + default_config.rpcs.get_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_tenant.timeout = 30.0 + + default_config.rpcs.delete_tenant.timeout = 30.0 + default_config.rpcs.delete_tenant.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tenants.timeout = 30.0 + default_config.rpcs.list_tenants.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TenantService 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::Talent::V4beta1::TenantService::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 + @tenant_service_stub.universe_domain + end + + ## + # Create a new TenantService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TenantService 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 + + @tenant_service_stub = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tenant_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tenant_service_stub.logger + end + + # Service calls + + ## + # Creates a new tenant entity. + # + # @overload create_tenant(request, options = nil) + # Pass arguments to `create_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::CreateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::CreateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) + # Pass arguments to `create_tenant` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] + # Required. The tenant to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new + # + # # Call the create_tenant method. + # result = client.create_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + # p result + # + def create_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.create_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves specified tenant. + # + # @overload get_tenant(request, options = nil) + # Pass arguments to `get_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::GetTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::GetTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `get_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new + # + # # Call the get_tenant method. + # result = client.get_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + # p result + # + def get_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.get_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates specified tenant. + # + # @overload update_tenant(request, options = nil) + # Pass arguments to `update_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) + # Pass arguments to `update_tenant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] + # Required. The tenant resource to replace the current resource in the + # system. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Strongly recommended for the best service experience. + # + # If + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are + # updated. Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Tenant Tenant} are + # supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Talent::V4beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new + # + # # Call the update_tenant method. + # result = client.update_tenant request + # + # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + # p result + # + def update_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.update_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes specified tenant. + # + # @overload delete_tenant(request, options = nil) + # Pass arguments to `delete_tenant` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::DeleteTenantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenant(name: nil) + # Pass arguments to `delete_tenant` via keyword arguments. Note that at + # least one keyword argument is 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 tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @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/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new + # + # # Call the delete_tenant method. + # result = client.delete_tenant request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tenant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest + + # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tenant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.delete_tenant request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all tenants associated with the project. + # + # @overload list_tenants(request, options = nil) + # Pass arguments to `list_tenants` via a request object, either of type + # {::Google::Cloud::Talent::V4beta1::ListTenantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Talent::V4beta1::ListTenantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_tenants` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @param page_token [::String] + # The starting indicator from which to return results. + # @param page_size [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/talent/v4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new + # + # # Call the list_tenants method. + # result = client.list_tenants 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::Talent::V4beta1::Tenant. + # p item + # end + # + def list_tenants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListTenantsRequest + + # Converts hash 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_tenants.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::Talent::V4beta1::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_tenants.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tenants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tenant_service_stub.list_tenants request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TenantService REST API. + # + # This class represents the configuration for TenantService 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::Talent::V4beta1::TenantService::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_tenant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tenant.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "jobs.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TenantService 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_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tenant + ## + # RPC-specific configuration for `get_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tenant + ## + # RPC-specific configuration for `update_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tenant + ## + # RPC-specific configuration for `delete_tenant` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tenant + ## + # RPC-specific configuration for `list_tenants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tenants + + # @private + def initialize parent_rpcs = nil + create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant + @create_tenant = ::Gapic::Config::Method.new create_tenant_config + get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant + @get_tenant = ::Gapic::Config::Method.new get_tenant_config + update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant + @update_tenant = ::Gapic::Config::Method.new update_tenant_config + delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant + @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config + list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants + @list_tenants = ::Gapic::Config::Method.new list_tenants_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb new file mode 100644 index 000000000000..8c0daaca6a92 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" + +module Google + module Cloud + module Talent + module V4beta1 + module TenantService + module Rest + ## + # REST service stub for the TenantService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateTenantRequest] + # 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::Talent::V4beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # A result object deserialized from the server's reply + def create_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_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, + method_name: "create_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::GetTenantRequest] + # 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::Talent::V4beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # A result object deserialized from the server's reply + def get_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_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, + method_name: "get_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest] + # 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::Talent::V4beta1::Tenant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # A result object deserialized from the server's reply + def update_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_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, + method_name: "update_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest] + # 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_tenant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_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, + method_name: "delete_tenant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::ListTenantsRequest] + # 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::Talent::V4beta1::ListTenantsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Talent::V4beta1::ListTenantsResponse] + # A result object deserialized from the server's reply + def list_tenants request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_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, + method_name: "list_tenants", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v4beta1/{parent}/tenants", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::GetTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v4beta1/{tenant.name}", + body: "*", + matches: [ + ["tenant.name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tenant REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest] + # 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_tenant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tenants REST call + # + # @param request_pb [::Google::Cloud::Talent::V4beta1::ListTenantsRequest] + # 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_tenants_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v4beta1/{parent}/tenants", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb new file mode 100644 index 000000000000..4b937c734659 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/talent/v4beta1/tenant_service.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/talent/v4beta1/common_pb' +require 'google/cloud/talent/v4beta1/tenant_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n0google/cloud/talent/v4beta1/tenant_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a(google/cloud/talent/v4beta1/tenant.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x94\x01\n\x13\x43reateTenantRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x38\n\x06tenant\x18\x02 \x01(\x0b\x32#.google.cloud.talent.v4beta1.TenantB\x03\xe0\x41\x02\"D\n\x10GetTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x13UpdateTenantRequest\x12\x38\n\x06tenant\x18\x01 \x01(\x0b\x32#.google.cloud.talent.v4beta1.TenantB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x13\x44\x65leteTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x12ListTenantsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xa5\x01\n\x13ListTenantsResponse\x12\x34\n\x07tenants\x18\x01 \x03(\x0b\x32#.google.cloud.talent.v4beta1.Tenant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata2\xa0\x07\n\rTenantService\x12\xa6\x01\n\x0c\x43reateTenant\x12\x30.google.cloud.talent.v4beta1.CreateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"?\xda\x41\rparent,tenant\x82\xd3\xe4\x93\x02)\"$/v4beta1/{parent=projects/*}/tenants:\x01*\x12\x94\x01\n\tGetTenant\x12-.google.cloud.talent.v4beta1.GetTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{name=projects/*/tenants/*}\x12\xa6\x01\n\x0cUpdateTenant\x12\x30.google.cloud.talent.v4beta1.UpdateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"?\xda\x41\x06tenant\x82\xd3\xe4\x93\x02\x30\x32+/v4beta1/{tenant.name=projects/*/tenants/*}:\x01*\x12\x8d\x01\n\x0c\x44\x65leteTenant\x12\x30.google.cloud.talent.v4beta1.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&*$/v4beta1/{name=projects/*/tenants/*}\x12\xa7\x01\n\x0bListTenants\x12/.google.cloud.talent.v4beta1.ListTenantsRequest\x1a\x30.google.cloud.talent.v4beta1.ListTenantsResponse\"5\xda\x41\x06parent\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{parent=projects/*}/tenants\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBv\n\x1f\x63om.google.cloud.talent.v4beta1B\x12TenantServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Tenant", "google/cloud/talent/v4beta1/tenant.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.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 Talent + module V4beta1 + CreateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateTenantRequest").msgclass + GetTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetTenantRequest").msgclass + UpdateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateTenantRequest").msgclass + DeleteTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteTenantRequest").msgclass + ListTenantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListTenantsRequest").msgclass + ListTenantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListTenantsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb new file mode 100644 index 000000000000..39df63566326 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/talent/v4beta1/tenant_service.proto for package 'google.cloud.talent.v4beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/talent/v4beta1/tenant_service_pb' + +module Google + module Cloud + module Talent + module V4beta1 + module TenantService + # A service that handles tenant management, including CRUD and enumeration. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.talent.v4beta1.TenantService' + + # Creates a new tenant entity. + rpc :CreateTenant, ::Google::Cloud::Talent::V4beta1::CreateTenantRequest, ::Google::Cloud::Talent::V4beta1::Tenant + # Retrieves specified tenant. + rpc :GetTenant, ::Google::Cloud::Talent::V4beta1::GetTenantRequest, ::Google::Cloud::Talent::V4beta1::Tenant + # Updates specified tenant. + rpc :UpdateTenant, ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, ::Google::Cloud::Talent::V4beta1::Tenant + # Deletes specified tenant. + rpc :DeleteTenant, ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, ::Google::Protobuf::Empty + # Lists all tenants associated with the project. + rpc :ListTenants, ::Google::Cloud::Talent::V4beta1::ListTenantsRequest, ::Google::Cloud::Talent::V4beta1::ListTenantsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb new file mode 100644 index 000000000000..aacd2f027ae5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md new file mode 100644 index 000000000000..287a6b375f8f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Talent Solution V4beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-talent-v4beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb new file mode 100644 index 000000000000..cea1d3a59a72 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb @@ -0,0 +1,955 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # Message representing a period of time between two timestamps. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Begin of the period (inclusive). + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End of the period (exclusive). + class TimestampRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A resource that represents a location with full geographic information. + # @!attribute [rw] location_type + # @return [::Google::Cloud::Talent::V4beta1::Location::LocationType] + # The type of a location, which corresponds to the address lines field of + # {::Google::Type::PostalAddress google.type.PostalAddress}. For example, + # "Downtown, Atlanta, GA, USA" has a type of + # {::Google::Cloud::Talent::V4beta1::Location::LocationType::NEIGHBORHOOD LocationType.NEIGHBORHOOD}, + # and "Kansas City, KS, USA" has a type of + # {::Google::Cloud::Talent::V4beta1::Location::LocationType::LOCALITY LocationType.LOCALITY}. + # @!attribute [rw] postal_address + # @return [::Google::Type::PostalAddress] + # Postal address of the location that includes human readable information, + # such as postal delivery and payments addresses. Given a postal address, + # a postal service can deliver items to a premises, P.O. Box, or other + # delivery location. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # An object representing a latitude/longitude pair. + # @!attribute [rw] radius_miles + # @return [::Float] + # Radius in miles of the job location. This value is derived from the + # location bounding box in which a circle with the specified radius + # centered from {::Google::Type::LatLng google.type.LatLng} covers the area + # associated with the job location. For example, currently, "Mountain View, + # CA, USA" has a radius of 6.17 miles. + class Location + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enum which represents the type of a location. + module LocationType + # Default value if the type isn't specified. + LOCATION_TYPE_UNSPECIFIED = 0 + + # A country level location. + COUNTRY = 1 + + # A state or equivalent level location. + ADMINISTRATIVE_AREA = 2 + + # A county or equivalent level location. + SUB_ADMINISTRATIVE_AREA = 3 + + # A city or equivalent level location. + LOCALITY = 4 + + # A postal code level location. + POSTAL_CODE = 5 + + # A sublocality is a subdivision of a locality, for example a city borough, + # ward, or arrondissement. Sublocalities are usually recognized by a local + # political authority. For example, Manhattan and Brooklyn are recognized + # as boroughs by the City of New York, and are therefore modeled as + # sublocalities. + SUB_LOCALITY = 6 + + # A district or equivalent level location. + SUB_LOCALITY_1 = 7 + + # A smaller district or equivalent level display. + SUB_LOCALITY_2 = 8 + + # A neighborhood level location. + NEIGHBORHOOD = 9 + + # A street address level location. + STREET_ADDRESS = 10 + end + end + + # Meta information related to the job searcher or entity + # conducting the job search. This information is used to improve the + # performance of the service. + # @!attribute [rw] domain + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # The client-defined scope or source of the service call, which typically + # is the domain on + # which the service has been implemented and is currently being run. + # + # For example, if the service is being run by client Foo, Inc., on + # job board www.foo.com and career site www.bar.com, then this field is + # set to "foo.com" for use on the job board, and "bar.com" for use on the + # career site. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique domain. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] session_id + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # A unique session identification string. A session is defined as the + # duration of an end user's interaction with the service over a certain + # period. + # Obfuscate this field for privacy concerns before + # providing it to the service. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique session ID. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] user_id + # @return [::String] + # Required if + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#allow_missing_ids allow_missing_ids} + # is unset or `false`. + # + # A unique user identification string, as determined by the client. + # To have the strongest positive impact on search quality + # make sure the client-level is unique. + # Obfuscate this field for privacy concerns before + # providing it to the service. + # + # Note that any improvements to the model for a particular tenant site rely + # on this field being set correctly to a unique user ID. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] allow_missing_ids + # @return [::Boolean] + # Only set when any of + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#domain domain}, + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#session_id session_id} and + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#user_id user_id} isn't + # available for some reason. It is highly recommended not to set this field + # and provide accurate + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#domain domain}, + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#session_id session_id} and + # {::Google::Cloud::Talent::V4beta1::RequestMetadata#user_id user_id} for the best + # service experience. + # @!attribute [rw] device_info + # @return [::Google::Cloud::Talent::V4beta1::DeviceInfo] + # The type of device used by the job seeker at the time of the call to the + # service. + class RequestMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Additional information returned to client, such as debugging information. + # @!attribute [rw] request_id + # @return [::String] + # A unique id associated with this call. + # This id is logged for tracking purposes. + class ResponseMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Device information collected from the job seeker, candidate, or + # other entity conducting the job search. Providing this information improves + # the quality of the search results across devices. + # @!attribute [rw] device_type + # @return [::Google::Cloud::Talent::V4beta1::DeviceInfo::DeviceType] + # Type of the device. + # @!attribute [rw] id + # @return [::String] + # A device-specific ID. The ID must be a unique identifier that + # distinguishes the device from other devices. + class DeviceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enumeration describing an API access portal and exposure mechanism. + module DeviceType + # The device type isn't specified. + DEVICE_TYPE_UNSPECIFIED = 0 + + # A desktop web browser, such as, Chrome, Firefox, Safari, or Internet + # Explorer) + WEB = 1 + + # A mobile device web browser, such as a phone or tablet with a Chrome + # browser. + MOBILE_WEB = 2 + + # An Android device native application. + ANDROID = 3 + + # An iOS device native application. + IOS = 4 + + # A bot, as opposed to a device operated by human beings, such as a web + # crawler. + BOT = 5 + + # Other devices types. + OTHER = 6 + end + end + + # Custom attribute values that are either filterable or non-filterable. + # @!attribute [rw] string_values + # @return [::Array<::String>] + # Exactly one of + # {::Google::Cloud::Talent::V4beta1::CustomAttribute#string_values string_values} + # or {::Google::Cloud::Talent::V4beta1::CustomAttribute#long_values long_values} + # must be specified. + # + # This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or + # `CASE_INSENSITIVE_MATCH`) search. + # For filterable `string_value`s, a maximum total number of 200 values + # is allowed, with each `string_value` has a byte size of no more than + # 500B. For unfilterable `string_values`, the maximum total byte size of + # unfilterable `string_values` is 50KB. + # + # Empty string isn't allowed. + # @!attribute [rw] long_values + # @return [::Array<::Integer>] + # Exactly one of + # {::Google::Cloud::Talent::V4beta1::CustomAttribute#string_values string_values} + # or {::Google::Cloud::Talent::V4beta1::CustomAttribute#long_values long_values} + # must be specified. + # + # This field is used to perform number range search. + # (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. + # + # Currently at most 1 + # {::Google::Cloud::Talent::V4beta1::CustomAttribute#long_values long_values} is + # supported. + # @!attribute [rw] filterable + # @return [::Boolean] + # If the `filterable` flag is true, the custom field values may be used for + # custom attribute filters + # {::Google::Cloud::Talent::V4beta1::JobQuery#custom_attribute_filter JobQuery.custom_attribute_filter}. + # If false, these values may not be used for custom attribute filters. + # + # Default is false. + # @!attribute [rw] keyword_searchable + # @return [::Boolean] + # If the `keyword_searchable` flag is true, the keywords in custom fields are + # searchable by keyword match. + # If false, the values are not searchable by keyword match. + # + # Default is false. + class CustomAttribute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spell check result. + # @!attribute [rw] corrected + # @return [::Boolean] + # Indicates if the query was corrected by the spell checker. + # @!attribute [rw] corrected_text + # @return [::String] + # Correction output consisting of the corrected keyword string. + # @!attribute [rw] corrected_html + # @return [::String] + # Corrected output with html tags to highlight the corrected words. + # Corrected words are called out with the "..." html tags. + # + # For example, the user input query is "software enginear", where the second + # word, "enginear," is incorrect. It should be "engineer". When spelling + # correction is enabled, this value is + # "software engineer". + class SpellingCorrection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Job compensation details. + # @!attribute [rw] entries + # @return [::Array<::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry>] + # Job compensation information. + # + # At most one entry can be of type + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationType::BASE CompensationInfo.CompensationType.BASE}, + # which is referred as **base compensation entry** for the job. + # @!attribute [r] annualized_base_compensation_range + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] + # Output only. Annualized base compensation range. Computed as base + # compensation entry's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # times + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. + # + # See + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationEntry} + # for explanation on compensation annualization. + # @!attribute [r] annualized_total_compensation_range + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] + # Output only. Annualized total compensation range. Computed as all + # compensation entries' + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # times + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. + # + # See + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationEntry} + # for explanation on compensation annualization. + class CompensationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A compensation entry that represents one component of compensation, such + # as base pay, bonus, or other compensation type. + # + # Annualization: One compensation entry can be annualized if + # - it contains valid + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount amount} + # or + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range range}. + # - and its + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year} + # is set or can be derived. Its annualized range is determined as + # ({::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount amount} + # or + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range range}) + # times + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year}. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationType] + # Compensation type. + # + # Default is + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationType::COMPENSATION_TYPE_UNSPECIFIED CompensationType.COMPENSATION_TYPE_UNSPECIFIED}. + # @!attribute [rw] unit + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit] + # Frequency of the specified amount. + # + # Default is + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED}. + # @!attribute [rw] amount + # @return [::Google::Type::Money] + # Compensation amount. + # + # Note: The following fields are mutually exclusive: `amount`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] + # Compensation range. + # + # Note: The following fields are mutually exclusive: `range`, `amount`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] description + # @return [::String] + # Compensation description. For example, could + # indicate equity terms or provide additional context to an estimated + # bonus. + # @!attribute [rw] expected_units_per_year + # @return [::Google::Protobuf::DoubleValue] + # Expected number of units paid each year. If not specified, when + # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types} + # is FULLTIME, a default value is inferred based on + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#unit unit}. + # Default values: + # - HOURLY: 2080 + # - DAILY: 260 + # - WEEKLY: 52 + # - MONTHLY: 12 + # - ANNUAL: 1 + class CompensationEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Compensation range. + # @!attribute [rw] max_compensation + # @return [::Google::Type::Money] + # The maximum amount of compensation. If left empty, the value is set + # to a maximal compensation value and the currency code is set to + # match the {::Google::Type::Money#currency_code currency code} of + # min_compensation. + # @!attribute [rw] min_compensation + # @return [::Google::Type::Money] + # The minimum amount of compensation. If left empty, the value is set + # to zero and the currency code is set to match the + # {::Google::Type::Money#currency_code currency code} of max_compensation. + class CompensationRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of compensation. + # + # For compensation amounts specified in non-monetary amounts, + # describe the compensation scheme in the + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description}. + # + # For example, tipping format is described in + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # (for example, "expect 15-20% tips based on customer bill.") and an estimate + # of the tips provided in + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # or + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range CompensationEntry.range} + # ($10 per hour). + # + # For example, equity is described in + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and + # value estimated in + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} + # or + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range CompensationEntry.range}. + # If no value estimate is possible, units are + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED} + # and then further clarified in + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description} + # field. + module CompensationType + # Default value. + COMPENSATION_TYPE_UNSPECIFIED = 0 + + # Base compensation: Refers to the fixed amount of money paid to an + # employee by an employer in return for work performed. Base compensation + # does not include benefits, bonuses or any other potential compensation + # from an employer. + BASE = 1 + + # Bonus. + BONUS = 2 + + # Signing bonus. + SIGNING_BONUS = 3 + + # Equity. + EQUITY = 4 + + # Profit sharing. + PROFIT_SHARING = 5 + + # Commission. + COMMISSIONS = 6 + + # Tips. + TIPS = 7 + + # Other compensation type. + OTHER_COMPENSATION_TYPE = 8 + end + + # Pay frequency. + module CompensationUnit + # Default value. + COMPENSATION_UNIT_UNSPECIFIED = 0 + + # Hourly. + HOURLY = 1 + + # Daily. + DAILY = 2 + + # Weekly + WEEKLY = 3 + + # Monthly. + MONTHLY = 4 + + # Yearly. + YEARLY = 5 + + # One time. + ONE_TIME = 6 + + # Other compensation units. + OTHER_COMPENSATION_UNIT = 7 + end + end + + # Metadata used for long running operations returned by CTS batch APIs. + # It's used to replace + # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}. + # @!attribute [rw] state + # @return [::Google::Cloud::Talent::V4beta1::BatchOperationMetadata::State] + # The state of a long running operation. + # @!attribute [rw] state_description + # @return [::String] + # More detailed information about operation state. + # @!attribute [rw] success_count + # @return [::Integer] + # Count of successful item(s) inside an operation. + # @!attribute [rw] failure_count + # @return [::Integer] + # Count of failed item(s) inside an operation. + # @!attribute [rw] total_count + # @return [::Integer] + # Count of total item(s) inside an operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation is created. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation status is updated. The metadata and the + # {::Google::Cloud::Talent::V4beta1::BatchOperationMetadata#update_time update_time} + # is refreshed every minute otherwise cached data is returned. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch operation is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to `true`. + class BatchOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module State + # Default value. + STATE_UNSPECIFIED = 0 + + # The batch operation is being prepared for processing. + INITIALIZING = 1 + + # The batch operation is actively being processed. + PROCESSING = 2 + + # The batch operation is processed, and at least one item has been + # successfully processed. + SUCCEEDED = 3 + + # The batch operation is done and no item has been successfully processed. + FAILED = 4 + + # The batch operation is in the process of cancelling after + # google.longrunning.Operations.CancelOperation + # is called. + CANCELLING = 5 + + # The batch operation is done after + # google.longrunning.Operations.CancelOperation + # is called. Any items processed before cancelling are returned in the + # response. + CANCELLED = 6 + end + end + + # An enum that represents the size of the company. + module CompanySize + # Default value if the size isn't specified. + COMPANY_SIZE_UNSPECIFIED = 0 + + # The company has less than 50 employees. + MINI = 1 + + # The company has between 50 and 99 employees. + SMALL = 2 + + # The company has between 100 and 499 employees. + SMEDIUM = 3 + + # The company has between 500 and 999 employees. + MEDIUM = 4 + + # The company has between 1,000 and 4,999 employees. + BIG = 5 + + # The company has between 5,000 and 9,999 employees. + BIGGER = 6 + + # The company has 10,000 or more employees. + GIANT = 7 + end + + # An enum that represents employee benefits included with the job. + module JobBenefit + # Default value if the type isn't specified. + JOB_BENEFIT_UNSPECIFIED = 0 + + # The job includes access to programs that support child care, such + # as daycare. + CHILD_CARE = 1 + + # The job includes dental services covered by a dental + # insurance plan. + DENTAL = 2 + + # The job offers specific benefits to domestic partners. + DOMESTIC_PARTNER = 3 + + # The job allows for a flexible work schedule. + FLEXIBLE_HOURS = 4 + + # The job includes health services covered by a medical insurance plan. + MEDICAL = 5 + + # The job includes a life insurance plan provided by the employer or + # available for purchase by the employee. + LIFE_INSURANCE = 6 + + # The job allows for a leave of absence to a parent to care for a newborn + # child. + PARENTAL_LEAVE = 7 + + # The job includes a workplace retirement plan provided by the + # employer or available for purchase by the employee. + RETIREMENT_PLAN = 8 + + # The job allows for paid time off due to illness. + SICK_DAYS = 9 + + # The job includes paid time off for vacation. + VACATION = 10 + + # The job includes vision services covered by a vision + # insurance plan. + VISION = 11 + end + + # Educational degree level defined in International Standard Classification + # of Education (ISCED). + module DegreeType + # Default value. Represents no degree, or early childhood education. + # Maps to ISCED code 0. + # Ex) Kindergarten + DEGREE_TYPE_UNSPECIFIED = 0 + + # Primary education which is typically the first stage of compulsory + # education. ISCED code 1. + # Ex) Elementary school + PRIMARY_EDUCATION = 1 + + # Lower secondary education; First stage of secondary education building on + # primary education, typically with a more subject-oriented curriculum. + # ISCED code 2. + # Ex) Middle school + LOWER_SECONDARY_EDUCATION = 2 + + # Middle education; Second/final stage of secondary education preparing for + # tertiary education and/or providing skills relevant to employment. + # Usually with an increased range of subject options and streams. ISCED + # code 3. + # Ex) High school + UPPER_SECONDARY_EDUCATION = 3 + + # Adult Remedial Education; Programmes providing learning experiences that + # build on secondary education and prepare for labour market entry and/or + # tertiary education. The content is broader than secondary but not as + # complex as tertiary education. ISCED code 4. + ADULT_REMEDIAL_EDUCATION = 4 + + # Associate's or equivalent; Short first tertiary programmes that are + # typically practically-based, occupationally-specific and prepare for + # labour market entry. These programmes may also provide a pathway to other + # tertiary programmes. ISCED code 5. + ASSOCIATES_OR_EQUIVALENT = 5 + + # Bachelor's or equivalent; Programmes designed to provide intermediate + # academic and/or professional knowledge, skills and competencies leading + # to a first tertiary degree or equivalent qualification. ISCED code 6. + BACHELORS_OR_EQUIVALENT = 6 + + # Master's or equivalent; Programmes designed to provide advanced academic + # and/or professional knowledge, skills and competencies leading to a + # second tertiary degree or equivalent qualification. ISCED code 7. + MASTERS_OR_EQUIVALENT = 7 + + # Doctoral or equivalent; Programmes designed primarily to lead to an + # advanced research qualification, usually concluding with the submission + # and defense of a substantive dissertation of publishable quality based on + # original research. ISCED code 8. + DOCTORAL_OR_EQUIVALENT = 8 + end + + # An enum that represents the employment type of a job. + module EmploymentType + # The default value if the employment type isn't specified. + EMPLOYMENT_TYPE_UNSPECIFIED = 0 + + # The job requires working a number of hours that constitute full + # time employment, typically 40 or more hours per week. + FULL_TIME = 1 + + # The job entails working fewer hours than a full time job, + # typically less than 40 hours a week. + PART_TIME = 2 + + # The job is offered as a contracted, as opposed to a salaried employee, + # position. + CONTRACTOR = 3 + + # The job is offered as a contracted position with the understanding + # that it's converted into a full-time position at the end of the + # contract. Jobs of this type are also returned by a search for + # {::Google::Cloud::Talent::V4beta1::EmploymentType::CONTRACTOR EmploymentType.CONTRACTOR} + # jobs. + CONTRACT_TO_HIRE = 4 + + # The job is offered as a temporary employment opportunity, usually + # a short-term engagement. + TEMPORARY = 5 + + # The job is a fixed-term opportunity for students or entry-level job + # seekers to obtain on-the-job training, typically offered as a summer + # position. + INTERN = 6 + + # The is an opportunity for an individual to volunteer, where there's no + # expectation of compensation for the provided services. + VOLUNTEER = 7 + + # The job requires an employee to work on an as-needed basis with a + # flexible schedule. + PER_DIEM = 8 + + # The job involves employing people in remote areas and flying them + # temporarily to the work site instead of relocating employees and their + # families permanently. + FLY_IN_FLY_OUT = 9 + + # The job does not fit any of the other listed types. + OTHER_EMPLOYMENT_TYPE = 10 + end + + # An enum that represents the required experience level required for the job. + module JobLevel + # The default value if the level isn't specified. + JOB_LEVEL_UNSPECIFIED = 0 + + # Entry-level individual contributors, typically with less than 2 years of + # experience in a similar role. Includes interns. + ENTRY_LEVEL = 1 + + # Experienced individual contributors, typically with 2+ years of + # experience in a similar role. + EXPERIENCED = 2 + + # Entry- to mid-level managers responsible for managing a team of people. + MANAGER = 3 + + # Senior-level managers responsible for managing teams of managers. + DIRECTOR = 4 + + # Executive-level managers and above, including C-level positions. + EXECUTIVE = 5 + end + + # An enum that represents the categorization or primary focus of specific + # role. This value is different than the "industry" associated with a role, + # which is related to the categorization of the company listing the job. + module JobCategory + # The default value if the category isn't specified. + JOB_CATEGORY_UNSPECIFIED = 0 + + # An accounting and finance job, such as an Accountant. + ACCOUNTING_AND_FINANCE = 1 + + # An administrative and office job, such as an Administrative Assistant. + ADMINISTRATIVE_AND_OFFICE = 2 + + # An advertising and marketing job, such as Marketing Manager. + ADVERTISING_AND_MARKETING = 3 + + # An animal care job, such as Veterinarian. + ANIMAL_CARE = 4 + + # An art, fashion, or design job, such as Designer. + ART_FASHION_AND_DESIGN = 5 + + # A business operations job, such as Business Operations Manager. + BUSINESS_OPERATIONS = 6 + + # A cleaning and facilities job, such as Custodial Staff. + CLEANING_AND_FACILITIES = 7 + + # A computer and IT job, such as Systems Administrator. + COMPUTER_AND_IT = 8 + + # A construction job, such as General Laborer. + CONSTRUCTION = 9 + + # A customer service job, such s Cashier. + CUSTOMER_SERVICE = 10 + + # An education job, such as School Teacher. + EDUCATION = 11 + + # An entertainment and travel job, such as Flight Attendant. + ENTERTAINMENT_AND_TRAVEL = 12 + + # A farming or outdoor job, such as Park Ranger. + FARMING_AND_OUTDOORS = 13 + + # A healthcare job, such as Registered Nurse. + HEALTHCARE = 14 + + # A human resources job, such as Human Resources Director. + HUMAN_RESOURCES = 15 + + # An installation, maintenance, or repair job, such as Electrician. + INSTALLATION_MAINTENANCE_AND_REPAIR = 16 + + # A legal job, such as Law Clerk. + LEGAL = 17 + + # A management job, often used in conjunction with another category, + # such as Store Manager. + MANAGEMENT = 18 + + # A manufacturing or warehouse job, such as Assembly Technician. + MANUFACTURING_AND_WAREHOUSE = 19 + + # A media, communications, or writing job, such as Media Relations. + MEDIA_COMMUNICATIONS_AND_WRITING = 20 + + # An oil, gas or mining job, such as Offshore Driller. + OIL_GAS_AND_MINING = 21 + + # A personal care and services job, such as Hair Stylist. + PERSONAL_CARE_AND_SERVICES = 22 + + # A protective services job, such as Security Guard. + PROTECTIVE_SERVICES = 23 + + # A real estate job, such as Buyer's Agent. + REAL_ESTATE = 24 + + # A restaurant and hospitality job, such as Restaurant Server. + RESTAURANT_AND_HOSPITALITY = 25 + + # A sales and/or retail job, such Sales Associate. + SALES_AND_RETAIL = 26 + + # A science and engineering job, such as Lab Technician. + SCIENCE_AND_ENGINEERING = 27 + + # A social services or non-profit job, such as Case Worker. + SOCIAL_SERVICES_AND_NON_PROFIT = 28 + + # A sports, fitness, or recreation job, such as Personal Trainer. + SPORTS_FITNESS_AND_RECREATION = 29 + + # A transportation or logistics job, such as Truck Driver. + TRANSPORTATION_AND_LOGISTICS = 30 + end + + # An enum that represents the job posting region. In most cases, job postings + # don't need to specify a region. If a region is given, jobs are + # eligible for searches in the specified region. + module PostingRegion + # If the region is unspecified, the job is only returned if it + # matches the {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter}. + POSTING_REGION_UNSPECIFIED = 0 + + # In addition to exact location matching, job posting is returned when the + # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} in the search + # query is in the same administrative area as the returned job posting. For + # example, if a `ADMINISTRATIVE_AREA` job is posted in "CA, USA", it's + # returned if {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} + # has "Mountain View". + # + # Administrative area refers to top-level administrative subdivision of this + # country. For example, US state, IT region, UK constituent nation and + # JP prefecture. + ADMINISTRATIVE_AREA = 1 + + # In addition to exact location matching, job is returned when + # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} in search + # query is in the same country as this job. For example, if a `NATION_WIDE` + # job is posted in "USA", it's returned if + # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} has 'Mountain + # View'. + NATION = 2 + + # Job allows employees to work remotely (telecommute). + # If locations are provided with this value, the job is + # considered as having a location, but telecommuting is allowed. + TELECOMMUTE = 3 + end + + # Deprecated. All resources are only visible to the owner. + # + # An enum that represents who has view access to the resource. + # @deprecated This enum is deprecated and may be removed in the next major version update. + module Visibility + # Default value. + VISIBILITY_UNSPECIFIED = 0 + + # The resource is only visible to the GCP account who owns it. + ACCOUNT_ONLY = 1 + + # The resource is visible to the owner and may be visible to other + # applications and processes at Google. + SHARED_WITH_GOOGLE = 2 + + # The resource is visible to the owner and may be visible to all other API + # clients. + SHARED_WITH_PUBLIC = 3 + end + + # Option for HTML content sanitization on user input fields, for example, job + # description. By setting this option, user can determine whether and how + # sanitization is performed on these fields. + module HtmlSanitization + # Default value. + HTML_SANITIZATION_UNSPECIFIED = 0 + + # Disables sanitization on HTML input. + HTML_SANITIZATION_DISABLED = 1 + + # Sanitizes HTML input, only accepts bold, italic, ordered list, and + # unordered list markup tags. + SIMPLE_FORMATTING_ONLY = 2 + end + + # Method for commute. + module CommuteMethod + # Commute method isn't specified. + COMMUTE_METHOD_UNSPECIFIED = 0 + + # Commute time is calculated based on driving time. + DRIVING = 1 + + # Commute time is calculated based on public transit including bus, metro, + # subway, and so on. + TRANSIT = 2 + + # Commute time is calculated based on walking time. + WALKING = 3 + + # Commute time is calculated based on biking time. + CYCLING = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb new file mode 100644 index 000000000000..d6890a73d259 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # A Company resource represents a company in the service. A company is the + # entity that owns job postings, that is, the hiring entity responsible for + # employing applicants for the job position. + # @!attribute [rw] name + # @return [::String] + # Required during company update. + # + # The resource name for a company. This is generated by the service when a + # company is created. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/companies/bar". + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the company, for example, "Google LLC". + # @!attribute [rw] external_id + # @return [::String] + # Required. Client side company identifier, used to uniquely identify the + # company. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] size + # @return [::Google::Cloud::Talent::V4beta1::CompanySize] + # The employer's company size. + # @!attribute [rw] headquarters_address + # @return [::String] + # The street address of the company's main headquarters, which may be + # different from the job location. The service attempts + # to geolocate the provided address, and populates a more specific + # location wherever possible in + # {::Google::Cloud::Talent::V4beta1::Company::DerivedInfo#headquarters_location DerivedInfo.headquarters_location}. + # @!attribute [rw] hiring_agency + # @return [::Boolean] + # Set to true if it is the hiring agency that post jobs for other + # employers. + # + # Defaults to false if not provided. + # @!attribute [rw] eeo_text + # @return [::String] + # Equal Employment Opportunity legal disclaimer text to be + # associated with all jobs, and typically to be displayed in all + # roles. + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] website_uri + # @return [::String] + # The URI representing the company's primary web site or home page, + # for example, "https://www.google.com". + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] career_site_uri + # @return [::String] + # The URI to employer's career site or careers page on the employer's web + # site, for example, "https://careers.google.com". + # @!attribute [rw] image_uri + # @return [::String] + # A URI that hosts the employer's company logo. + # @!attribute [rw] keyword_searchable_job_custom_attributes + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # This field is deprecated. Please set the searchability of the custom + # attribute in the + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} + # going forward. + # + # A list of keys of filterable + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}, + # whose corresponding `string_values` are used in keyword searches. Jobs with + # `string_values` under these specified field keys are returned if any + # of the values match the search keyword. Custom field values with + # parenthesis, brackets and special symbols are not searchable as-is, + # and those keyword queries must be surrounded by quotes. + # @!attribute [r] derived_info + # @return [::Google::Cloud::Talent::V4beta1::Company::DerivedInfo] + # Output only. Derived details about the company. + # @!attribute [r] suspended + # @return [::Boolean] + # Output only. Indicates whether a company is flagged to be suspended from + # public availability by the service when job content appears suspicious, + # abusive, or spammy. + class Company + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Derived details about the company. + # @!attribute [rw] headquarters_location + # @return [::Google::Cloud::Talent::V4beta1::Location] + # A structured headquarters location of the company, resolved from + # {::Google::Cloud::Talent::V4beta1::Company#headquarters_address Company.headquarters_address} + # if provided. + class DerivedInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb new file mode 100644 index 000000000000..d4047c822aef --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # The Request of the CreateCompany method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created, for example, "projects/foo". + # @!attribute [rw] company + # @return [::Google::Cloud::Talent::V4beta1::Company] + # Required. The company to be created. + class CreateCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a company by name. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the company to be retrieved. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/api-test-project/tenants/foo/companies/bar". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/api-test-project/companies/bar". + class GetCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for updating a specified company. + # @!attribute [rw] company + # @return [::Google::Cloud::Talent::V4beta1::Company] + # Required. The company resource to replace the current resource in the + # system. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are + # updated. Otherwise all the fields are updated. + # + # A field mask to specify the company fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Company Company} are + # supported. + class UpdateCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a company. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the company to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo/companies/bar". + class DeleteCompanyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List companies for which the client has ACL visibility. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the company is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". + # + # If tenant id is unspecified, the default tenant will be used, for + # example, "projects/foo". + # @!attribute [rw] page_token + # @return [::String] + # The starting indicator from which to return results. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of companies to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + # @!attribute [rw] require_open_jobs + # @return [::Boolean] + # Set to true if the companies requested must have open jobs. + # + # Defaults to false. + # + # If true, at most + # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of + # companies are fetched, among which only those with open jobs are returned. + class ListCompaniesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The List companies response object. + # @!attribute [rw] companies + # @return [::Array<::Google::Cloud::Talent::V4beta1::Company>] + # Companies for the current client. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListCompaniesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb new file mode 100644 index 000000000000..dea145e5da33 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # Auto-complete parameters. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of tenant the completion is performed within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo". + # @!attribute [rw] query + # @return [::String] + # Required. The query used to generate suggestions. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # The list of languages of the query. This is + # the BCP-47 language code, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] page_size + # @return [::Integer] + # Required. Completion result count. + # + # The maximum allowed page size is 10. + # @!attribute [rw] company + # @return [::String] + # If provided, restricts completion to specified company. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used, for + # example, "projects/foo". + # @!attribute [rw] scope + # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope] + # The scope of the completion. The defaults is + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] + # The completion topic. The default is + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. + class CompleteQueryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to specify the scope of completion. + module CompletionScope + # Default value. + COMPLETION_SCOPE_UNSPECIFIED = 0 + + # Suggestions are based only on the data provided by the client. + TENANT = 1 + + # Suggestions are based on all jobs data in the system that's visible to + # the client + PUBLIC = 2 + end + + # Enum to specify auto-completion topics. + module CompletionType + # Default value. + COMPLETION_TYPE_UNSPECIFIED = 0 + + # Suggest job titles for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::JOB_TITLE CompletionType.JOB_TITLE} + # type, only open jobs with the same + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} + # are returned. + JOB_TITLE = 1 + + # Suggest company names for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMPANY_NAME CompletionType.COMPANY_NAME} + # type, only companies having open jobs with the same + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} + # are returned. + COMPANY_NAME = 2 + + # Suggest both job titles and company names for jobs autocomplete. + # + # For + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED} + # type, only open jobs with the same + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} + # or companies having open jobs with the same + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} + # are returned. + COMBINED = 3 + end + end + + # Response of auto-complete query. + # @!attribute [rw] completion_results + # @return [::Array<::Google::Cloud::Talent::V4beta1::CompleteQueryResponse::CompletionResult>] + # Results of the matching job/company candidates. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class CompleteQueryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Resource that represents completion results. + # @!attribute [rw] suggestion + # @return [::String] + # The suggestion for the query. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] + # The completion topic. + # @!attribute [rw] image_uri + # @return [::String] + # The URI of the company image for + # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMPANY_NAME COMPANY_NAME}. + class CompletionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb new file mode 100644 index 000000000000..c38408da15b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # An event issued when an end user interacts with the application that + # implements Cloud Talent Solution. Providing this information improves the + # quality of results for the API clients, enabling the + # service to perform optimally. The number of events sent must be consistent + # with other calls, such as job searches, issued to the service by the client. + # @!attribute [rw] request_id + # @return [::String] + # Strongly recommended for the best service experience. + # + # A unique ID generated in the API responses. It can be found in + # {::Google::Cloud::Talent::V4beta1::ResponseMetadata#request_id ResponseMetadata.request_id}. + # @!attribute [rw] event_id + # @return [::String] + # Required. A unique identifier, generated by the client application. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Required. The timestamp of the event. + # @!attribute [rw] job_event + # @return [::Google::Cloud::Talent::V4beta1::JobEvent] + # An event issued when a job seeker interacts with the application that + # implements Cloud Talent Solution. + # @!attribute [rw] event_notes + # @return [::String] + # Notes about the event provided by recruiters or other users, for example, + # feedback on why a profile was bookmarked. + class ClientEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event issued when a job seeker interacts with the application that + # implements Cloud Talent Solution. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType] + # Required. The type of the event (see + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType JobEventType}). + # @!attribute [rw] jobs + # @return [::Array<::String>] + # Required. The [job name(s)][google.cloud.talent.v4beta1.Job.name] + # associated with this event. For example, if this is an + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::IMPRESSION impression} + # event, this field contains the identifiers of all jobs shown to the job + # seeker. If this was a + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::VIEW view} event, this + # field contains the identifier of the viewed job. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}", for + # example, "projects/foo/tenants/bar/jobs/baz". + # @!attribute [rw] profile + # @return [::String] + # The [profile name][google.cloud.talent.v4beta1.Profile.name] associated + # with this client event. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/profiles/\\{profile_id}", + # for example, "projects/foo/tenants/bar/profiles/baz". + class JobEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An enumeration of an event attributed to the behavior of the end user, + # such as a job seeker. + module JobEventType + # The event is unspecified by other provided values. + JOB_EVENT_TYPE_UNSPECIFIED = 0 + + # The job seeker or other entity interacting with the service has + # had a job rendered in their view, such as in a list of search results in + # a compressed or clipped format. This event is typically associated with + # the viewing of a jobs list on a single page by a job seeker. + IMPRESSION = 1 + + # The job seeker, or other entity interacting with the service, has + # viewed the details of a job, including the full description. This + # event doesn't apply to the viewing a snippet of a job appearing as a + # part of the job search results. Viewing a snippet is associated with an + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::IMPRESSION impression}). + VIEW = 2 + + # The job seeker or other entity interacting with the service + # performed an action to view a job and was redirected to a different + # website for job. + VIEW_REDIRECT = 3 + + # The job seeker or other entity interacting with the service + # began the process or demonstrated the intention of applying for a job. + APPLICATION_START = 4 + + # The job seeker or other entity interacting with the service + # submitted an application for a job. + APPLICATION_FINISH = 5 + + # The job seeker or other entity interacting with the service + # submitted an application for a job with a single click without + # entering information. If a job seeker performs this action, send only + # this event to the service. Do not also send + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START} + # or + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} + # events. + APPLICATION_QUICK_SUBMISSION = 6 + + # The job seeker or other entity interacting with the service + # performed an action to apply to a job and was redirected to a different + # website to complete the application. + APPLICATION_REDIRECT = 7 + + # The job seeker or other entity interacting with the service began the + # process or demonstrated the intention of applying for a job from the + # search results page without viewing the details of the job posting. + # If sending this event, JobEventType.VIEW event shouldn't be sent. + APPLICATION_START_FROM_SEARCH = 8 + + # The job seeker, or other entity interacting with the service, performs an + # action with a single click from the search results page to apply to a job + # (without viewing the details of the job posting), and is redirected + # to a different website to complete the application. If a candidate + # performs this action, send only this event to the service. Do not also + # send + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START}, + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} + # or + # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::VIEW JobEventType.VIEW} + # events. + APPLICATION_REDIRECT_FROM_SEARCH = 9 + + # This event should be used when a company submits an application + # on behalf of a job seeker. This event is intended for use by staffing + # agencies attempting to place candidates. + APPLICATION_COMPANY_SUBMIT = 10 + + # The job seeker or other entity interacting with the service demonstrated + # an interest in a job by bookmarking or saving it. + BOOKMARK = 11 + + # The job seeker or other entity interacting with the service was + # sent a notification, such as an email alert or device notification, + # containing one or more jobs listings generated by the service. + NOTIFICATION = 12 + + # The job seeker or other entity interacting with the service was + # employed by the hiring entity (employer). Send this event + # only if the job seeker was hired through an application that was + # initiated by a search conducted through the Cloud Talent Solution + # service. + HIRED = 13 + + # A recruiter or staffing agency submitted an application on behalf of the + # candidate after interacting with the service to identify a suitable job + # posting. + SENT_CV = 14 + + # The entity interacting with the service (for example, the job seeker), + # was granted an initial interview by the hiring entity (employer). This + # event should only be sent if the job seeker was granted an interview as + # part of an application that was initiated by a search conducted through / + # recommendation provided by the Cloud Talent Solution service. + INTERVIEW_GRANTED = 15 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb new file mode 100644 index 000000000000..4423eac5eaf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # The report event request. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the tenant under which the event is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created, for example, "projects/foo". + # @!attribute [rw] client_event + # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] + # Required. Events issued when end user interacts with customer's application + # that uses Cloud Talent Solution. + class CreateClientEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb new file mode 100644 index 000000000000..70809323a188 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb @@ -0,0 +1,404 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # The query required to perform a search query. + # @!attribute [rw] query + # @return [::String] + # The query string that matches against the job title, description, and + # location fields. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] query_language_code + # @return [::String] + # The language code of {::Google::Cloud::Talent::V4beta1::JobQuery#query query}. + # For example, "en-US". This field helps to better interpret the query. + # + # If a value isn't specified, the query language code is automatically + # detected, which may not be accurate. + # + # Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # @!attribute [rw] companies + # @return [::Array<::String>] + # This filter specifies the company entities to search against. + # + # If a value isn't specified, jobs are searched for against all + # companies. + # + # If multiple values are specified, jobs are searched against the + # companies specified. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/companies/bar". + # + # At most 20 company filters are allowed. + # @!attribute [rw] location_filters + # @return [::Array<::Google::Cloud::Talent::V4beta1::LocationFilter>] + # The location filter specifies geo-regions containing the jobs to + # search against. See + # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} for more + # information. + # + # If a location value isn't specified, jobs fitting the other search + # criteria are retrieved regardless of where they're located. + # + # If multiple values are specified, jobs are retrieved from any of the + # specified locations. If different values are specified for the + # {::Google::Cloud::Talent::V4beta1::LocationFilter#distance_in_miles LocationFilter.distance_in_miles} + # parameter, the maximum provided distance is used for all locations. + # + # At most 5 location filters are allowed. + # @!attribute [rw] job_categories + # @return [::Array<::Google::Cloud::Talent::V4beta1::JobCategory>] + # The category filter specifies the categories of jobs to search against. + # See {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory} for more + # information. + # + # If a value isn't specified, jobs from any category are searched against. + # + # If multiple values are specified, jobs from any of the specified + # categories are searched against. + # @!attribute [rw] commute_filter + # @return [::Google::Cloud::Talent::V4beta1::CommuteFilter] + # Allows filtering jobs by commute time with different travel methods (for + # example, driving or public transit). + # + # Note: This only works when you specify a + # {::Google::Cloud::Talent::V4beta1::CommuteMethod CommuteMethod}. In this case, + # {::Google::Cloud::Talent::V4beta1::JobQuery#location_filters location_filters} + # is ignored. + # + # Currently we don't support sorting by commute time. + # @!attribute [rw] company_display_names + # @return [::Array<::String>] + # This filter specifies the company + # {::Google::Cloud::Talent::V4beta1::Company#display_name Company.display_name} of + # the jobs to search against. The company name must match the value exactly. + # + # Alternatively, the value being searched for can be wrapped in different + # match operators. + # `SUBSTRING_MATCH([value])` + # The company name must contain a case insensitive substring match of the + # value. Using this function may increase latency. + # + # Sample Value: `SUBSTRING_MATCH(google)` + # + # `MULTI_WORD_TOKEN_MATCH([value])` + # The value will be treated as a multi word token and the company name must + # contain a case insensitive match of the value. Using this function may + # increase latency. + # + # Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` + # + # If a value isn't specified, jobs within the search results are + # associated with any company. + # + # If multiple values are specified, jobs within the search results may be + # associated with any of the specified companies. + # + # At most 20 company display name filters are allowed. + # @!attribute [rw] compensation_filter + # @return [::Google::Cloud::Talent::V4beta1::CompensationFilter] + # This search filter is applied only to + # {::Google::Cloud::Talent::V4beta1::Job#compensation_info Job.compensation_info}. + # For example, if the filter is specified as "Hourly job with per-hour + # compensation > $15", only jobs meeting these criteria are searched. If a + # filter isn't defined, all open jobs are searched. + # @!attribute [rw] custom_attribute_filter + # @return [::String] + # This filter specifies a structured syntax to match against the + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} + # marked as `filterable`. + # + # The syntax for this expression is a subset of SQL syntax. + # + # Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the + # left of the operator is a custom field key and the right of the operator + # is a number or a quoted string. You must escape backslash (\\) and + # quote (\") characters. + # + # Supported functions are `LOWER([field_name])` to + # perform a case insensitive match and `EMPTY([field_name])` to filter on the + # existence of a key. + # + # Boolean expressions (AND/OR/NOT) are supported up to 3 levels of + # nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 + # comparisons or functions are allowed in the expression. The expression + # must be < 10000 bytes in length. + # + # Sample Query: + # `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND + # driving_years > 10` + # @!attribute [rw] disable_spell_check + # @return [::Boolean] + # This flag controls the spell-check feature. If false, the + # service attempts to correct a misspelled query, + # for example, "enginee" is corrected to "engineer". + # + # Defaults to false: a spell check is performed. + # @!attribute [rw] employment_types + # @return [::Array<::Google::Cloud::Talent::V4beta1::EmploymentType>] + # The employment type filter specifies the employment type of jobs to + # search against, such as + # {::Google::Cloud::Talent::V4beta1::EmploymentType::FULL_TIME EmploymentType.FULL_TIME}. + # + # If a value isn't specified, jobs in the search results includes any + # employment type. + # + # If multiple values are specified, jobs in the search results include + # any of the specified employment types. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # This filter specifies the locale of jobs to search against, + # for example, "en-US". + # + # If a value isn't specified, the search results can contain jobs in any + # locale. + # + # + # Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). + # + # At most 10 language code filters are allowed. + # @!attribute [rw] publish_time_range + # @return [::Google::Cloud::Talent::V4beta1::TimestampRange] + # Jobs published within a range specified by this filter are searched + # against. + # @!attribute [rw] excluded_jobs + # @return [::Array<::String>] + # This filter specifies a list of job names to be excluded during search. + # + # At most 400 excluded job names are allowed. + class JobQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Geographic region of the search. + # @!attribute [rw] address + # @return [::String] + # The address name, such as "Mountain View" or "Bay Area". + # @!attribute [rw] region_code + # @return [::String] + # CLDR region code of the country/region. This field may be used in two ways: + # + # 1) If telecommute preference is not set, this field is used address + # ambiguity of the user-input address. For example, "Liverpool" may refer to + # "Liverpool, NY, US" or "Liverpool, UK". This region code biases the + # address resolution toward a specific country or territory. If this field is + # not set, address resolution is biased toward the United States by default. + # + # 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the + # telecommute location filter will be limited to the region specified in this + # field. If this field is not set, the telecommute job locations will not be + # + # See + # https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # The latitude and longitude of the geographic center to search from. This + # field is ignored if `address` is provided. + # @!attribute [rw] distance_in_miles + # @return [::Float] + # The distance_in_miles is applied when the location being searched for is + # identified as a city or smaller. This field is ignored if the location + # being searched for is a state or larger. + # @!attribute [rw] telecommute_preference + # @return [::Google::Cloud::Talent::V4beta1::LocationFilter::TelecommutePreference] + # Allows the client to return jobs without a + # set location, specifically, telecommuting jobs (telecommuting is considered + # by the service as a special location). + # {::Google::Cloud::Talent::V4beta1::Job#posting_region Job.posting_region} + # indicates if a job permits telecommuting. If this field is set to + # {::Google::Cloud::Talent::V4beta1::LocationFilter::TelecommutePreference::TELECOMMUTE_ALLOWED TelecommutePreference.TELECOMMUTE_ALLOWED}, + # telecommuting jobs are searched, and + # {::Google::Cloud::Talent::V4beta1::LocationFilter#address address} and + # {::Google::Cloud::Talent::V4beta1::LocationFilter#lat_lng lat_lng} are ignored. + # If not set or set to + # {::Google::Cloud::Talent::V4beta1::LocationFilter::TelecommutePreference::TELECOMMUTE_EXCLUDED TelecommutePreference.TELECOMMUTE_EXCLUDED}, + # the telecommute status of the jobs is ignored. Jobs that have + # {::Google::Cloud::Talent::V4beta1::PostingRegion::TELECOMMUTE PostingRegion.TELECOMMUTE} + # and have additional + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses} may still be + # matched based on other location filters using + # {::Google::Cloud::Talent::V4beta1::LocationFilter#address address} or + # [latlng][]. + # + # This filter can be used by itself to search exclusively for telecommuting + # jobs, or it can be combined with another location + # filter to search for a combination of job locations, + # such as "Mountain View" or "telecommuting" jobs. However, when used in + # combination with other location filters, telecommuting jobs can be + # treated as less relevant than other jobs in the search response. + # + # This field is only used for job search requests. + # @!attribute [rw] negated + # @return [::Boolean] + # Whether to apply negation to the filter so profiles matching the filter + # are excluded. + class LocationFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specify whether to include telecommute jobs. + module TelecommutePreference + # Default value if the telecommute preference isn't specified. + TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 + + # Deprecated: Ignore telecommute status of jobs. Use + # TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. + TELECOMMUTE_EXCLUDED = 1 + + # Allow telecommute jobs. + TELECOMMUTE_ALLOWED = 2 + + # Exclude telecommute jobs. + TELECOMMUTE_JOBS_EXCLUDED = 3 + end + end + + # Filter on job compensation type and amount. + # @!attribute [rw] type + # @return [::Google::Cloud::Talent::V4beta1::CompensationFilter::FilterType] + # Required. Type of filter. + # @!attribute [rw] units + # @return [::Array<::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit>] + # Required. Specify desired `base compensation entry's` + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}. + # @!attribute [rw] range + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] + # Compensation range. + # @!attribute [rw] include_jobs_with_unspecified_compensation_range + # @return [::Boolean] + # If set to true, jobs with unspecified compensation range fields are + # included. + class CompensationFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specify the type of filtering. + module FilterType + # Filter type unspecified. Position holder, INVALID, should never be used. + FILTER_TYPE_UNSPECIFIED = 0 + + # Filter by `base compensation entry's` unit. A job is a match if and + # only if the job contains a base CompensationEntry and the base + # CompensationEntry's unit matches provided + # {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. Populate + # one or more + # {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. + # + # See + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} + # for definition of base compensation entry. + UNIT_ONLY = 1 + + # Filter by `base compensation entry's` unit and amount / range. A job + # is a match if and only if the job contains a base CompensationEntry, and + # the base entry's unit matches provided + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationUnit} + # and amount or range overlaps with provided + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange CompensationRange}. + # + # See + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} + # for definition of base compensation entry. + # + # Set exactly one + # {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units} and + # populate {::Google::Cloud::Talent::V4beta1::CompensationFilter#range range}. + UNIT_AND_AMOUNT = 2 + + # Filter by annualized base compensation amount and `base compensation + # entry's` unit. Populate + # {::Google::Cloud::Talent::V4beta1::CompensationFilter#range range} and zero or + # more {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. + ANNUALIZED_BASE_AMOUNT = 3 + + # Filter by annualized total compensation amount and `base compensation + # entry's` unit . Populate + # {::Google::Cloud::Talent::V4beta1::CompensationFilter#range range} and zero or + # more {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. + ANNUALIZED_TOTAL_AMOUNT = 4 + end + end + + # Parameters needed for commute search. + # @!attribute [rw] commute_method + # @return [::Google::Cloud::Talent::V4beta1::CommuteMethod] + # Required. The method of transportation to calculate the commute time for. + # @!attribute [rw] start_coordinates + # @return [::Google::Type::LatLng] + # Required. The latitude and longitude of the location to calculate the + # commute time from. + # @!attribute [rw] travel_duration + # @return [::Google::Protobuf::Duration] + # Required. The maximum travel time in seconds. The maximum allowed value is + # `3600s` (one hour). Format is `123s`. + # @!attribute [rw] allow_imprecise_addresses + # @return [::Boolean] + # If `true`, jobs without street level addresses may also be returned. + # For city level addresses, the city center is used. For state and coarser + # level addresses, text matching is used. + # If this field is set to `false` or isn't specified, only jobs that include + # street level addresses will be returned by commute search. + # @!attribute [rw] road_traffic + # @return [::Google::Cloud::Talent::V4beta1::CommuteFilter::RoadTraffic] + # Specifies the traffic density to use when calculating commute time. + # + # Note: The following fields are mutually exclusive: `road_traffic`, `departure_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] departure_time + # @return [::Google::Type::TimeOfDay] + # The departure time used to calculate traffic impact, represented as + # {::Google::Type::TimeOfDay google.type.TimeOfDay} in local time zone. + # + # Currently traffic model is restricted to hour level resolution. + # + # Note: The following fields are mutually exclusive: `departure_time`, `road_traffic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class CommuteFilter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The traffic density to use when calculating commute time. + module RoadTraffic + # Road traffic situation isn't specified. + ROAD_TRAFFIC_UNSPECIFIED = 0 + + # Optimal commute time without considering any traffic impact. + TRAFFIC_FREE = 1 + + # Commute time calculation takes in account the peak traffic impact. + BUSY_HOUR = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb new file mode 100644 index 000000000000..1762ad476d9f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # The histogram request. + # @!attribute [rw] histogram_query + # @return [::String] + # An expression specifies a histogram request against matching resources + # (for example, jobs, profiles) for searches. + # + # See + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries} + # and + # [SearchProfilesRequest.histogram_queries][google.cloud.talent.v4beta1.SearchProfilesRequest.histogram_queries] + # for details about syntax. + class HistogramQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Histogram result that matches + # {::Google::Cloud::Talent::V4beta1::HistogramQuery HistogramQuery} specified in + # searches. + # @!attribute [rw] histogram_query + # @return [::String] + # Requested histogram expression. + # @!attribute [rw] histogram + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # A map from the values of the facet associated with distinct values to the + # number of matching entries with corresponding value. + # + # The key format is: + # + # * (for string histogram) string values stored in the field. + # * (for named numeric bucket) name specified in `bucket()` function, like + # for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. + # * (for anonymous numeric bucket) range formatted as `-`, for + # example, `0-1000`, `MIN-0`, and `0-MAX`. + class HistogramQueryResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class HistogramEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb new file mode 100644 index 000000000000..9790455fe3f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # A Job resource represents a job posting (also referred to as a "job listing" + # or "job requisition"). A job belongs to a + # {::Google::Cloud::Talent::V4beta1::Company Company}, which is the hiring entity + # responsible for the job. + # @!attribute [rw] name + # @return [::String] + # Required during job update. + # + # The resource name for the job. This is generated by the service when a + # job is created. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/jobs/bar". + # + # Use of this field in job queries and API calls is preferred over the use of + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id} since this + # value is unique. + # @!attribute [rw] company + # @return [::String] + # Required. The resource name of the company listing the job. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For + # example, "projects/foo/tenants/bar/companies/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/companies/bar". + # @!attribute [rw] requisition_id + # @return [::String] + # Required. The requisition ID, also referred to as the posting ID, is + # assigned by the client to identify a job. This field is intended to be used + # by clients for client identification and tracking of postings. A job isn't + # allowed to be created if there is another job with the same + # {::Google::Cloud::Talent::V4beta1::Job#name company}, + # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the job, such as "Software Engineer" + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] description + # @return [::String] + # Required. The description of the job, which typically includes a + # multi-paragraph description of the company and related information. + # Separate fields are provided on the job object for + # {::Google::Cloud::Talent::V4beta1::Job#responsibilities responsibilities}, + # {::Google::Cloud::Talent::V4beta1::Job#qualifications qualifications}, and other + # job characteristics. Use of these separate job fields is recommended. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 100,000. + # @!attribute [rw] addresses + # @return [::Array<::String>] + # Strongly recommended for the best service experience. + # + # Location(s) where the employer is looking to hire for this job posting. + # + # Specifying the full street address(es) of the hiring location enables + # better API results, especially job searches by commute time. + # + # At most 50 locations are allowed for best search performance. If a job has + # more locations, it is suggested to split it into multiple jobs with unique + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}s (e.g. + # 'ReqA' becomes 'ReqA-1', 'ReqA-2', and so on.) as multiple jobs with the + # same {::Google::Cloud::Talent::V4beta1::Job#company company}, + # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id} are not + # allowed. If the original + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id} must be + # preserved, a custom field should be used for storage. It is also suggested + # to group the locations that close to each other in the same job for better + # search experience. + # + # The maximum number of allowed characters is 500. + # @!attribute [rw] application_info + # @return [::Google::Cloud::Talent::V4beta1::Job::ApplicationInfo] + # Job application information. + # @!attribute [rw] job_benefits + # @return [::Array<::Google::Cloud::Talent::V4beta1::JobBenefit>] + # The benefits included with the job. + # @!attribute [rw] compensation_info + # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo] + # Job compensation information (a.k.a. "pay rate") i.e., the compensation + # that will paid to the employee. + # @!attribute [rw] custom_attributes + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Talent::V4beta1::CustomAttribute}] + # A map of fields to hold both filterable and non-filterable custom job + # attributes that are not covered by the provided structured fields. + # + # The keys of the map are strings up to 64 bytes and must match the + # pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or + # KEY_1_LIKE_THIS. + # + # At most 100 filterable and at most 100 unfilterable keys are supported. + # For filterable `string_values`, across all keys at most 200 values are + # allowed, with each string no more than 255 characters. For unfilterable + # `string_values`, the maximum total size of `string_values` across all keys + # is 50KB. + # @!attribute [rw] degree_types + # @return [::Array<::Google::Cloud::Talent::V4beta1::DegreeType>] + # The desired education degrees for the job, such as Bachelors, Masters. + # @!attribute [rw] department + # @return [::String] + # The department or functional area within the company with the open + # position. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] employment_types + # @return [::Array<::Google::Cloud::Talent::V4beta1::EmploymentType>] + # The employment type(s) of a job, for example, + # {::Google::Cloud::Talent::V4beta1::EmploymentType::FULL_TIME full time} or + # {::Google::Cloud::Talent::V4beta1::EmploymentType::PART_TIME part time}. + # @!attribute [rw] incentives + # @return [::String] + # A description of bonus, commission, and other compensation + # incentives associated with the job not including salary or pay. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] language_code + # @return [::String] + # The language of the posting. This field is distinct from + # any requirements for fluency that are associated with the job. + # + # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". + # For more information, see + # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: + # class="external" target="_blank" }. + # + # If this field is unspecified and + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description} is present, + # detected language code based on + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description} is assigned, + # otherwise defaults to 'en_US'. + # @!attribute [rw] job_level + # @return [::Google::Cloud::Talent::V4beta1::JobLevel] + # The experience level associated with the job, such as "Entry Level". + # @!attribute [rw] promotion_value + # @return [::Integer] + # A promotion value of the job, as determined by the client. + # The value determines the sort order of the jobs returned when searching for + # jobs using the featured jobs search call, with higher promotional values + # being returned first and ties being resolved by relevance sort. Only the + # jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. + # + # Default value is 0, and negative values are treated as 0. + # @!attribute [rw] qualifications + # @return [::String] + # A description of the qualifications required to perform the + # job. The use of this field is recommended + # as an alternative to using the more general + # {::Google::Cloud::Talent::V4beta1::Job#description description} field. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] responsibilities + # @return [::String] + # A description of job responsibilities. The use of this field is + # recommended as an alternative to using the more general + # {::Google::Cloud::Talent::V4beta1::Job#description description} field. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 10,000. + # @!attribute [rw] posting_region + # @return [::Google::Cloud::Talent::V4beta1::PostingRegion] + # The job {::Google::Cloud::Talent::V4beta1::PostingRegion PostingRegion} (for + # example, state, country) throughout which the job is available. If this + # field is set, a + # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} in a search + # query within the job region finds this job posting if an exact location + # match isn't specified. If this field is set to + # {::Google::Cloud::Talent::V4beta1::PostingRegion::NATION PostingRegion.NATION} or + # {::Google::Cloud::Talent::V4beta1::PostingRegion::ADMINISTRATIVE_AREA PostingRegion.ADMINISTRATIVE_AREA}, + # setting job {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses} to + # the same location level as this field is strongly recommended. + # @!attribute [rw] visibility + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Talent::V4beta1::Visibility] + # Deprecated. The job is only visible to the owner. + # + # The visibility of the job. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::Visibility::ACCOUNT_ONLY Visibility.ACCOUNT_ONLY} + # if not specified. + # @!attribute [rw] job_start_time + # @return [::Google::Protobuf::Timestamp] + # The start timestamp of the job in UTC time zone. Typically this field + # is used for contracting engagements. Invalid timestamps are ignored. + # @!attribute [rw] job_end_time + # @return [::Google::Protobuf::Timestamp] + # The end timestamp of the job. Typically this field is used for contracting + # engagements. Invalid timestamps are ignored. + # @!attribute [rw] posting_publish_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp this job posting was most recently published. The default + # value is the time the request arrives at the server. Invalid timestamps are + # ignored. + # @!attribute [rw] posting_expire_time + # @return [::Google::Protobuf::Timestamp] + # Strongly recommended for the best service experience. + # + # The expiration timestamp of the job. After this timestamp, the + # job is marked as expired, and it no longer appears in search results. The + # expired job can't be listed by the + # {::Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs ListJobs} API, but it can + # be retrieved with the + # {::Google::Cloud::Talent::V4beta1::JobService::Client#get_job GetJob} API or updated with + # the {::Google::Cloud::Talent::V4beta1::JobService::Client#update_job UpdateJob} API or + # deleted with the + # {::Google::Cloud::Talent::V4beta1::JobService::Client#delete_job DeleteJob} API. An + # expired job can be updated and opened again by using a future expiration + # timestamp. Updating an expired job fails if there is another existing open + # job with same {::Google::Cloud::Talent::V4beta1::Job#company company}, + # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}. + # + # The expired jobs are retained in our system for 90 days. However, the + # overall expired job count cannot exceed 3 times the maximum number of + # open jobs over previous 7 days. If this threshold is exceeded, + # expired jobs are cleaned out in order of earliest expire time. + # Expired jobs are no longer accessible after they are cleaned + # out. + # + # Invalid timestamps are ignored, and treated as expire time not provided. + # + # If the timestamp is before the instant request is made, the job + # is treated as expired immediately on creation. This kind of job can + # not be updated. And when creating a job with past timestamp, the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time posting_publish_time} + # must be set before + # {::Google::Cloud::Talent::V4beta1::Job#posting_expire_time posting_expire_time}. + # The purpose of this feature is to allow other objects, such as + # [Application][google.cloud.talent.v4beta1.Application], to refer a job that + # didn't exist in the system prior to becoming expired. If you want to modify + # a job that was expired on creation, delete it and create a new one. + # + # If this value isn't provided at the time of job creation or is invalid, + # the job posting expires after 30 days from the job's creation time. For + # example, if the job was created on 2017/01/01 13:00AM UTC with an + # unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. + # + # If this value isn't provided on job update, it depends on the field masks + # set by + # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask UpdateJobRequest.update_mask}. + # If the field masks include + # {::Google::Cloud::Talent::V4beta1::Job#job_end_time job_end_time}, or the masks + # are empty meaning that every field is updated, the job posting expires + # after 30 days from the job's last update time. Otherwise the expiration + # date isn't updated. + # @!attribute [r] posting_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this job posting was created. + # @!attribute [r] posting_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when this job posting was last updated. + # @!attribute [r] company_display_name + # @return [::String] + # Output only. Display name of the company listing the job. + # @!attribute [r] derived_info + # @return [::Google::Cloud::Talent::V4beta1::Job::DerivedInfo] + # Output only. Derived details about the job posting. + # @!attribute [rw] processing_options + # @return [::Google::Cloud::Talent::V4beta1::Job::ProcessingOptions] + # Options for job processing. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Application related details of a job posting. + # @!attribute [rw] emails + # @return [::Array<::String>] + # Use this field to specify email address(es) to which resumes or + # applications can be sent. + # + # The maximum number of allowed characters for each entry is 255. + # @!attribute [rw] instruction + # @return [::String] + # Use this field to provide instructions, such as "Mail your application + # to ...", that a candidate can follow to apply for the job. + # + # This field accepts and sanitizes HTML input, and also accepts + # bold, italic, ordered list, and unordered list markup tags. + # + # The maximum number of allowed characters is 3,000. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Use this URI field to direct an applicant to a website, for example to + # link to an online application form. + # + # The maximum number of allowed characters for each entry is 2,000. + class ApplicationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Derived details about the job posting. + # @!attribute [rw] locations + # @return [::Array<::Google::Cloud::Talent::V4beta1::Location>] + # Structured locations of the job, resolved from + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}. + # + # {::Google::Cloud::Talent::V4beta1::Job::DerivedInfo#locations locations} are + # exactly matched to + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses} in the same + # order. + # @!attribute [rw] job_categories + # @return [::Array<::Google::Cloud::Talent::V4beta1::JobCategory>] + # Job categories derived from + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title} and + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}. + class DerivedInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for job processing. + # @!attribute [rw] disable_street_address_resolution + # @return [::Boolean] + # If set to `true`, the service does not attempt to resolve a + # more precise address for the job. + # @!attribute [rw] html_sanitization + # @return [::Google::Cloud::Talent::V4beta1::HtmlSanitization] + # Option for job HTML content sanitization. Applied fields are: + # + # * description + # * applicationInfo.instruction + # * incentives + # * qualifications + # * responsibilities + # + # HTML tags in these fields may be stripped if sanitiazation isn't + # disabled. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::HtmlSanitization::SIMPLE_FORMATTING_ONLY HtmlSanitization.SIMPLE_FORMATTING_ONLY}. + class ProcessingOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Talent::V4beta1::CustomAttribute] + class CustomAttributesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb new file mode 100644 index 000000000000..82110737d6ce --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb @@ -0,0 +1,914 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # Create job request. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified a default tenant + # is created. For example, "projects/foo". + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4beta1::Job] + # Required. The Job to be created. + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Get job request. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the job to retrieve. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/jobs/bar". + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Update job request. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4beta1::Job] + # Required. The Job to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. + # Otherwise all the fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Delete job request. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the job to be deleted. + # + # The format is + # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For + # example, "projects/foo/tenants/bar/jobs/baz". + # + # If tenant id is unspecified, the default tenant is used. For + # example, "projects/foo/jobs/bar". + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Batch delete jobs request. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @!attribute [rw] filter + # @return [::String] + # Required. The filter string specifies the jobs to be deleted. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` (Required) + # * `requisitionId` (Required) + # + # Sample Query: companyName = "projects/foo/companies/bar" AND + # requisitionId = "req-1" + class BatchDeleteJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List jobs request. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @!attribute [rw] filter + # @return [::String] + # Required. The filter string specifies the jobs to be enumerated. + # + # Supported operator: =, AND + # + # The fields eligible for filtering are: + # + # * `companyName` + # * `requisitionId` + # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to + # OPEN if no value is specified. + # + # At least one of `companyName` and `requisitionId` must present or an + # INVALID_ARGUMENT error is thrown. + # + # Sample Query: + # + # * companyName = "projects/foo/tenants/bar/companies/baz" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # requisitionId = "req-1" + # * companyName = "projects/foo/tenants/bar/companies/baz" AND + # status = "EXPIRED" + # * requisitionId = "req-1" + # * requisitionId = "req-1" AND status = "EXPIRED" + # @!attribute [rw] page_token + # @return [::String] + # The starting point of a query result. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of jobs to be returned per page of results. + # + # If {::Google::Cloud::Talent::V4beta1::ListJobsRequest#job_view job_view} is set + # to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, + # the maximum allowed page size is 1000. Otherwise, the maximum allowed page + # size is 100. + # + # Default is 100 if empty or a number < 1 is specified. + # @!attribute [rw] job_view + # @return [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the + # search response. Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} + # if no value is specified. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List jobs response. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4beta1::Job>] + # The Jobs for a given company. + # + # The maximum number of items returned is based on the limit field + # provided in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Request body of the `SearchJobs` call. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant to search within. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @!attribute [rw] search_mode + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] + # Mode of a search. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. + # @!attribute [rw] request_metadata + # @return [::Google::Cloud::Talent::V4beta1::RequestMetadata] + # Required. The meta information collected about the job searcher, used to + # improve the search quality of the service. The identifiers (such as + # `user_id`) are provided by users, and must be unique and consistent. + # @!attribute [rw] job_query + # @return [::Google::Cloud::Talent::V4beta1::JobQuery] + # Query used to search against jobs, such as keyword, location filters, etc. + # @!attribute [rw] enable_broadening + # @return [::Boolean] + # Controls whether to broaden the search when it produces sparse results. + # Broadened queries append results to the end of the matching results + # list. + # + # Defaults to false. + # @!attribute [rw] require_precise_result_size + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # This field is deprecated. + # @!attribute [rw] histogram_queries + # @return [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery>] + # An expression specifies a histogram request against matching jobs. + # + # Expression syntax is an aggregation function call with histogram facets and + # other options. + # + # Available aggregation function calls are: + # * `count(string_histogram_facet)`: Count the number of matching entities, + # for each distinct attribute value. + # * `count(numeric_histogram_facet, list of buckets)`: Count the number of + # matching entities within each bucket. + # + # A maximum of 200 histogram buckets are supported. + # + # Data types: + # + # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. + # * String: string like "any string with backslash escape for quote(\")." + # * Number: whole number and floating point number like 10, -1 and -0.01. + # * List: list of elements with comma(,) separator surrounded by square + # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. + # + # Built-in constants: + # + # * MIN (minimum number similar to java Double.MIN_VALUE) + # * MAX (maximum number similar to java Double.MAX_VALUE) + # + # Built-in functions: + # + # * bucket(start, end[, label]): bucket built-in function creates a bucket + # with range of [start, end). Note that the end is exclusive, for example, + # bucket(1, MAX, "positive number") or bucket(1, 10). + # + # Job histogram facets: + # + # * company_display_name: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. + # * employment_type: histogram by + # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, + # for example, + # "FULL_TIME", "PART_TIME". + # * company_size (DEPRECATED): histogram by + # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". + # * publish_time_in_day: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in days. + # Must specify list of numeric buckets in spec. + # * publish_time_in_month: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in months. + # Must specify list of numeric buckets in spec. + # * publish_time_in_year: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # in years. + # Must specify list of numeric buckets in spec. + # * degree_types: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for + # example, + # "Bachelors", "Masters". + # * job_level: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, + # "Entry + # Level". + # * country: histogram by the country code of jobs, for example, "US", "FR". + # * admin1: histogram by the admin1 code of jobs, which is a global + # placeholder referring to the state, province, or the particular term a + # country uses to define the geographic structure below the country level, + # for example, "CA", "IL". + # * city: histogram by a combination of the "city name, admin1 code". For + # example, "Mountain View, CA", "New York, NY". + # * admin1_country: histogram by a combination of the "admin1 code, country", + # for example, "CA, US", "IL, US". + # * city_coordinate: histogram by the city center's GPS coordinates (latitude + # and longitude), for example, 37.4038522,-122.0987765. Since the + # coordinates of a city center can change, customers may need to refresh + # them periodically. + # * locale: histogram by the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for + # example, "en-US", + # "fr-FR". + # * language: histogram by the language subtag of the + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, + # for example, "en", "fr". + # * category: histogram by the + # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, + # "COMPUTER_AND_IT", "HEALTHCARE". + # * base_compensation_unit: histogram by the + # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} + # of base salary, for example, "WEEKLY", "MONTHLY". + # * base_compensation: histogram by the base salary. Must specify list of + # numeric buckets to group results by. + # * annualized_base_compensation: histogram by the base annualized salary. + # Must specify list of numeric buckets to group results by. + # * annualized_total_compensation: histogram by the total annualized salary. + # Must specify list of numeric buckets to group results by. + # * string_custom_attribute: histogram by string + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # string_custom_attribute["key1"]. + # * numeric_custom_attribute: histogram by numeric + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. + # Values can be accessed via square bracket notations like + # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to + # group results by. + # + # Example expressions: + # + # * `count(admin1)` + # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), + # bucket(100000, MAX)])` + # * `count(string_custom_attribute["some-string-custom-attribute"])` + # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], + # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` + # @!attribute [rw] job_view + # @return [::Google::Cloud::Talent::V4beta1::JobView] + # The desired job attributes returned for jobs in the search response. + # Defaults to + # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} + # if no value is specified. + # @!attribute [rw] offset + # @return [::Integer] + # An integer that specifies the current offset (that is, starting result + # location, amongst the jobs deemed by the API as relevant) in search + # results. This field is only considered if + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is + # unset. + # + # The maximum allowed value is 5000. Otherwise an error is thrown. + # + # For example, 0 means to return results starting from the first matching + # job, and 10 means to return from the 11th job. This can be used for + # pagination, (for example, pageSize = 10 and offset = 10 means to return + # from the second page). + # @!attribute [rw] page_size + # @return [::Integer] + # A limit on the number of jobs returned in the search results. + # Increasing this value above the default value of 10 can increase search + # response time. The value can be between 1 and 100. + # @!attribute [rw] page_token + # @return [::String] + # The token specifying the current offset within + # search results. See + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} + # for an explanation of how to obtain the next set of query results. + # @!attribute [rw] order_by + # @return [::String] + # The criteria determining how search results are sorted. Default is + # `"relevance desc"`. + # + # Supported options are: + # + # * `"relevance desc"`: By relevance descending, as determined by the API + # algorithms. Relevance thresholding of query results is only available + # with this ordering. + # * `"posting_publish_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} + # descending. + # * `"posting_update_time desc"`: By + # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} + # descending. + # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # ascending. + # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} + # descending. + # * `"annualized_base_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_base_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"annualized_total_compensation"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # ascending. Jobs whose annualized base compensation is unspecified are put + # at the end of search results. + # * `"annualized_total_compensation desc"`: By job's + # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} + # descending. Jobs whose annualized base compensation is unspecified are + # put at the end of search results. + # * `"custom_ranking desc"`: By the relevance score adjusted to the + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} + # with weight factor assigned by + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} + # in descending order. + # * Location sorting: Use the special syntax to order jobs by distance:
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by + # multiple locations. See details below.
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by + # multiple locations. See details below.
+ # The string can have a maximum of 256 characters. When multiple distance + # centers are provided, a job that is close to any of the distance centers + # would have a high rank. When a job has multiple locations, the job + # location closest to one of the distance centers will be used. Jobs that + # don't have locations will be ranked at the bottom. Distance is calculated + # with a precision of 11.3 meters (37.4 feet). Diversification strategy is + # still applied unless explicitly disabled in + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. + # @!attribute [rw] diversification_level + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} + # if no value is specified. + # @!attribute [rw] custom_ranking_info + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo] + # Controls over how job documents get ranked on top of existing relevance + # score (determined by API algorithm). + # @!attribute [rw] disable_keyword_match + # @return [::Boolean] + # This field is deprecated. Please use + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # going forward. + # + # To migrate, disable_keyword_match set to false maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, + # and disable_keyword_match set to true maps to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. + # If + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} + # is set, this field is ignored. + # + # Controls whether to disable exact keyword match on + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When + # disable keyword match is turned off, a keyword match returns jobs that do + # not match given category filters when there are matching keywords. For + # example, for the query "program manager," a result is returned even if the + # job posting has the title "software developer," which doesn't fall into + # "program manager" ontology, but does have "program manager" appearing in + # its description. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this flag's value. + # + # Use + # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + # + # Defaults to false. + # @!attribute [rw] keyword_match_mode + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] + # Controls what keyword match options to use. + # + # Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # if no value is specified. + # @!attribute [rw] relevance_threshold + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] + # Optional. The relevance threshold of the search results. + # + # Default to Google defined threshold, leveraging a balance of + # precision and recall to deliver both highly accurate results and + # comprehensive coverage of relevant information. + class SearchJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Custom ranking information for + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] importance_level + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo::ImportanceLevel] + # Required. Controls over how important the score of + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression} + # gets applied to job's final ranking position. + # + # An error is thrown if not specified. + # @!attribute [rw] ranking_expression + # @return [::String] + # Required. Controls over how job documents get ranked on top of existing + # relevance score (determined by API algorithm). A combination of the + # ranking expression and relevance score is used to determine job's final + # ranking position. + # + # The syntax for this expression is a subset of Google SQL syntax. + # + # Supported operators are: +, -, *, /, where the left and right side of + # the operator is either a numeric + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} + # key, integer/double value or an expression that can be evaluated to a + # number. + # + # Parenthesis are supported to adjust calculation precedence. The + # expression must be < 200 characters in length. + # + # The expression is considered invalid for a job if the expression + # references custom attributes that are not populated on the job or if the + # expression results in a divide by zero. If an expression is invalid for a + # job, that job is demoted to the end of the results. + # + # Sample ranking expression + # (year + 25) * 0.25 - (freshness / 0.5) + class CustomRankingInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The importance level for + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression}. + module ImportanceLevel + # Default value if the importance level isn't specified. + IMPORTANCE_LEVEL_UNSPECIFIED = 0 + + # The given ranking expression is of None importance, existing relevance + # score (determined by API algorithm) dominates job's final ranking + # position. + NONE = 1 + + # The given ranking expression is of Low importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + LOW = 2 + + # The given ranking expression is of Mild importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + MILD = 3 + + # The given ranking expression is of Medium importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + MEDIUM = 4 + + # The given ranking expression is of High importance in terms of job's + # final ranking position compared to existing relevance + # score (determined by API algorithm). + HIGH = 5 + + # The given ranking expression is of Extreme importance, and dominates + # job's final ranking position with existing relevance + # score (determined by API algorithm) ignored. + EXTREME = 6 + end + end + + # A string-represented enumeration of the job search mode. The service + # operate differently for different modes of service. + module SearchMode + # The mode of the search method isn't specified. The default search + # behavior is identical to JOB_SEARCH search behavior. + SEARCH_MODE_UNSPECIFIED = 0 + + # The job search matches against all jobs, and featured jobs + # (jobs with promotionValue > 0) are not specially handled. + JOB_SEARCH = 1 + + # The job search matches only against featured jobs (jobs with a + # promotionValue > 0). This method doesn't return any jobs having a + # promotionValue <= 0. The search results order is determined by the + # promotionValue (jobs with a higher promotionValue are returned higher up + # in the search results), with relevance being used as a tiebreaker. + FEATURED_JOB_SEARCH = 2 + end + + # Controls whether highly similar jobs are returned next to each other in + # the search results. Jobs are identified as highly similar based on + # their titles, job categories, and locations. Highly similar results are + # clustered so that only one representative job of the cluster is + # displayed to the job seeker higher up in the results, with the other jobs + # being displayed lower down in the results. + module DiversificationLevel + # The diversification level isn't specified. + DIVERSIFICATION_LEVEL_UNSPECIFIED = 0 + + # Disables diversification. Jobs that would normally be pushed to the last + # page would not have their positions altered. This may result in highly + # similar jobs appearing in sequence in the search results. + DISABLED = 1 + + # Default diversifying behavior. The result list is ordered so that + # highly similar results are pushed to the end of the last page of search + # results. If you are using pageToken to page through the result set, + # latency might be lower but we can't guarantee that all results are + # returned. If you are using page offset, latency might be higher but all + # results are returned. + SIMPLE = 2 + end + + # Controls what keyword matching behavior the search has. When keyword + # matching is enabled, a keyword match returns jobs that may not match given + # category filters when there are matching keywords. For example, for the + # query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a + # job posting with the title "software developer," which doesn't fall into + # "program manager" ontology, and "program manager" appearing in its + # description will be surfaced. + # + # For queries like "cloud" that don't contain title or + # location specific ontology, jobs with "cloud" keyword matches are returned + # regardless of this enum's value. + # + # Use + # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} + # if company-specific globally matched custom field/attribute string values + # are needed. Enabling keyword match improves recall of subsequent search + # requests. + module KeywordMatchMode + # The keyword match option isn't specified. Defaults to + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} + # behavior. + KEYWORD_MATCH_MODE_UNSPECIFIED = 0 + + # Disables keyword matching. + KEYWORD_MATCH_DISABLED = 1 + + # Enable keyword matching over + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, + # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, + # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, + # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}, and + # keyword searchable + # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} + # fields. + KEYWORD_MATCH_ALL = 2 + + # Only enable keyword matching over + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}. + KEYWORD_MATCH_TITLE_ONLY = 3 + end + + # The relevance threshold of the search results. The higher relevance + # threshold is, the higher relevant results are shown and the less number of + # results are returned. + module RelevanceThreshold + # Default value. In this case, server behavior defaults to Google defined + # threshold. + RELEVANCE_THRESHOLD_UNSPECIFIED = 0 + + # Lowest relevance threshold. + LOWEST = 1 + + # Low relevance threshold. + LOW = 2 + + # Medium relevance threshold. + MEDIUM = 3 + + # High relevance threshold. + HIGH = 4 + end + end + + # Response for SearchJob method. + # @!attribute [rw] matching_jobs + # @return [::Array<::Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob>] + # The Job entities that match the specified + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] histogram_query_results + # @return [::Array<::Google::Cloud::Talent::V4beta1::HistogramQueryResult>] + # The histogram results that match with specified + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries}. + # @!attribute [rw] next_page_token + # @return [::String] + # The token that specifies the starting position of the next page of results. + # This field is empty if there are no more results. + # @!attribute [rw] location_filters + # @return [::Array<::Google::Cloud::Talent::V4beta1::Location>] + # The location filters that the service applied to the specified query. If + # any filters are lat-lng based, the + # {::Google::Cloud::Talent::V4beta1::Location#location_type Location.location_type} + # is + # {::Google::Cloud::Talent::V4beta1::Location::LocationType::LOCATION_TYPE_UNSPECIFIED Location.LocationType.LOCATION_TYPE_UNSPECIFIED}. + # @!attribute [rw] estimated_total_size + # @return [::Integer] + # An estimation of the number of jobs that match the specified query. + # + # This number isn't guaranteed to be accurate. For accurate results, + # see + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#total_size SearchJobsResponse.total_size}. + # @!attribute [rw] total_size + # @return [::Integer] + # The precise result count with limit 100,000. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + # @!attribute [rw] broadened_query_jobs_count + # @return [::Integer] + # If query broadening is enabled, we may append additional results from the + # broadened query. This number indicates how many of the jobs returned in the + # jobs field are from the broadened query. These results are always at the + # end of the jobs list. In particular, a value of 0, or if the field isn't + # set, all the jobs in the jobs list are from the original + # (without broadening) query. If this field is non-zero, subsequent requests + # with offset after this result set should contain all broadened results. + # @!attribute [rw] spell_correction + # @return [::Google::Cloud::Talent::V4beta1::SpellingCorrection] + # The spell checking result, and correction. + class SearchJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Job entry with metadata inside + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse SearchJobsResponse}. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4beta1::Job] + # Job resource that matches the specified + # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. + # @!attribute [rw] job_summary + # @return [::String] + # A summary of the job with core information that's displayed on the search + # results listing page. + # @!attribute [rw] job_title_snippet + # @return [::String] + # Contains snippets of text from the + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title} field most closely + # matching a search query's keywords, if available. The matching query + # keywords are enclosed in HTML bold tags. + # @!attribute [rw] search_text_snippet + # @return [::String] + # Contains snippets of text from the + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description} and + # similar fields that most closely match a search query's keywords, if + # available. All HTML tags in the original fields are stripped when + # returned in this field, and matching query keywords are enclosed in HTML + # bold tags. + # @!attribute [rw] commute_info + # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse::CommuteInfo] + # Commute information which is generated based on specified + # {::Google::Cloud::Talent::V4beta1::CommuteFilter CommuteFilter}. + class MatchingJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Commute details related to this job. + # @!attribute [rw] job_location + # @return [::Google::Cloud::Talent::V4beta1::Location] + # Location used as the destination in the commute calculation. + # @!attribute [rw] travel_duration + # @return [::Google::Protobuf::Duration] + # The number of seconds required to travel to the job location from the + # query location. A duration of 0 seconds indicates that the job isn't + # reachable within the requested duration, but was returned as part of an + # expanded query. + class CommuteInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request to create a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4beta1::Job>] + # Required. The jobs to be created. + class BatchCreateJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a batch of jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the tenant under which the job is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, + # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant + # is created. For example, "projects/foo". + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Talent::V4beta1::Job>] + # Required. The jobs to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. Be aware that it will + # also increase latency when checking the status of a batch operation. + # + # If + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the + # fields are updated. + # + # A field mask to restrict the fields that are updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. + # + # If + # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} + # is provided, The {::Google::Cloud::Talent::V4beta1::Job Job} inside + # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult JobResult} + # will only contains fields that is updated, plus the Id of the Job. + # Otherwise, {::Google::Cloud::Talent::V4beta1::Job Job} will include all fields, + # which can yield a very large response. + class BatchUpdateJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of + # {::Google::Cloud::Talent::V4beta1::JobService::Client#batch_create_jobs JobService.BatchCreateJobs} + # or + # {::Google::Cloud::Talent::V4beta1::JobService::Client#batch_update_jobs JobService.BatchUpdateJobs} + # APIs. It's used to replace + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # in case of success. + # @!attribute [rw] job_results + # @return [::Array<::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult>] + # List of job mutation results from a batch mutate operation. It can change + # until operation status is FINISHED, FAILED or CANCELLED. + class JobOperationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Mutation result of a job. + # @!attribute [rw] job + # @return [::Google::Cloud::Talent::V4beta1::Job] + # Here {::Google::Cloud::Talent::V4beta1::Job Job} only contains basic + # information including {::Google::Cloud::Talent::V4beta1::Job#name name}, + # {::Google::Cloud::Talent::V4beta1::Job#company company}, + # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}, use + # getJob method to retrieve detailed information of the created/updated + # job. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status of the job processed. This field is populated if the + # processing of the + # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult#job job} + # fails. + class JobResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An enum that specifies the job attributes that are returned in the + # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob#job MatchingJob.job} + # or {::Google::Cloud::Talent::V4beta1::ListJobsResponse#jobs ListJobsResponse.jobs} + # fields. + module JobView + # Default value. + JOB_VIEW_UNSPECIFIED = 0 + + # A ID only view of job, with following attributes: + # {::Google::Cloud::Talent::V4beta1::Job#name Job.name}, + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}. + JOB_VIEW_ID_ONLY = 1 + + # A minimal view of the job, with the following attributes: + # {::Google::Cloud::Talent::V4beta1::Job#name Job.name}, + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#company Job.company}, + # {::Google::Cloud::Talent::V4beta1::Job::DerivedInfo#locations Job.DerivedInfo.locations}, + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}. + JOB_VIEW_MINIMAL = 2 + + # A small view of the job, with the following attributes in the search + # results: {::Google::Cloud::Talent::V4beta1::Job#name Job.name}, + # {::Google::Cloud::Talent::V4beta1::Job#requisition_id Job.requisition_id}, + # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, + # {::Google::Cloud::Talent::V4beta1::Job#company Job.company}, + # {::Google::Cloud::Talent::V4beta1::Job::DerivedInfo#locations Job.DerivedInfo.locations}, + # {::Google::Cloud::Talent::V4beta1::Job#visibility Job.visibility}, + # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, + # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}. + JOB_VIEW_SMALL = 3 + + # All available attributes are included in the search results. + JOB_VIEW_FULL = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb new file mode 100644 index 000000000000..753ca78ba193 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # A Tenant resource represents a tenant in the service. A tenant is a group or + # entity that shares common access with specific privileges for resources like + # profiles. Customer may create multiple tenants to provide data isolation for + # different groups. + # @!attribute [rw] name + # @return [::String] + # Required during tenant update. + # + # The resource name for a tenant. This is generated by the service when a + # tenant is created. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + # @!attribute [rw] external_id + # @return [::String] + # Required. Client side tenant identifier, used to uniquely identify the + # tenant. + # + # The maximum number of allowed characters is 255. + # @!attribute [rw] usage_type + # @return [::Google::Cloud::Talent::V4beta1::Tenant::DataUsageType] + # Indicates whether data owned by this tenant may be used to provide product + # improvements across other tenants. + # + # Defaults behavior is + # {::Google::Cloud::Talent::V4beta1::Tenant::DataUsageType::ISOLATED DataUsageType.ISOLATED} + # if it's unset. + # @!attribute [rw] keyword_searchable_profile_custom_attributes + # @return [::Array<::String>] + # A list of keys of filterable + # [Profile.custom_attributes][google.cloud.talent.v4beta1.Profile.custom_attributes], + # whose corresponding `string_values` are used in keyword searches. Profiles + # with `string_values` under these specified field keys are returned if any + # of the values match the search keyword. Custom field values with + # parenthesis, brackets and special symbols are not searchable as-is, + # and must be surrounded by quotes. + class Tenant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents how user data owned by the tenant is used. + module DataUsageType + # Default value. + DATA_USAGE_TYPE_UNSPECIFIED = 0 + + # Data owned by this tenant is used to improve search/recommendation + # quality across tenants. + AGGREGATED = 1 + + # Data owned by this tenant is used to improve search/recommendation + # quality for this tenant only. + ISOLATED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb new file mode 100644 index 000000000000..25d9ffc34d5c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + module V4beta1 + # The Request of the CreateTenant method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @!attribute [rw] tenant + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # Required. The tenant to be created. + class CreateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a tenant by name. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the tenant to be retrieved. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + class GetTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for updating a specified tenant. + # @!attribute [rw] tenant + # @return [::Google::Cloud::Talent::V4beta1::Tenant] + # Required. The tenant resource to replace the current resource in the + # system. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Strongly recommended for the best service experience. + # + # If + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} + # is provided, only the specified fields in + # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are + # updated. Otherwise all the fields are updated. + # + # A field mask to specify the tenant fields to be updated. Only + # top level fields of {::Google::Cloud::Talent::V4beta1::Tenant Tenant} are + # supported. + class UpdateTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a tenant. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the tenant to be deleted. + # + # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, + # "projects/foo/tenants/bar". + class DeleteTenantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List tenants for which the client has ACL visibility. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the project under which the tenant is created. + # + # The format is "projects/\\{project_id}", for example, + # "projects/foo". + # @!attribute [rw] page_token + # @return [::String] + # The starting indicator from which to return results. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of tenants to be returned, at most 100. + # Default is 100 if a non-positive number is provided. + class ListTenantsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The List tenants response object. + # @!attribute [rw] tenants + # @return [::Array<::Google::Cloud::Talent::V4beta1::Tenant>] + # Tenants for the current client. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. + # @!attribute [rw] metadata + # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] + # Additional information for the API invocation, such as the request + # tracking id. + class ListTenantsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-talent-v4beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..1b485b0c3456 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..c15e78a39a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/latlng.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # An object that represents a latitude/longitude pair. This is expressed as a + # pair of doubles to represent degrees latitude and degrees longitude. Unless + # specified otherwise, this must conform to the + # WGS84 + # standard. Values must be within normalized ranges. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude in degrees. It must be in the range [-90.0, +90.0]. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude in degrees. It must be in the range [-180.0, +180.0]. + class LatLng + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb new file mode 100644 index 000000000000..56a32eee300d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 an amount of money with its currency type. + # @!attribute [rw] currency_code + # @return [::String] + # The three-letter currency code defined in ISO 4217. + # @!attribute [rw] units + # @return [::Integer] + # The whole units of the amount. + # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + # @!attribute [rw] nanos + # @return [::Integer] + # Number of nano (10^-9) units of the amount. + # The value must be between -999,999,999 and +999,999,999 inclusive. + # If `units` is positive, `nanos` must be positive or zero. + # If `units` is zero, `nanos` can be positive, zero, or negative. + # If `units` is negative, `nanos` must be negative or zero. + # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + class Money + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb new file mode 100644 index 000000000000..9cd0c16495dd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 postal address, e.g. for postal delivery or payments addresses. + # Given a postal address, a postal service can deliver items to a premise, P.O. + # Box or similar. + # It is not intended to model geographical locations (roads, towns, + # mountains). + # + # In typical usage an address would be created via user input or from importing + # existing data, depending on the type of process. + # + # Advice on address input / editing: + # - Use an i18n-ready address widget such as + # https://github.com/google/libaddressinput) + # - Users should not be presented with UI elements for input or editing of + # fields outside countries where that field is used. + # + # For more guidance on how to use this schema, please see: + # https://support.google.com/business/answer/6397478 + # @!attribute [rw] revision + # @return [::Integer] + # The schema revision of the `PostalAddress`. This must be set to 0, which is + # the latest revision. + # + # All new revisions **must** be backward compatible with old revisions. + # @!attribute [rw] region_code + # @return [::String] + # Required. CLDR region code of the country/region of the address. This + # is never inferred and it is up to the user to ensure the value is + # correct. See http://cldr.unicode.org/ and + # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html + # for details. Example: "CH" for Switzerland. + # @!attribute [rw] language_code + # @return [::String] + # Optional. BCP-47 language code of the contents of this address (if + # known). This is often the UI language of the input form or is expected + # to match one of the languages used in the address' country/region, or their + # transliterated equivalents. + # This can affect formatting in certain countries, but is not critical + # to the correctness of the data and will never affect any validation or + # other non-formatting related operations. + # + # If this value is not known, it should be omitted (rather than specifying a + # possibly incorrect default). + # + # Examples: "zh-Hant", "ja", "ja-Latn", "en". + # @!attribute [rw] postal_code + # @return [::String] + # Optional. Postal code of the address. Not all countries use or require + # postal codes to be present, but where they are used, they may trigger + # additional validation with other parts of the address (e.g. state/zip + # validation in the U.S.A.). + # @!attribute [rw] sorting_code + # @return [::String] + # Optional. Additional, country-specific, sorting code. This is not used + # in most regions. Where it is used, the value is either a string like + # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number + # alone, representing the "sector code" (Jamaica), "delivery area indicator" + # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). + # @!attribute [rw] administrative_area + # @return [::String] + # Optional. Highest administrative subdivision which is used for postal + # addresses of a country or region. + # For example, this can be a state, a province, an oblast, or a prefecture. + # Specifically, for Spain this is the province and not the autonomous + # community (e.g. "Barcelona" and not "Catalonia"). + # Many countries don't use an administrative area in postal addresses. E.g. + # in Switzerland this should be left unpopulated. + # @!attribute [rw] locality + # @return [::String] + # Optional. Generally refers to the city/town portion of the address. + # Examples: US city, IT comune, UK post town. + # In regions of the world where localities are not well defined or do not fit + # into this structure well, leave locality empty and use address_lines. + # @!attribute [rw] sublocality + # @return [::String] + # Optional. Sublocality of the address. + # For example, this can be neighborhoods, boroughs, districts. + # @!attribute [rw] address_lines + # @return [::Array<::String>] + # Unstructured address lines describing the lower levels of an address. + # + # Because values in address_lines do not have type information and may + # sometimes contain multiple values in a single field (e.g. + # "Austin, TX"), it is important that the line order is clear. The order of + # address lines should be "envelope order" for the country/region of the + # address. In places where this can vary (e.g. Japan), address_language is + # used to make it explicit (e.g. "ja" for large-to-small ordering and + # "ja-Latn" or "en" for small-to-large). This way, the most specific line of + # an address can be selected based on the language. + # + # The minimum permitted structural representation of an address consists + # of a region_code with all remaining information placed in the + # address_lines. It would be possible to format such an address very + # approximately without geocoding, but no semantic reasoning could be + # made about any of the address components until it was at least + # partially resolved. + # + # Creating an address only containing a region_code and address_lines, and + # then geocoding is the recommended way to handle completely unstructured + # addresses (as opposed to guessing which parts of the address should be + # localities or administrative areas). + # @!attribute [rw] recipients + # @return [::Array<::String>] + # Optional. The recipient at the address. + # This field may, under certain circumstances, contain multiline information. + # For example, it might contain "care of" information. + # @!attribute [rw] organization + # @return [::String] + # Optional. The name of the organization at the address. + class PostalAddress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..8372dad8beb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile new file mode 100644 index 000000000000..4f040c286bc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1", path: "../" +else + gem "google-cloud-talent-v4beta1" +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-talent-v4beta1/snippets/company_service/create_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb new file mode 100644 index 000000000000..6b8b2dacf42b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_CreateCompany_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the create_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#create_company. +# +def create_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new + + # Call the create_company method. + result = client.create_company request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + p result +end +# [END jobs_v4beta1_generated_CompanyService_CreateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb new file mode 100644 index 000000000000..e48c9d498ed6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_DeleteCompany_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the delete_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#delete_company. +# +def delete_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new + + # Call the delete_company method. + result = client.delete_company request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4beta1_generated_CompanyService_DeleteCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb new file mode 100644 index 000000000000..3e959944036d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_GetCompany_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the get_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#get_company. +# +def get_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new + + # Call the get_company method. + result = client.get_company request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + p result +end +# [END jobs_v4beta1_generated_CompanyService_GetCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb new file mode 100644 index 000000000000..b54cf08a88ea --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_ListCompanies_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the list_companies call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#list_companies. +# +def list_companies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new + + # Call the list_companies method. + result = client.list_companies 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::Talent::V4beta1::Company. + p item + end +end +# [END jobs_v4beta1_generated_CompanyService_ListCompanies_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb new file mode 100644 index 000000000000..76f7dfb2fd71 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_UpdateCompany_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the update_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#update_company. +# +def update_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new + + # Call the update_company method. + result = client.update_company request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + p result +end +# [END jobs_v4beta1_generated_CompanyService_UpdateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb new file mode 100644 index 000000000000..115a3726dcbb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_Completion_CompleteQuery_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the complete_query call in the Completion 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::Talent::V4beta1::Completion::Client#complete_query. +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::Completion::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new + + # Call the complete_query method. + result = client.complete_query request + + # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. + p result +end +# [END jobs_v4beta1_generated_Completion_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb new file mode 100644 index 000000000000..8bb1b5d44021 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_EventService_CreateClientEvent_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the create_client_event call in the EventService 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::Talent::V4beta1::EventService::Client#create_client_event. +# +def create_client_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::EventService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new + + # Call the create_client_event method. + result = client.create_client_event request + + # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. + p result +end +# [END jobs_v4beta1_generated_EventService_CreateClientEvent_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb new file mode 100644 index 000000000000..52410b1d37e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_BatchCreateJobs_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the batch_create_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#batch_create_jobs. +# +def batch_create_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new + + # Call the batch_create_jobs method. + result = client.batch_create_jobs 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 jobs_v4beta1_generated_JobService_BatchCreateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb new file mode 100644 index 000000000000..f3027a6f9bab --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the batch_delete_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#batch_delete_jobs. +# +def batch_delete_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new + + # Call the batch_delete_jobs method. + result = client.batch_delete_jobs request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb new file mode 100644 index 000000000000..705897a8a222 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the batch_update_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#batch_update_jobs. +# +def batch_update_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new + + # Call the batch_update_jobs method. + result = client.batch_update_jobs 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 jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb new file mode 100644 index 000000000000..2bc55828df04 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_CreateJob_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the create_job call in the JobService 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::Talent::V4beta1::JobService::Client#create_job. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + p result +end +# [END jobs_v4beta1_generated_JobService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb new file mode 100644 index 000000000000..3ae4c08f0537 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_DeleteJob_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the delete_job call in the JobService 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::Talent::V4beta1::JobService::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::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 jobs_v4beta1_generated_JobService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb new file mode 100644 index 000000000000..5791d265581b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_GetJob_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the get_job call in the JobService 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::Talent::V4beta1::JobService::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + p result +end +# [END jobs_v4beta1_generated_JobService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb new file mode 100644 index 000000000000..3f3c15a1a8a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_ListJobs_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the list_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::Job. + p item + end +end +# [END jobs_v4beta1_generated_JobService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb new file mode 100644 index 000000000000..fa31d7955f21 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_SearchJobs_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the search_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#search_jobs. +# +def search_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + + # Call the search_jobs method. + result = client.search_jobs request + + # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + p result +end +# [END jobs_v4beta1_generated_JobService_SearchJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb new file mode 100644 index 000000000000..1407454f27d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the search_jobs_for_alert call in the JobService 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::Talent::V4beta1::JobService::Client#search_jobs_for_alert. +# +def search_jobs_for_alert + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + + # Call the search_jobs_for_alert method. + result = client.search_jobs_for_alert request + + # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + p result +end +# [END jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb new file mode 100644 index 000000000000..4e67dd7eb051 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_UpdateJob_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the update_job call in the JobService 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::Talent::V4beta1::JobService::Client#update_job. +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + p result +end +# [END jobs_v4beta1_generated_JobService_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json new file mode 100644 index 000000000000..d2cdb2a5f735 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json @@ -0,0 +1,895 @@ +{ + "client_library": { + "name": "google-cloud-talent-v4beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.talent.v4beta1", + "version": "v4beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "jobs_v4beta1_generated_CompanyService_CreateCompany_sync", + "title": "Snippet for the create_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#create_company.", + "file": "company_service/create_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_company", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#create_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::CreateCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" + }, + "method": { + "short_name": "CreateCompany", + "full_name": "google.cloud.talent.v4beta1.CompanyService.CreateCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4beta1.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_CompanyService_GetCompany_sync", + "title": "Snippet for the get_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#get_company.", + "file": "company_service/get_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_company", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#get_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::GetCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" + }, + "method": { + "short_name": "GetCompany", + "full_name": "google.cloud.talent.v4beta1.CompanyService.GetCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4beta1.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_CompanyService_UpdateCompany_sync", + "title": "Snippet for the update_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#update_company.", + "file": "company_service/update_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_company", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#update_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Company", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" + }, + "method": { + "short_name": "UpdateCompany", + "full_name": "google.cloud.talent.v4beta1.CompanyService.UpdateCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4beta1.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_CompanyService_DeleteCompany_sync", + "title": "Snippet for the delete_company call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#delete_company.", + "file": "company_service/delete_company.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_company", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#delete_company", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" + }, + "method": { + "short_name": "DeleteCompany", + "full_name": "google.cloud.talent.v4beta1.CompanyService.DeleteCompany", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4beta1.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_CompanyService_ListCompanies_sync", + "title": "Snippet for the list_companies call in the CompanyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#list_companies.", + "file": "company_service/list_companies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_companies", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#list_companies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::ListCompaniesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::ListCompaniesResponse", + "client": { + "short_name": "CompanyService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" + }, + "method": { + "short_name": "ListCompanies", + "full_name": "google.cloud.talent.v4beta1.CompanyService.ListCompanies", + "service": { + "short_name": "CompanyService", + "full_name": "google.cloud.talent.v4beta1.CompanyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_Completion_CompleteQuery_sync", + "title": "Snippet for the complete_query call in the Completion service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::Completion::Client#complete_query.", + "file": "completion/complete_query.rb", + "language": "RUBY", + "client_method": { + "short_name": "complete_query", + "full_name": "::Google::Cloud::Talent::V4beta1::Completion::Client#complete_query", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::CompleteQueryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::CompleteQueryResponse", + "client": { + "short_name": "Completion::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::Completion::Client" + }, + "method": { + "short_name": "CompleteQuery", + "full_name": "google.cloud.talent.v4beta1.Completion.CompleteQuery", + "service": { + "short_name": "Completion", + "full_name": "google.cloud.talent.v4beta1.Completion" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_EventService_CreateClientEvent_sync", + "title": "Snippet for the create_client_event call in the EventService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::EventService::Client#create_client_event.", + "file": "event_service/create_client_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_client_event", + "full_name": "::Google::Cloud::Talent::V4beta1::EventService::Client#create_client_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::CreateClientEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::ClientEvent", + "client": { + "short_name": "EventService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::EventService::Client" + }, + "method": { + "short_name": "CreateClientEvent", + "full_name": "google.cloud.talent.v4beta1.EventService.CreateClientEvent", + "service": { + "short_name": "EventService", + "full_name": "google.cloud.talent.v4beta1.EventService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_CreateJob_sync", + "title": "Snippet for the create_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#create_job.", + "file": "job_service/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.talent.v4beta1.JobService.CreateJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_BatchCreateJobs_sync", + "title": "Snippet for the batch_create_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#batch_create_jobs.", + "file": "job_service/batch_create_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_jobs", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#batch_create_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "BatchCreateJobs", + "full_name": "google.cloud.talent.v4beta1.JobService.BatchCreateJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_GetJob_sync", + "title": "Snippet for the get_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#get_job.", + "file": "job_service/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.talent.v4beta1.JobService.GetJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_UpdateJob_sync", + "title": "Snippet for the update_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#update_job.", + "file": "job_service/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Job", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.talent.v4beta1.JobService.UpdateJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync", + "title": "Snippet for the batch_update_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#batch_update_jobs.", + "file": "job_service/batch_update_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_jobs", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#batch_update_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "BatchUpdateJobs", + "full_name": "google.cloud.talent.v4beta1.JobService.BatchUpdateJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_DeleteJob_sync", + "title": "Snippet for the delete_job call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#delete_job.", + "file": "job_service/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.talent.v4beta1.JobService.DeleteJob", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync", + "title": "Snippet for the batch_delete_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#batch_delete_jobs.", + "file": "job_service/batch_delete_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_jobs", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#batch_delete_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "BatchDeleteJobs", + "full_name": "google.cloud.talent.v4beta1.JobService.BatchDeleteJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_ListJobs_sync", + "title": "Snippet for the list_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs.", + "file": "job_service/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::ListJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.talent.v4beta1.JobService.ListJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_SearchJobs_sync", + "title": "Snippet for the search_jobs call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs.", + "file": "job_service/search_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_jobs", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::SearchJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::SearchJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "SearchJobs", + "full_name": "google.cloud.talent.v4beta1.JobService.SearchJobs", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync", + "title": "Snippet for the search_jobs_for_alert call in the JobService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs_for_alert.", + "file": "job_service/search_jobs_for_alert.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_jobs_for_alert", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs_for_alert", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::SearchJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::SearchJobsResponse", + "client": { + "short_name": "JobService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" + }, + "method": { + "short_name": "SearchJobsForAlert", + "full_name": "google.cloud.talent.v4beta1.JobService.SearchJobsForAlert", + "service": { + "short_name": "JobService", + "full_name": "google.cloud.talent.v4beta1.JobService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_TenantService_CreateTenant_sync", + "title": "Snippet for the create_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#create_tenant.", + "file": "tenant_service/create_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tenant", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#create_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::CreateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" + }, + "method": { + "short_name": "CreateTenant", + "full_name": "google.cloud.talent.v4beta1.TenantService.CreateTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4beta1.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_TenantService_GetTenant_sync", + "title": "Snippet for the get_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#get_tenant.", + "file": "tenant_service/get_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tenant", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#get_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::GetTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" + }, + "method": { + "short_name": "GetTenant", + "full_name": "google.cloud.talent.v4beta1.TenantService.GetTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4beta1.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_TenantService_UpdateTenant_sync", + "title": "Snippet for the update_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#update_tenant.", + "file": "tenant_service/update_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tenant", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#update_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::UpdateTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::Tenant", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" + }, + "method": { + "short_name": "UpdateTenant", + "full_name": "google.cloud.talent.v4beta1.TenantService.UpdateTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4beta1.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_TenantService_DeleteTenant_sync", + "title": "Snippet for the delete_tenant call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#delete_tenant.", + "file": "tenant_service/delete_tenant.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tenant", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#delete_tenant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::DeleteTenantRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" + }, + "method": { + "short_name": "DeleteTenant", + "full_name": "google.cloud.talent.v4beta1.TenantService.DeleteTenant", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4beta1.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "jobs_v4beta1_generated_TenantService_ListTenants_sync", + "title": "Snippet for the list_tenants call in the TenantService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#list_tenants.", + "file": "tenant_service/list_tenants.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tenants", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#list_tenants", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Talent::V4beta1::ListTenantsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Talent::V4beta1::ListTenantsResponse", + "client": { + "short_name": "TenantService::Client", + "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" + }, + "method": { + "short_name": "ListTenants", + "full_name": "google.cloud.talent.v4beta1.TenantService.ListTenants", + "service": { + "short_name": "TenantService", + "full_name": "google.cloud.talent.v4beta1.TenantService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb new file mode 100644 index 000000000000..cfe7e22a91f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_CreateTenant_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the create_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#create_tenant. +# +def create_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new + + # Call the create_tenant method. + result = client.create_tenant request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + p result +end +# [END jobs_v4beta1_generated_TenantService_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb new file mode 100644 index 000000000000..33b7ae2f4b24 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_DeleteTenant_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the delete_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#delete_tenant. +# +def delete_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new + + # Call the delete_tenant method. + result = client.delete_tenant request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END jobs_v4beta1_generated_TenantService_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb new file mode 100644 index 000000000000..e4b463bf9e47 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_GetTenant_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the get_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#get_tenant. +# +def get_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new + + # Call the get_tenant method. + result = client.get_tenant request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + p result +end +# [END jobs_v4beta1_generated_TenantService_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb new file mode 100644 index 000000000000..c79441100dcd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_ListTenants_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the list_tenants call in the TenantService 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::Talent::V4beta1::TenantService::Client#list_tenants. +# +def list_tenants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new + + # Call the list_tenants method. + result = client.list_tenants 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::Talent::V4beta1::Tenant. + p item + end +end +# [END jobs_v4beta1_generated_TenantService_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb new file mode 100644 index 000000000000..e2ec529755a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_UpdateTenant_sync] +require "google/cloud/talent/v4beta1" + +## +# Snippet for the update_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#update_tenant. +# +def update_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new + + # Call the update_tenant method. + result = client.update_tenant request + + # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + p result +end +# [END jobs_v4beta1_generated_TenantService_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb new file mode 100644 index 000000000000..df4661f2e50d --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service" + +class ::Google::Cloud::Talent::V4beta1::CompanyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + + path = client.company_path project: "value0", company: "value1" + assert_equal "projects/value0/companies/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb new file mode 100644 index 000000000000..ffe14d2e9497 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" +require "google/cloud/talent/v4beta1/company_service/rest" + + +class ::Google::Cloud::Talent::V4beta1::CompanyService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + company = {} + + create_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_create_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_company({ parent: parent, company: company }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_company parent: parent, company: company do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_company ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_company({ parent: parent, company: company }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_company(::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_company_client_stub.call_count + end + end + end + + def test_get_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_get_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_company({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_company name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_company ::Google::Cloud::Talent::V4beta1::GetCompanyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_company({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_company(::Google::Cloud::Talent::V4beta1::GetCompanyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_company_client_stub.call_count + end + end + end + + def test_update_company + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Company.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + company = {} + update_mask = {} + + update_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_update_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_company({ company: company, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_company company: company, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_company ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_company({ company: company, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_company(::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_company_client_stub.call_count + end + end + end + + def test_delete_company + # 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_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_delete_company_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_company({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_company name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_company ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_company({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_company(::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_company_client_stub.call_count + end + end + end + + def test_list_companies + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + require_open_jobs = true + + list_companies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_list_companies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_companies_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_companies ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_companies(::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_companies_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::Talent::V4beta1::CompanyService::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::Talent::V4beta1::CompanyService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb new file mode 100644 index 000000000000..326db3adc85c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb @@ -0,0 +1,409 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" +require "google/cloud/talent/v4beta1/company_service" + +class ::Google::Cloud::Talent::V4beta1::CompanyService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::Company.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" + company = {} + + create_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_company, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Company), request["company"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_company({ parent: parent, company: company }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_company parent: parent, company: company do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_company ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_company({ parent: parent, company: company }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_company(::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_company_client_stub.call_rpc_count + end + end + + def test_get_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::Company.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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_company, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::GetCompanyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_company({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_company name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_company ::Google::Cloud::Talent::V4beta1::GetCompanyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_company({ 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_company(::Google::Cloud::Talent::V4beta1::GetCompanyRequest.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_company_client_stub.call_rpc_count + end + end + + def test_update_company + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::Company.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. + company = {} + update_mask = {} + + update_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_company, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Company), request["company"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_company({ company: company, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_company company: company, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_company ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, 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_company({ company: company, 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_company(::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, 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_company_client_stub.call_rpc_count + end + end + + def test_delete_company + # 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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_company, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_company_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_company({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_company name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_company ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_company({ 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_company(::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.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_company_client_stub.call_rpc_count + end + end + + def test_list_companies + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.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_token = "hello world" + page_size = 42 + require_open_jobs = true + + list_companies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_companies, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal true, request["require_open_jobs"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_companies_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) 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_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs 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_companies ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) 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_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, 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_companies(::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), 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_companies_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::Talent::V4beta1::CompanyService::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::Talent::V4beta1::CompanyService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4beta1::CompanyService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb new file mode 100644 index 000000000000..79274afedf5b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion" + +class ::Google::Cloud::Talent::V4beta1::Completion::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + + path = client.company_path project: "value0", company: "value1" + assert_equal "projects/value0/companies/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb new file mode 100644 index 000000000000..805eb4d0755b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" +require "google/cloud/talent/v4beta1/completion/rest" + + +class ::Google::Cloud::Talent::V4beta1::Completion::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + language_codes = ["hello world"] + page_size = 42 + company = "hello world" + scope = :COMPLETION_SCOPE_UNSPECIFIED + type = :COMPLETION_TYPE_UNSPECIFIED + + complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::Completion::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.complete_query parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, complete_query_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::Talent::V4beta1::Completion::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::Talent::V4beta1::Completion::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb new file mode 100644 index 000000000000..7c545fda4a14 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" +require "google/cloud/talent/v4beta1/completion" + +class ::Google::Cloud::Talent::V4beta1::Completion::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_complete_query + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.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" + query = "hello world" + language_codes = ["hello world"] + page_size = 42 + company = "hello world" + scope = :COMPLETION_SCOPE_UNSPECIFIED + type = :COMPLETION_TYPE_UNSPECIFIED + + complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :complete_query, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["query"] + assert_equal ["hello world"], request["language_codes"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["company"] + assert_equal :COMPLETION_SCOPE_UNSPECIFIED, request["scope"] + assert_equal :COMPLETION_TYPE_UNSPECIFIED, request["type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, complete_query_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.complete_query parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.complete_query ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.complete_query(::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, complete_query_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::Talent::V4beta1::Completion::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::Talent::V4beta1::Completion::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4beta1::Completion::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb new file mode 100644 index 000000000000..62494d741f26 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service" + +class ::Google::Cloud::Talent::V4beta1::EventService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb new file mode 100644 index 000000000000..367e17cac38c --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" +require "google/cloud/talent/v4beta1/event_service/rest" + + +class ::Google::Cloud::Talent::V4beta1::EventService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_client_event + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::ClientEvent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + client_event = {} + + create_client_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::EventService::Rest::ServiceStub.stub :transcode_create_client_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_client_event_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_client_event({ parent: parent, client_event: client_event }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_client_event parent: parent, client_event: client_event do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_client_event ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_client_event({ parent: parent, client_event: client_event }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_client_event(::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_client_event_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::Talent::V4beta1::EventService::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::Talent::V4beta1::EventService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb new file mode 100644 index 000000000000..3c1fe220a445 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" +require "google/cloud/talent/v4beta1/event_service" + +class ::Google::Cloud::Talent::V4beta1::EventService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_client_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::ClientEvent.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" + client_event = {} + + create_client_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_client_event, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::ClientEvent), request["client_event"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_client_event_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_client_event({ parent: parent, client_event: client_event }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_client_event parent: parent, client_event: client_event do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_client_event ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_client_event({ parent: parent, client_event: client_event }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_client_event(::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_client_event_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::Talent::V4beta1::EventService::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::Talent::V4beta1::EventService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4beta1::EventService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb new file mode 100644 index 000000000000..c9ea942034fd --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" +require "google/cloud/talent/v4beta1/job_service_services_pb" +require "google/cloud/talent/v4beta1/job_service" + +class ::Google::Cloud::Talent::V4beta1::JobService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb new file mode 100644 index 000000000000..6905c8128013 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service" + +class ::Google::Cloud::Talent::V4beta1::JobService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_company_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.company_path project: "value0", tenant: "value1", company: "value2" + assert_equal "projects/value0/tenants/value1/companies/value2", path + + path = client.company_path project: "value0", company: "value1" + assert_equal "projects/value0/companies/value1", path + end + end + + def test_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", tenant: "value1", job: "value2" + assert_equal "projects/value0/tenants/value1/jobs/value2", path + + path = client.job_path project: "value0", job: "value1" + assert_equal "projects/value0/jobs/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb new file mode 100644 index 000000000000..b5233fe24bbf --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb @@ -0,0 +1,681 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" +require "google/cloud/talent/v4beta1/job_service/rest" + + +class ::Google::Cloud::Talent::V4beta1::JobService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job: job do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_batch_create_jobs + # 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" + jobs = [{}] + + batch_create_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_batch_create_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_jobs({ parent: parent, jobs: jobs }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_jobs parent: parent, jobs: jobs do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_jobs ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_jobs({ parent: parent, jobs: jobs }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_jobs(::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_jobs_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Talent::V4beta1::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Talent::V4beta1::GetJobRequest.new(name: name), 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_update_job + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_job({ job: job, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_job 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::Talent::V4beta1::UpdateJobRequest.new(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({ 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::Talent::V4beta1::UpdateJobRequest.new(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_batch_update_jobs + # 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" + jobs = [{}] + update_mask = {} + + batch_update_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_batch_update_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_update_jobs ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_update_jobs(::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_jobs_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. + name = "hello world" + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Talent::V4beta1::DeleteJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Talent::V4beta1::DeleteJobRequest.new(name: name), 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_batch_delete_jobs + # 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. + parent = "hello world" + filter = "hello world" + + batch_delete_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_batch_delete_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_delete_jobs({ parent: parent, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_delete_jobs parent: parent, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_delete_jobs ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_delete_jobs({ parent: parent, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_delete_jobs(::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_jobs_client_stub.call_count + end + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + job_view = :JOB_VIEW_UNSPECIFIED + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + require_precise_result_size = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_search_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_jobs ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_jobs(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_jobs_client_stub.call_count + end + end + end + + def test_search_jobs_for_alert + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + require_precise_result_size = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_search_jobs_for_alert_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_jobs_for_alert_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_jobs_for_alert ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_jobs_for_alert(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_jobs_for_alert_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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb new file mode 100644 index 000000000000..1ad88b2a3848 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb @@ -0,0 +1,797 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" +require "google/cloud/talent/v4beta1/job_service" + +class ::Google::Cloud::Talent::V4beta1::JobService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::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. + parent = "hello world" + job = {} + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Job), request["job"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job: job }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job: job do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_batch_create_jobs + # 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" + jobs = [{}] + + batch_create_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Talent::V4beta1::Job, request["jobs"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_jobs({ parent: parent, jobs: jobs }) 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.batch_create_jobs parent: parent, jobs: jobs 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.batch_create_jobs ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) 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.batch_create_jobs({ parent: parent, jobs: jobs }, 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.batch_create_jobs(::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), 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, batch_create_jobs_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::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. + name = "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::Talent::V4beta1::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Talent::V4beta1::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ 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_job(::Google::Cloud::Talent::V4beta1::GetJobRequest.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_job_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::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. + 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::Talent::V4beta1::UpdateJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ 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 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::Talent::V4beta1::UpdateJobRequest.new(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({ 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::Talent::V4beta1::UpdateJobRequest.new(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_batch_update_jobs + # 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" + jobs = [{}] + update_mask = {} + + batch_update_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Talent::V4beta1::Job, request["jobs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) 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.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask 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.batch_update_jobs ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) 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.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, 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.batch_update_jobs(::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), 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, batch_update_jobs_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. + name = "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::Talent::V4beta1::DeleteJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Talent::V4beta1::DeleteJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ 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_job(::Google::Cloud::Talent::V4beta1::DeleteJobRequest.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_job_client_stub.call_rpc_count + end + end + + def test_batch_delete_jobs + # 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. + parent = "hello world" + filter = "hello world" + + batch_delete_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_delete_jobs({ parent: parent, filter: filter }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_delete_jobs parent: parent, filter: filter do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_delete_jobs ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_delete_jobs({ parent: parent, filter: filter }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_delete_jobs(::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_delete_jobs_client_stub.call_rpc_count + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::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. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + job_view = :JOB_VIEW_UNSPECIFIED + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) 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 parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view 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::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) 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({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, 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::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.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" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + require_precise_result_size = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_jobs, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::RequestMetadata), request["request_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::JobQuery), request["job_query"] + assert_equal true, request["enable_broadening"] + assert_equal true, request["require_precise_result_size"] + assert_kind_of ::Google::Cloud::Talent::V4beta1::HistogramQuery, request["histogram_queries"].first + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + assert_equal 42, request["offset"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] + assert_equal true, request["disable_keyword_match"] + assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_jobs_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_jobs ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_jobs(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_jobs_client_stub.call_rpc_count + end + end + + def test_search_jobs_for_alert + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.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" + search_mode = :SEARCH_MODE_UNSPECIFIED + request_metadata = {} + job_query = {} + enable_broadening = true + require_precise_result_size = true + histogram_queries = [{}] + job_view = :JOB_VIEW_UNSPECIFIED + offset = 42 + page_size = 42 + page_token = "hello world" + order_by = "hello world" + diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED + custom_ranking_info = {} + disable_keyword_match = true + keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED + relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED + + search_jobs_for_alert_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_jobs_for_alert, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::RequestMetadata), request["request_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::JobQuery), request["job_query"] + assert_equal true, request["enable_broadening"] + assert_equal true, request["require_precise_result_size"] + assert_kind_of ::Google::Cloud::Talent::V4beta1::HistogramQuery, request["histogram_queries"].first + assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] + assert_equal 42, request["offset"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["order_by"] + assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] + assert_equal true, request["disable_keyword_match"] + assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] + assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_jobs_for_alert_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_jobs_for_alert ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_jobs_for_alert(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_jobs_for_alert_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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4beta1::JobService::Client, client + assert_equal creds, client.configure.credentials + end + 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::Talent::V4beta1::JobService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Talent::V4beta1::JobService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb new file mode 100644 index 000000000000..ca6ff0d05b1b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service" + +class ::Google::Cloud::Talent::V4beta1::TenantService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tenant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tenant_path project: "value0", tenant: "value1" + assert_equal "projects/value0/tenants/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb new file mode 100644 index 000000000000..e84949a6e6c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" +require "google/cloud/talent/v4beta1/tenant_service/rest" + + +class ::Google::Cloud::Talent::V4beta1::TenantService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tenant = {} + + create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_tenant({ parent: parent, tenant: tenant }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_tenant parent: parent, tenant: tenant do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant: tenant }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_count + end + end + end + + def test_get_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_tenant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_tenant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::Talent::V4beta1::GetTenantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_tenant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_tenant(::Google::Cloud::Talent::V4beta1::GetTenantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tenant_client_stub.call_count + end + end + end + + def test_update_tenant + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::Tenant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tenant = {} + update_mask = {} + + update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_tenant tenant: tenant, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_tenant({ tenant: tenant, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_tenant(::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tenant_client_stub.call_count + end + end + end + + def test_delete_tenant + # 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_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_tenant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_tenant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_tenant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_tenant(::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tenant_client_stub.call_count + end + end + end + + def test_list_tenants + # Create test objects. + client_result = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tenants ::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_tenants(::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_tenants_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::Talent::V4beta1::TenantService::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::Talent::V4beta1::TenantService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb new file mode 100644 index 000000000000..a90e6bf14b95 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb @@ -0,0 +1,407 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" +require "google/cloud/talent/v4beta1/tenant_service" + +class ::Google::Cloud::Talent::V4beta1::TenantService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::Tenant.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" + tenant = {} + + create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateTenantRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Tenant), request["tenant"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_tenant({ parent: parent, tenant: tenant }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_tenant parent: parent, tenant: tenant do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_tenant ::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_tenant({ parent: parent, tenant: tenant }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_tenant(::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tenant_client_stub.call_rpc_count + end + end + + def test_get_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::Tenant.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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::GetTenantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tenant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tenant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tenant ::Google::Cloud::Talent::V4beta1::GetTenantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tenant({ 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_tenant(::Google::Cloud::Talent::V4beta1::GetTenantRequest.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_tenant_client_stub.call_rpc_count + end + end + + def test_update_tenant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::Tenant.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. + tenant = {} + update_mask = {} + + update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Tenant), request["tenant"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_tenant tenant: tenant, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_tenant ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, 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_tenant({ tenant: tenant, 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_tenant(::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, 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_tenant_client_stub.call_rpc_count + end + end + + def test_delete_tenant + # 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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tenant, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tenant_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_tenant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_tenant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_tenant ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_tenant({ 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_tenant(::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.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_tenant_client_stub.call_rpc_count + end + end + + def test_list_tenants + # Create GRPC objects. + grpc_response = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.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_token = "hello world" + page_size = 42 + + list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tenants, name + assert_kind_of ::Google::Cloud::Talent::V4beta1::ListTenantsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tenants_client_stub do + # Create client + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) 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_tenants parent: parent, page_token: page_token, page_size: page_size 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_tenants ::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_tenants({ parent: parent, page_token: page_token, page_size: page_size }, 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_tenants(::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_tenants_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::Talent::V4beta1::TenantService::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::Talent::V4beta1::TenantService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Talent::V4beta1::TenantService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-talent/.gitignore b/owl-bot-staging/google-cloud-talent/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/.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-talent/.repo-metadata.json b/owl-bot-staging/google-cloud-talent/.repo-metadata.json new file mode 100644 index 000000000000..f0d7c473423f --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "jobs.googleapis.com", + "api_shortname": "jobs", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent/latest", + "distribution_name": "google-cloud-talent", + "is_cloud": true, + "language": "ruby", + "name": "jobs", + "name_pretty": "Cloud Talent Solution API", + "product_documentation": "https://cloud.google.com/solutions/talent-solution", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience.", + "ruby-cloud-env-prefix": "TALENT", + "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-talent/.rubocop.yml b/owl-bot-staging/google-cloud-talent/.rubocop.yml new file mode 100644 index 000000000000..19fadb34d889 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-talent.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-talent.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-talent/.toys.rb b/owl-bot-staging/google-cloud-talent/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent/.yardopts b/owl-bot-staging/google-cloud-talent/.yardopts new file mode 100644 index 000000000000..04a48da418a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Cloud Talent Solution API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-talent/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent/AUTHENTICATION.md new file mode 100644 index 000000000000..57210480794b --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-talent 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-talent 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/talent" + +client = Google::Cloud::Talent.company_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/talent" + +Google::Cloud::Talent.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Talent.company_service +``` + +### 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-talent +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/talent" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Talent.company_service +``` + +### 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-talent/CHANGELOG.md b/owl-bot-staging/google-cloud-talent/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-talent/Gemfile b/owl-bot-staging/google-cloud-talent/Gemfile new file mode 100644 index 000000000000..1ace718df551 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-talent-v4"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-talent.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.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-talent/LICENSE.md b/owl-bot-staging/google-cloud-talent/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/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-talent/README.md b/owl-bot-staging/google-cloud-talent/README.md new file mode 100644 index 000000000000..03dca74b6700 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Cloud Talent Solution API + +API Client library for the Cloud Talent Solution API + +Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-talent-v*`. +The gem `google-cloud-talent` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent/latest) +for this library, google-cloud-talent, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-talent-v4](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest). + +See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-talent +``` + +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/jobs.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/talent" + +client = Google::Cloud::Talent.company_service +request = ::Google::Cloud::Talent::V4::CreateCompanyRequest.new # (request fields as keyword arguments...) +response = client.create_company request +``` + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-talent-v4](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +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-talent`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-talent-v4`. +_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-talent`. +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-talent-v4`. + +### 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-talent/Rakefile b/owl-bot-staging/google-cloud-talent/Rakefile new file mode 100644 index 000000000000..a13788c6a6d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true +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-talent acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TALENT_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TALENT_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/talent/v4/company_service/credentials" + ::Google::Cloud::Talent::V4::CompanyService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TALENT_PROJECT"] = project + ENV["TALENT_TEST_PROJECT"] = project + ENV["TALENT_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-talent 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-talent 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-talent 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-talent gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-talent" + header "google-cloud-talent rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-talent yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-talent 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-talent 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-talent 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-talent/google-cloud-talent.gemspec b/owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec new file mode 100644 index 000000000000..8abc7cde86f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/talent/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-talent" + gem.version = Google::Cloud::Talent::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience." + gem.summary = "API Client library for the Cloud Talent Solution API" + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-talent-v4", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb b/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb new file mode 100644 index 000000000000..aad607d12a14 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent" unless defined? Google::Cloud::Talent::VERSION diff --git a/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb new file mode 100644 index 000000000000..939ff2472705 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb @@ -0,0 +1,436 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/talent/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :talent do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Talent + ## + # Create a new client object for CompanyService. + # + # By default, this returns an instance of + # [Google::Cloud::Talent::V4::CompanyService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-CompanyService-Client) + # for a gRPC client for version V4 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CompanyService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the CompanyService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Talent.company_service_available?}. + # + # ## About CompanyService + # + # A service that handles company management, including CRUD and enumeration. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.company_service version: :v4, transport: :grpc, &block + require "google/cloud/talent/#{version.to_s.downcase}" + + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Talent.const_get(package_name).const_get(:CompanyService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CompanyService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Talent.company_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CompanyService service, + # or if the versioned client gem needs an update to support the CompanyService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.company_service_available? version: :v4, transport: :grpc + require "google/cloud/talent/#{version.to_s.downcase}" + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Talent.const_get package_name + return false unless service_module.const_defined? :CompanyService + service_module = service_module.const_get :CompanyService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for Completion. + # + # By default, this returns an instance of + # [Google::Cloud::Talent::V4::Completion::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-Completion-Client) + # for a gRPC client for version V4 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Completion service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the Completion service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Talent.completion_available?}. + # + # ## About Completion + # + # A service handles auto completion. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.completion version: :v4, transport: :grpc, &block + require "google/cloud/talent/#{version.to_s.downcase}" + + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Talent.const_get(package_name).const_get(:Completion) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Completion service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Talent.completion}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Completion service, + # or if the versioned client gem needs an update to support the Completion service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.completion_available? version: :v4, transport: :grpc + require "google/cloud/talent/#{version.to_s.downcase}" + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Talent.const_get package_name + return false unless service_module.const_defined? :Completion + service_module = service_module.const_get :Completion + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for EventService. + # + # By default, this returns an instance of + # [Google::Cloud::Talent::V4::EventService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-EventService-Client) + # for a gRPC client for version V4 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the EventService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the EventService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Talent.event_service_available?}. + # + # ## About EventService + # + # A service handles client event report. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.event_service version: :v4, transport: :grpc, &block + require "google/cloud/talent/#{version.to_s.downcase}" + + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Talent.const_get(package_name).const_get(:EventService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the EventService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Talent.event_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the EventService service, + # or if the versioned client gem needs an update to support the EventService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.event_service_available? version: :v4, transport: :grpc + require "google/cloud/talent/#{version.to_s.downcase}" + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Talent.const_get package_name + return false unless service_module.const_defined? :EventService + service_module = service_module.const_get :EventService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for JobService. + # + # By default, this returns an instance of + # [Google::Cloud::Talent::V4::JobService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-JobService-Client) + # for a gRPC client for version V4 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the JobService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the JobService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Talent.job_service_available?}. + # + # ## About JobService + # + # A service handles job management, including job CRUD, enumeration and search. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.job_service version: :v4, transport: :grpc, &block + require "google/cloud/talent/#{version.to_s.downcase}" + + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Talent.const_get(package_name).const_get(:JobService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the JobService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Talent.job_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the JobService service, + # or if the versioned client gem needs an update to support the JobService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.job_service_available? version: :v4, transport: :grpc + require "google/cloud/talent/#{version.to_s.downcase}" + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Talent.const_get package_name + return false unless service_module.const_defined? :JobService + service_module = service_module.const_get :JobService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TenantService. + # + # By default, this returns an instance of + # [Google::Cloud::Talent::V4::TenantService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-TenantService-Client) + # for a gRPC client for version V4 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TenantService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TenantService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Talent.tenant_service_available?}. + # + # ## About TenantService + # + # A service that handles tenant management, including CRUD and enumeration. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.tenant_service version: :v4, transport: :grpc, &block + require "google/cloud/talent/#{version.to_s.downcase}" + + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Talent.const_get(package_name).const_get(:TenantService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TenantService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Talent.tenant_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TenantService service, + # or if the versioned client gem needs an update to support the TenantService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v4`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.tenant_service_available? version: :v4, transport: :grpc + require "google/cloud/talent/#{version.to_s.downcase}" + package_name = Google::Cloud::Talent + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Talent.const_get package_name + return false unless service_module.const_defined? :TenantService + service_module = service_module.const_get :TenantService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-talent library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.talent if block_given? + + ::Google::Cloud.configure.talent + end + end + end +end + +helper_path = ::File.join __dir__, "talent", "helpers.rb" +require "google/cloud/talent/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb new file mode 100644 index 000000000000..a30eaea332ba --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb b/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb new file mode 100644 index 000000000000..fb322e55d9ba --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/talent" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Talent::ClientConstructionMinitest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_company_service_grpc + skip unless Google::Cloud::Talent.company_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Talent.company_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Talent::V4::CompanyService::Client, client + end + end + + def test_company_service_rest + skip unless Google::Cloud::Talent.company_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Talent.company_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Talent::V4::CompanyService::Rest::Client, client + end + end + + def test_completion_grpc + skip unless Google::Cloud::Talent.completion_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Talent.completion transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Talent::V4::Completion::Client, client + end + end + + def test_completion_rest + skip unless Google::Cloud::Talent.completion_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Talent.completion transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Talent::V4::Completion::Rest::Client, client + end + end + + def test_event_service_grpc + skip unless Google::Cloud::Talent.event_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Talent.event_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Talent::V4::EventService::Client, client + end + end + + def test_event_service_rest + skip unless Google::Cloud::Talent.event_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Talent.event_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Talent::V4::EventService::Rest::Client, client + end + end + + def test_job_service_grpc + skip unless Google::Cloud::Talent.job_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Talent.job_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Talent::V4::JobService::Client, client + end + end + + def test_job_service_rest + skip unless Google::Cloud::Talent.job_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Talent.job_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Talent::V4::JobService::Rest::Client, client + end + end + + def test_tenant_service_grpc + skip unless Google::Cloud::Talent.tenant_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Talent.tenant_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Talent::V4::TenantService::Client, client + end + end + + def test_tenant_service_rest + skip unless Google::Cloud::Talent.tenant_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Talent.tenant_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Talent::V4::TenantService::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb b/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb new file mode 100644 index 000000000000..98c5a92372fb --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/talent/version" + +class Google::Cloud::Talent::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Talent::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-talent/test/helper.rb b/owl-bot-staging/google-cloud-talent/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-talent/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks-v2/.gitignore b/owl-bot-staging/google-cloud-tasks-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/.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-tasks-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks-v2/.repo-metadata.json new file mode 100644 index 000000000000..9f20ac72dea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudtasks.googleapis.com", + "api_shortname": "cloudtasks", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest", + "distribution_name": "google-cloud-tasks-v2", + "is_cloud": true, + "language": "ruby", + "name": "cloudtasks", + "name_pretty": "Cloud Tasks V2 API", + "product_documentation": "https://cloud.google.com/tasks", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TASKS", + "ruby-cloud-product-url": "https://cloud.google.com/tasks", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml b/owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml new file mode 100644 index 000000000000..c73aa9c3a62f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-tasks-v2.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-tasks-v2.rb" diff --git a/owl-bot-staging/google-cloud-tasks-v2/.toys.rb b/owl-bot-staging/google-cloud-tasks-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/.yardopts b/owl-bot-staging/google-cloud-tasks-v2/.yardopts new file mode 100644 index 000000000000..61acd5d300ad --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Tasks V2 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-tasks-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..17282377935b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-tasks-v2 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-tasks-v2 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/tasks/v2" + +client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/tasks/v2" + +::Google::Cloud::Tasks::V2::CloudTasks::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Tasks::V2::CloudTasks::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-tasks-v2 +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/tasks/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Tasks::V2::CloudTasks::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-tasks-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-tasks-v2/Gemfile b/owl-bot-staging/google-cloud-tasks-v2/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-tasks-v2/LICENSE.md b/owl-bot-staging/google-cloud-tasks-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/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-tasks-v2/README.md b/owl-bot-staging/google-cloud-tasks-v2/README.md new file mode 100644 index 000000000000..3acb58b85bcb --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Tasks V2 API + +Manages the execution of large numbers of distributed requests. + +Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. + +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 Tasks V2 API. Most users should consider using +the main client gem, +[google-cloud-tasks](https://rubygems.org/gems/google-cloud-tasks). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-tasks-v2 +``` + +## 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/cloudtasks.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/tasks/v2" + +client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new +request = ::Google::Cloud::Tasks::V2::ListQueuesRequest.new # (request fields as keyword arguments...) +response = client.list_queues request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/tasks) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/tasks/v2" +require "logger" + +client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-tasks`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-tasks-v2`. +_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-tasks`. +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-tasks-v2`. + +### 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-tasks-v2/Rakefile b/owl-bot-staging/google-cloud-tasks-v2/Rakefile new file mode 100644 index 000000000000..2339c75f47d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TASKS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TASKS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/tasks/v2/cloud_tasks/credentials" + ::Google::Cloud::Tasks::V2::CloudTasks::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TASKS_PROJECT"] = project + ENV["TASKS_TEST_PROJECT"] = project + ENV["TASKS_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-tasks-v2 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-tasks-v2 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-tasks-v2 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-tasks-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-tasks-v2" + header "google-cloud-tasks-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-tasks-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-tasks-v2 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-tasks-v2 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-tasks-v2 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-tasks-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-tasks-v2/gapic_metadata.json new file mode 100644 index 000000000000..2f95f7bab9cd --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.tasks.v2", + "libraryPackage": "::Google::Cloud::Tasks::V2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Tasks::V2::CloudTasks::Client", + "rpcs": { + "ListQueues": { + "methods": [ + "list_queues" + ] + }, + "GetQueue": { + "methods": [ + "get_queue" + ] + }, + "CreateQueue": { + "methods": [ + "create_queue" + ] + }, + "UpdateQueue": { + "methods": [ + "update_queue" + ] + }, + "DeleteQueue": { + "methods": [ + "delete_queue" + ] + }, + "PurgeQueue": { + "methods": [ + "purge_queue" + ] + }, + "PauseQueue": { + "methods": [ + "pause_queue" + ] + }, + "ResumeQueue": { + "methods": [ + "resume_queue" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "ListTasks": { + "methods": [ + "list_tasks" + ] + }, + "GetTask": { + "methods": [ + "get_task" + ] + }, + "CreateTask": { + "methods": [ + "create_task" + ] + }, + "DeleteTask": { + "methods": [ + "delete_task" + ] + }, + "RunTask": { + "methods": [ + "run_task" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec b/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec new file mode 100644 index 000000000000..63333163fa53 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/tasks/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-tasks-v2" + gem.version = Google::Cloud::Tasks::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details." + gem.summary = "Manages the execution of large numbers of distributed requests." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb new file mode 100644 index 000000000000..c0bfa1f74ccc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2" diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb new file mode 100644 index 000000000000..28eb8e8f1dd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloud_tasks" +require "google/cloud/tasks/v2/version" + +module Google + module Cloud + module Tasks + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/tasks/v2" + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/tasks/v2" + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/tasks/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb new file mode 100644 index 000000000000..0d1044729505 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" + +module Google + module Cloud + module Tasks + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/tasks/v2/rest" + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + module V2 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Tasks"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb new file mode 100644 index 000000000000..8cec3f1cb14f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/version" + +require "google/cloud/tasks/v2/cloud_tasks/credentials" +require "google/cloud/tasks/v2/cloud_tasks/paths" +require "google/cloud/tasks/v2/cloud_tasks/client" +require "google/cloud/tasks/v2/cloud_tasks/rest" + +module Google + module Cloud + module Tasks + module V2 + ## + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/tasks/v2/cloud_tasks" + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/tasks/v2/cloud_tasks/rest" + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + module CloudTasks + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_tasks", "helpers.rb" +require "google/cloud/tasks/v2/cloud_tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb new file mode 100644 index 000000000000..ec1c5ab6a70a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb @@ -0,0 +1,2259 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" +require "google/cloud/location" + +module Google + module Cloud + module Tasks + module V2 + module CloudTasks + ## + # Client for the CloudTasks service. + # + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_tasks_stub + + ## + # Configure the CloudTasks Client class. + # + # See {::Google::Cloud::Tasks::V2::CloudTasks::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudTasks clients + # ::Google::Cloud::Tasks::V2::CloudTasks::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", "Tasks", "V2"] + 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.list_queues.timeout = 20.0 + default_config.rpcs.list_queues.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_queue.timeout = 20.0 + default_config.rpcs.get_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_queue.timeout = 20.0 + + default_config.rpcs.update_queue.timeout = 20.0 + + default_config.rpcs.delete_queue.timeout = 20.0 + default_config.rpcs.delete_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.purge_queue.timeout = 20.0 + + default_config.rpcs.pause_queue.timeout = 20.0 + + default_config.rpcs.resume_queue.timeout = 20.0 + + default_config.rpcs.get_iam_policy.timeout = 20.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.set_iam_policy.timeout = 20.0 + + default_config.rpcs.test_iam_permissions.timeout = 20.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tasks.timeout = 20.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_task.timeout = 20.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_task.timeout = 20.0 + + default_config.rpcs.delete_task.timeout = 20.0 + default_config.rpcs.delete_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_task.timeout = 20.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudTasks 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::Tasks::V2::CloudTasks::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 + @cloud_tasks_stub.universe_domain + end + + ## + # Create a new CloudTasks client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudTasks 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/tasks/v2/cloudtasks_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 + + @cloud_tasks_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Tasks::V2::CloudTasks::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, + logger: @config.logger + ) + + @cloud_tasks_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_tasks_stub.logger + end + + # Service calls + + ## + # Lists queues. + # + # Queues are returned in lexicographical order. + # + # @overload list_queues(request, options = nil) + # Pass arguments to `list_queues` via a request object, either of type + # {::Google::Cloud::Tasks::V2::ListQueuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::ListQueuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_queues` via keyword arguments. Note that at + # least one keyword argument is 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 location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @param filter [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "state: PAUSED". + # + # Note that using filters might cause fewer queues than the + # requested page_size to be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues} method. It is an + # error to switch the value of the + # {::Google::Cloud::Tasks::V2::ListQueuesRequest#filter filter} while iterating + # through pages. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::ListQueuesRequest.new + # + # # Call the list_queues method. + # result = client.list_queues 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::Tasks::V2::Queue. + # p item + # end + # + def list_queues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListQueuesRequest + + # Converts hash 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_queues.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::Tasks::V2::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_queues.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_queues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a queue. + # + # @overload get_queue(request, options = nil) + # Pass arguments to `get_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::GetQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::GetQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `get_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::GetQueueRequest.new + # + # # Call the get_queue method. + # result = client.get_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def get_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload create_queue(request, options = nil) + # Pass arguments to `create_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::CreateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::CreateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) + # Pass arguments to `create_queue` via keyword arguments. Note that at + # least one keyword argument is 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 location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + # existing queue. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::CreateQueueRequest.new + # + # # Call the create_queue method. + # result = client.create_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def create_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload update_queue(request, options = nil) + # Pass arguments to `update_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::UpdateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::UpdateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) + # Pass arguments to `update_queue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} must be specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} cannot be changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new + # + # # Call the update_queue method. + # result = client.update_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def update_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::UpdateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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.queue&.name + header_params["queue.name"] = request.queue.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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload delete_queue(request, options = nil) + # Pass arguments to `delete_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::DeleteQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::DeleteQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `delete_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new + # + # # Call the delete_queue method. + # result = client.delete_queue request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + # + # @overload purge_queue(request, options = nil) + # Pass arguments to `purge_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::PurgeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::PurgeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_queue(name: nil) + # Pass arguments to `purge_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new + # + # # Call the purge_queue method. + # result = client.purge_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def purge_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PurgeQueueRequest + + # Converts hash 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.purge_queue.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::Tasks::V2::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.purge_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can + # still be added when the queue is paused. A queue is paused if its + # {::Google::Cloud::Tasks::V2::Queue#state state} is + # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. + # + # @overload pause_queue(request, options = nil) + # Pass arguments to `pause_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::PauseQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::PauseQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_queue(name: nil) + # Pass arguments to `pause_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::PauseQueueRequest.new + # + # # Call the pause_queue method. + # result = client.pause_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def pause_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PauseQueueRequest + + # Converts hash 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.pause_queue.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::Tasks::V2::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.pause_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a queue. + # + # This method resumes a queue after it has been + # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED} or + # {::Google::Cloud::Tasks::V2::Queue::State::DISABLED DISABLED}. The state of a + # queue is stored in the queue's {::Google::Cloud::Tasks::V2::Queue#state state}; + # after calling this method it will be set to + # {::Google::Cloud::Tasks::V2::Queue::State::RUNNING RUNNING}. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + # + # @overload resume_queue(request, options = nil) + # Pass arguments to `resume_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::ResumeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::ResumeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_queue(name: nil) + # Pass arguments to `resume_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new + # + # # Call the resume_queue method. + # result = client.resume_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def resume_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ResumeQueueRequest + + # Converts hash 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.resume_queue.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::Tasks::V2::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.resume_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_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::Tasks::V2::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.resource + header_params["resource"] = request.resource + 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_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. + # Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_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::Tasks::V2::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.resource + header_params["resource"] = request.resource + 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.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on a + # {::Google::Cloud::Tasks::V2::Queue Queue}. If the resource does not exist, this + # will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Tasks::V2::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.resource + header_params["resource"] = request.resource + 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.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the tasks in a queue. + # + # By default, only the {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC} view is + # retrieved due to performance considerations; + # {::Google::Cloud::Tasks::V2::ListTasksRequest#response_view response_view} + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # @param page_size [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks 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::Tasks::V2::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListTasksRequest + + # Converts hash 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_tasks.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::Tasks::V2::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_tasks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetTaskRequest + + # Converts hash 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_task.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::Tasks::V2::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * The maximum task size is 100KB. + # + # @overload create_task(request, options = nil) + # Pass arguments to `create_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::CreateTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::CreateTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) + # Pass arguments to `create_task` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task [::Google::Cloud::Tasks::V2::Task, ::Hash] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2::Task#name name}. If a name is not specified then + # the system will generate a random unique task id, which will be set in the + # task returned in the {::Google::Cloud::Tasks::V2::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} is not set or + # is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or executed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1hour after the original task was + # deleted or executed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9days after the original task was deleted or executed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::CreateTaskRequest.new + # + # # Call the create_task method. + # result = client.create_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Task. + # p result + # + def create_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateTaskRequest + + # Converts hash 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_task.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::Tasks::V2::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has executed successfully or permanently + # failed. + # + # @overload delete_task(request, options = nil) + # Pass arguments to `delete_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::DeleteTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::DeleteTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil) + # Pass arguments to `delete_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new + # + # # Call the delete_task method. + # result = client.delete_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteTaskRequest + + # Converts hash 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_task.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::Tasks::V2::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # {::Google::Cloud::Tasks::V2::RateLimits RateLimits} or is + # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. + # + # This command is meant to be used for manual debugging. For + # example, {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask} can be used to + # retry a failed task after a fix has been made or to manually force a task + # to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the [status][Task.status] after the task is dispatched but + # before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} will be reset to + # the time that {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask} was + # called plus the retry delay specified in the queue's + # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig}. + # + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask} returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + # + # @overload run_task(request, options = nil) + # Pass arguments to `run_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::RunTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::RunTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_task(name: nil, response_view: nil) + # Pass arguments to `run_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::RunTaskRequest.new + # + # # Call the run_task method. + # result = client.run_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Task. + # p result + # + def run_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::RunTaskRequest + + # Converts hash 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.run_task.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::Tasks::V2::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.run_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudTasks API. + # + # This class represents the configuration for CloudTasks, + # 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::Tasks::V2::CloudTasks::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_queues to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Tasks::V2::CloudTasks::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CloudTasks 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_queues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_queues + ## + # RPC-specific configuration for `get_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_queue + ## + # RPC-specific configuration for `create_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_queue + ## + # RPC-specific configuration for `update_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_queue + ## + # RPC-specific configuration for `delete_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_queue + ## + # RPC-specific configuration for `purge_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_queue + ## + # RPC-specific configuration for `pause_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_queue + ## + # RPC-specific configuration for `resume_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_queue + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `create_task` + # @return [::Gapic::Config::Method] + # + attr_reader :create_task + ## + # RPC-specific configuration for `delete_task` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_task + ## + # RPC-specific configuration for `run_task` + # @return [::Gapic::Config::Method] + # + attr_reader :run_task + + # @private + def initialize parent_rpcs = nil + list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues + @list_queues = ::Gapic::Config::Method.new list_queues_config + get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue + @get_queue = ::Gapic::Config::Method.new get_queue_config + create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue + @create_queue = ::Gapic::Config::Method.new create_queue_config + update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue + @update_queue = ::Gapic::Config::Method.new update_queue_config + delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue + @delete_queue = ::Gapic::Config::Method.new delete_queue_config + purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue + @purge_queue = ::Gapic::Config::Method.new purge_queue_config + pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue + @pause_queue = ::Gapic::Config::Method.new pause_queue_config + resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue + @resume_queue = ::Gapic::Config::Method.new resume_queue_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task + @create_task = ::Gapic::Config::Method.new create_task_config + delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task + @delete_task = ::Gapic::Config::Method.new delete_task_config + run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task + @run_task = ::Gapic::Config::Method.new run_task_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb new file mode 100644 index 000000000000..f34da6642695 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2 + module CloudTasks + # Credentials for the CloudTasks API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "TASKS_CREDENTIALS", + "TASKS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TASKS_CREDENTIALS_JSON", + "TASKS_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-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb new file mode 100644 index 000000000000..06a5c7d8a9b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2 + module CloudTasks + # Path helper methods for the CloudTasks 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 Queue resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/queues/{queue}` + # + # @param project [String] + # @param location [String] + # @param queue [String] + # + # @return [::String] + def queue_path project:, location:, queue: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/queues/#{queue}" + end + + ## + # Create a fully-qualified Task resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/queues/{queue}/tasks/{task}` + # + # @param project [String] + # @param location [String] + # @param queue [String] + # @param task [String] + # + # @return [::String] + def task_path project:, location:, queue:, task: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "queue cannot contain /" if queue.to_s.include? "/" + + "projects/#{project}/locations/#{location}/queues/#{queue}/tasks/#{task}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb new file mode 100644 index 000000000000..a78a827e9ee6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/version" +require "google/cloud/tasks/v2/bindings_override" + +require "google/cloud/tasks/v2/cloud_tasks/credentials" +require "google/cloud/tasks/v2/cloud_tasks/paths" +require "google/cloud/tasks/v2/cloud_tasks/rest/client" + +module Google + module Cloud + module Tasks + module V2 + ## + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/tasks/v2/cloud_tasks/rest" + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + module CloudTasks + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/tasks/v2/cloud_tasks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb new file mode 100644 index 000000000000..3075391070f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb @@ -0,0 +1,2112 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" +require "google/cloud/tasks/v2/cloud_tasks/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Tasks + module V2 + module CloudTasks + module Rest + ## + # REST client for the CloudTasks service. + # + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_tasks_stub + + ## + # Configure the CloudTasks Client class. + # + # See {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudTasks clients + # ::Google::Cloud::Tasks::V2::CloudTasks::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", "Tasks", "V2"] + 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.list_queues.timeout = 20.0 + default_config.rpcs.list_queues.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_queue.timeout = 20.0 + default_config.rpcs.get_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_queue.timeout = 20.0 + + default_config.rpcs.update_queue.timeout = 20.0 + + default_config.rpcs.delete_queue.timeout = 20.0 + default_config.rpcs.delete_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.purge_queue.timeout = 20.0 + + default_config.rpcs.pause_queue.timeout = 20.0 + + default_config.rpcs.resume_queue.timeout = 20.0 + + default_config.rpcs.get_iam_policy.timeout = 20.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.set_iam_policy.timeout = 20.0 + + default_config.rpcs.test_iam_permissions.timeout = 20.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tasks.timeout = 20.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_task.timeout = 20.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_task.timeout = 20.0 + + default_config.rpcs.delete_task.timeout = 20.0 + default_config.rpcs.delete_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_task.timeout = 20.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudTasks 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::Tasks::V2::CloudTasks::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 + @cloud_tasks_stub.universe_domain + end + + ## + # Create a new CloudTasks REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudTasks 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 + + @cloud_tasks_stub = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_tasks_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_tasks_stub.logger + end + + # Service calls + + ## + # Lists queues. + # + # Queues are returned in lexicographical order. + # + # @overload list_queues(request, options = nil) + # Pass arguments to `list_queues` via a request object, either of type + # {::Google::Cloud::Tasks::V2::ListQueuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::ListQueuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_queues` via keyword arguments. Note that at + # least one keyword argument is 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 location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @param filter [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "state: PAUSED". + # + # Note that using filters might cause fewer queues than the + # requested page_size to be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#list_queues ListQueues} method. It is an + # error to switch the value of the + # {::Google::Cloud::Tasks::V2::ListQueuesRequest#filter filter} while iterating + # through pages. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::ListQueuesRequest.new + # + # # Call the list_queues method. + # result = client.list_queues 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::Tasks::V2::Queue. + # p item + # end + # + def list_queues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListQueuesRequest + + # Converts hash 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_queues.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::Tasks::V2::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_queues.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_queues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.list_queues request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a queue. + # + # @overload get_queue(request, options = nil) + # Pass arguments to `get_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::GetQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::GetQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `get_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::GetQueueRequest.new + # + # # Call the get_queue method. + # result = client.get_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def get_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload create_queue(request, options = nil) + # Pass arguments to `create_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::CreateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::CreateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) + # Pass arguments to `create_queue` via keyword arguments. Note that at + # least one keyword argument is 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 location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + # existing queue. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::CreateQueueRequest.new + # + # # Call the create_queue method. + # result = client.create_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def create_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.create_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload update_queue(request, options = nil) + # Pass arguments to `update_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::UpdateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::UpdateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) + # Pass arguments to `update_queue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} must be specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} cannot be changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new + # + # # Call the update_queue method. + # result = client.update_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def update_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::UpdateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.update_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload delete_queue(request, options = nil) + # Pass arguments to `delete_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::DeleteQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::DeleteQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `delete_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new + # + # # Call the delete_queue method. + # result = client.delete_queue request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteQueueRequest + + # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.delete_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + # + # @overload purge_queue(request, options = nil) + # Pass arguments to `purge_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::PurgeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::PurgeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_queue(name: nil) + # Pass arguments to `purge_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new + # + # # Call the purge_queue method. + # result = client.purge_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def purge_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PurgeQueueRequest + + # Converts hash 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.purge_queue.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::Tasks::V2::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.purge_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.purge_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can + # still be added when the queue is paused. A queue is paused if its + # {::Google::Cloud::Tasks::V2::Queue#state state} is + # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. + # + # @overload pause_queue(request, options = nil) + # Pass arguments to `pause_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::PauseQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::PauseQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_queue(name: nil) + # Pass arguments to `pause_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::PauseQueueRequest.new + # + # # Call the pause_queue method. + # result = client.pause_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def pause_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PauseQueueRequest + + # Converts hash 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.pause_queue.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::Tasks::V2::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.pause_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.pause_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a queue. + # + # This method resumes a queue after it has been + # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED} or + # {::Google::Cloud::Tasks::V2::Queue::State::DISABLED DISABLED}. The state of a + # queue is stored in the queue's {::Google::Cloud::Tasks::V2::Queue#state state}; + # after calling this method it will be set to + # {::Google::Cloud::Tasks::V2::Queue::State::RUNNING RUNNING}. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + # + # @overload resume_queue(request, options = nil) + # Pass arguments to `resume_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2::ResumeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::ResumeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_queue(name: nil) + # Pass arguments to `resume_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new + # + # # Call the resume_queue method. + # result = client.resume_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Queue. + # p result + # + def resume_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ResumeQueueRequest + + # Converts hash 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.resume_queue.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::Tasks::V2::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.resume_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.resume_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_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::Tasks::V2::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_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. + # Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_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::Tasks::V2::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.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on a + # {::Google::Cloud::Tasks::V2::Queue Queue}. If the resource does not exist, this + # will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Tasks::V2::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.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the tasks in a queue. + # + # By default, only the {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC} view is + # retrieved due to performance considerations; + # {::Google::Cloud::Tasks::V2::ListTasksRequest#response_view response_view} + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # @param page_size [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks 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::Tasks::V2::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListTasksRequest + + # Converts hash 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_tasks.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::Tasks::V2::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_tasks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.list_tasks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetTaskRequest + + # Converts hash 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_task.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::Tasks::V2::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * The maximum task size is 100KB. + # + # @overload create_task(request, options = nil) + # Pass arguments to `create_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::CreateTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::CreateTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) + # Pass arguments to `create_task` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task [::Google::Cloud::Tasks::V2::Task, ::Hash] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2::Task#name name}. If a name is not specified then + # the system will generate a random unique task id, which will be set in the + # task returned in the {::Google::Cloud::Tasks::V2::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} is not set or + # is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or executed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1hour after the original task was + # deleted or executed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9days after the original task was deleted or executed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::CreateTaskRequest.new + # + # # Call the create_task method. + # result = client.create_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Task. + # p result + # + def create_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateTaskRequest + + # Converts hash 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_task.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::Tasks::V2::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.create_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has executed successfully or permanently + # failed. + # + # @overload delete_task(request, options = nil) + # Pass arguments to `delete_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::DeleteTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::DeleteTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil) + # Pass arguments to `delete_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new + # + # # Call the delete_task method. + # result = client.delete_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteTaskRequest + + # Converts hash 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_task.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::Tasks::V2::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.delete_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # {::Google::Cloud::Tasks::V2::RateLimits RateLimits} or is + # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. + # + # This command is meant to be used for manual debugging. For + # example, {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#run_task RunTask} can be used to + # retry a failed task after a fix has been made or to manually force a task + # to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the [status][Task.status] after the task is dispatched but + # before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} will be reset to + # the time that {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#run_task RunTask} was + # called plus the retry delay specified in the queue's + # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig}. + # + # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#run_task RunTask} returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + # + # @overload run_task(request, options = nil) + # Pass arguments to `run_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2::RunTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2::RunTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_task(name: nil, response_view: nil) + # Pass arguments to `run_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2::RunTaskRequest.new + # + # # Call the run_task method. + # result = client.run_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2::Task. + # p result + # + def run_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::RunTaskRequest + + # Converts hash 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.run_task.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::Tasks::V2::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.run_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.run_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudTasks REST API. + # + # This class represents the configuration for CloudTasks 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::Tasks::V2::CloudTasks::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_queues to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CloudTasks 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_queues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_queues + ## + # RPC-specific configuration for `get_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_queue + ## + # RPC-specific configuration for `create_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_queue + ## + # RPC-specific configuration for `update_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_queue + ## + # RPC-specific configuration for `delete_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_queue + ## + # RPC-specific configuration for `purge_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_queue + ## + # RPC-specific configuration for `pause_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_queue + ## + # RPC-specific configuration for `resume_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_queue + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `create_task` + # @return [::Gapic::Config::Method] + # + attr_reader :create_task + ## + # RPC-specific configuration for `delete_task` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_task + ## + # RPC-specific configuration for `run_task` + # @return [::Gapic::Config::Method] + # + attr_reader :run_task + + # @private + def initialize parent_rpcs = nil + list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues + @list_queues = ::Gapic::Config::Method.new list_queues_config + get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue + @get_queue = ::Gapic::Config::Method.new get_queue_config + create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue + @create_queue = ::Gapic::Config::Method.new create_queue_config + update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue + @update_queue = ::Gapic::Config::Method.new update_queue_config + delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue + @delete_queue = ::Gapic::Config::Method.new delete_queue_config + purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue + @purge_queue = ::Gapic::Config::Method.new purge_queue_config + pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue + @pause_queue = ::Gapic::Config::Method.new pause_queue_config + resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue + @resume_queue = ::Gapic::Config::Method.new resume_queue_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task + @create_task = ::Gapic::Config::Method.new create_task_config + delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task + @delete_task = ::Gapic::Config::Method.new delete_task_config + run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task + @run_task = ::Gapic::Config::Method.new run_task_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb new file mode 100644 index 000000000000..1ca3b143b8ed --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb @@ -0,0 +1,1067 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" + +module Google + module Cloud + module Tasks + module V2 + module CloudTasks + module Rest + ## + # REST service stub for the CloudTasks service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_queues REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::ListQueuesRequest] + # 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::Tasks::V2::ListQueuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::ListQueuesResponse] + # A result object deserialized from the server's reply + def list_queues request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_queues_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, + method_name: "list_queues", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::GetQueueRequest] + # 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::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # A result object deserialized from the server's reply + def get_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_queue_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, + method_name: "get_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::CreateQueueRequest] + # 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::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # A result object deserialized from the server's reply + def create_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_queue_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, + method_name: "create_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::UpdateQueueRequest] + # 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::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # A result object deserialized from the server's reply + def update_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_queue_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, + method_name: "update_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::DeleteQueueRequest] + # 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_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_queue_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, + method_name: "delete_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::PurgeQueueRequest] + # 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::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # A result object deserialized from the server's reply + def purge_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_queue_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, + method_name: "purge_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the pause_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::PauseQueueRequest] + # 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::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # A result object deserialized from the server's reply + def pause_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_queue_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, + method_name: "pause_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the resume_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::ResumeQueueRequest] + # 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::Tasks::V2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Queue] + # A result object deserialized from the server's reply + def resume_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_queue_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, + method_name: "resume_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_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, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_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, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # 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::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::ListTasksRequest] + # 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::Tasks::V2::ListTasksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::ListTasksResponse] + # A result object deserialized from the server's reply + def list_tasks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_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, + method_name: "list_tasks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::GetTaskRequest] + # 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::Tasks::V2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # A result object deserialized from the server's reply + def get_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_task_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, + method_name: "get_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::CreateTaskRequest] + # 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::Tasks::V2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # A result object deserialized from the server's reply + def create_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_task_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, + method_name: "create_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::DeleteTaskRequest] + # 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_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_task_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, + method_name: "delete_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::RunTaskRequest] + # 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::Tasks::V2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2::Task] + # A result object deserialized from the server's reply + def run_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_task_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, + method_name: "run_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_queues REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::ListQueuesRequest] + # 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_queues_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/queues", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::GetQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::CreateQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/queues", + body: "queue", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::UpdateQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{queue.name}", + body: "queue", + matches: [ + ["queue.name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::DeleteQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::PurgeQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:purge", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::PauseQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::ResumeQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::ListTasksRequest] + # 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_tasks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/tasks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::GetTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::CreateTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/tasks", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::DeleteTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2::RunTaskRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb new file mode 100644 index 000000000000..61dbbe06528e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2/cloudtasks.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/tasks/v2/queue_pb' +require 'google/cloud/tasks/v2/task_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n&google/cloud/tasks/v2/cloudtasks.proto\x12\x15google.cloud.tasks.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a!google/cloud/tasks/v2/queue.proto\x1a google/cloud/tasks/v2/task.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x83\x01\n\x11ListQueuesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"[\n\x12ListQueuesResponse\x12,\n\x06queues\x18\x01 \x03(\x0b\x32\x1c.google.cloud.tasks.v2.Queue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0fGetQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"\x7f\n\x12\x43reateQueueRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x30\n\x05queue\x18\x02 \x01(\x0b\x32\x1c.google.cloud.tasks.v2.QueueB\x03\xe0\x41\x02\"w\n\x12UpdateQueueRequest\x12\x30\n\x05queue\x18\x01 \x01(\x0b\x32\x1c.google.cloud.tasks.v2.QueueB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PurgeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PauseQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"K\n\x12ResumeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"\xaa\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x37\n\rresponse_view\x18\x02 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"X\n\x11ListTasksResponse\x12*\n\x05tasks\x18\x01 \x03(\x0b\x32\x1b.google.cloud.tasks.v2.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x7f\n\x0eGetTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x37\n\rresponse_view\x18\x02 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\"\xb4\x01\n\x11\x43reateTaskRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12.\n\x04task\x18\x02 \x01(\x0b\x32\x1b.google.cloud.tasks.v2.TaskB\x03\xe0\x41\x02\x12\x37\n\rresponse_view\x18\x03 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\"I\n\x11\x44\x65leteTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\"\x7f\n\x0eRunTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x37\n\rresponse_view\x18\x02 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View2\xdd\x14\n\nCloudTasks\x12\x9e\x01\n\nListQueues\x12(.google.cloud.tasks.v2.ListQueuesRequest\x1a).google.cloud.tasks.v2.ListQueuesResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v2/{parent=projects/*/locations/*}/queues\x12\x8b\x01\n\x08GetQueue\x12&.google.cloud.tasks.v2.GetQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v2/{name=projects/*/locations/*/queues/*}\x12\xa0\x01\n\x0b\x43reateQueue\x12).google.cloud.tasks.v2.CreateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"H\xda\x41\x0cparent,queue\x82\xd3\xe4\x93\x02\x33\"*/v2/{parent=projects/*/locations/*}/queues:\x05queue\x12\xab\x01\n\x0bUpdateQueue\x12).google.cloud.tasks.v2.UpdateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"S\xda\x41\x11queue,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\x12\x8b\x01\n\x0b\x44\x65leteQueue\x12).google.cloud.tasks.v2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v2/{name=projects/*/locations/*/queues/*}\x12\x98\x01\n\nPurgeQueue\x12(.google.cloud.tasks.v2.PurgeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:purge:\x01*\x12\x98\x01\n\nPauseQueue\x12(.google.cloud.tasks.v2.PauseQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:pause:\x01*\x12\x9b\x01\n\x0bResumeQueue\x12).google.cloud.tasks.v2.ResumeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v2/{name=projects/*/locations/*/queues/*}:resume:\x01*\x12\x9c\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"Q\xda\x41\x08resource\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\x12\xa3\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\x12\xce\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"c\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x46\"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\x12\xa3\x01\n\tListTasks\x12\'.google.cloud.tasks.v2.ListTasksRequest\x1a(.google.cloud.tasks.v2.ListTasksResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{parent=projects/*/locations/*/queues/*}/tasks\x12\x90\x01\n\x07GetTask\x12%.google.cloud.tasks.v2.GetTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xa0\x01\n\nCreateTask\x12(.google.cloud.tasks.v2.CreateTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"K\xda\x41\x0bparent,task\x82\xd3\xe4\x93\x02\x37\"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\x12\x91\x01\n\nDeleteTask\x12(.google.cloud.tasks.v2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\x97\x01\n\x07RunTask\x12%.google.cloud.tasks.v2.RunTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\x1aM\xca\x41\x19\x63loudtasks.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBv\n\x19\x63om.google.cloud.tasks.v2B\x0f\x43loudTasksProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspb\xa2\x02\x05TASKSb\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.tasks.v2.Queue", "google/cloud/tasks/v2/queue.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.tasks.v2.Task", "google/cloud/tasks/v2/task.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 Tasks + module V2 + ListQueuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListQueuesRequest").msgclass + ListQueuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListQueuesResponse").msgclass + GetQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.GetQueueRequest").msgclass + CreateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.CreateQueueRequest").msgclass + UpdateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.UpdateQueueRequest").msgclass + DeleteQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.DeleteQueueRequest").msgclass + PurgeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.PurgeQueueRequest").msgclass + PauseQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.PauseQueueRequest").msgclass + ResumeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ResumeQueueRequest").msgclass + ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListTasksRequest").msgclass + ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListTasksResponse").msgclass + GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.GetTaskRequest").msgclass + CreateTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.CreateTaskRequest").msgclass + DeleteTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.DeleteTaskRequest").msgclass + RunTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.RunTaskRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb new file mode 100644 index 000000000000..cb4e06b079fc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb @@ -0,0 +1,206 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/tasks/v2/cloudtasks.proto for package 'google.cloud.tasks.v2' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/tasks/v2/cloudtasks_pb' + +module Google + module Cloud + module Tasks + module V2 + module CloudTasks + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.tasks.v2.CloudTasks' + + # Lists queues. + # + # Queues are returned in lexicographical order. + rpc :ListQueues, ::Google::Cloud::Tasks::V2::ListQueuesRequest, ::Google::Cloud::Tasks::V2::ListQueuesResponse + # Gets a queue. + rpc :GetQueue, ::Google::Cloud::Tasks::V2::GetQueueRequest, ::Google::Cloud::Tasks::V2::Queue + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :CreateQueue, ::Google::Cloud::Tasks::V2::CreateQueueRequest, ::Google::Cloud::Tasks::V2::Queue + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :UpdateQueue, ::Google::Cloud::Tasks::V2::UpdateQueueRequest, ::Google::Cloud::Tasks::V2::Queue + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :DeleteQueue, ::Google::Cloud::Tasks::V2::DeleteQueueRequest, ::Google::Protobuf::Empty + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + rpc :PurgeQueue, ::Google::Cloud::Tasks::V2::PurgeQueueRequest, ::Google::Cloud::Tasks::V2::Queue + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can + # still be added when the queue is paused. A queue is paused if its + # [state][google.cloud.tasks.v2.Queue.state] is + # [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + rpc :PauseQueue, ::Google::Cloud::Tasks::V2::PauseQueueRequest, ::Google::Cloud::Tasks::V2::Queue + # Resume a queue. + # + # This method resumes a queue after it has been + # [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or + # [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a + # queue is stored in the queue's [state][google.cloud.tasks.v2.Queue.state]; + # after calling this method it will be set to + # [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + rpc :ResumeQueue, ::Google::Cloud::Tasks::V2::ResumeQueueRequest, ::Google::Cloud::Tasks::V2::Queue + # Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. + # Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on a + # [Queue][google.cloud.tasks.v2.Queue]. If the resource does not exist, this + # will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Lists the tasks in a queue. + # + # By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is + # retrieved due to performance considerations; + # [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + rpc :ListTasks, ::Google::Cloud::Tasks::V2::ListTasksRequest, ::Google::Cloud::Tasks::V2::ListTasksResponse + # Gets a task. + rpc :GetTask, ::Google::Cloud::Tasks::V2::GetTaskRequest, ::Google::Cloud::Tasks::V2::Task + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * The maximum task size is 100KB. + rpc :CreateTask, ::Google::Cloud::Tasks::V2::CreateTaskRequest, ::Google::Cloud::Tasks::V2::Task + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has executed successfully or permanently + # failed. + rpc :DeleteTask, ::Google::Cloud::Tasks::V2::DeleteTaskRequest, ::Google::Protobuf::Empty + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # [RateLimits][google.cloud.tasks.v2.RateLimits] or is + # [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + # + # This command is meant to be used for manual debugging. For + # example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to + # retry a failed task after a fix has been made or to manually force a task + # to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the [status][Task.status] after the task is dispatched but + # before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to + # the time that [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was + # called plus the retry delay specified in the queue's + # [RetryConfig][google.cloud.tasks.v2.RetryConfig]. + # + # [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + rpc :RunTask, ::Google::Cloud::Tasks::V2::RunTaskRequest, ::Google::Cloud::Tasks::V2::Task + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb new file mode 100644 index 000000000000..32c7710eaeac --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2/queue.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/tasks/v2/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n!google/cloud/tasks/v2/queue.proto\x12\x15google.cloud.tasks.v2\x1a\x19google/api/resource.proto\x1a\"google/cloud/tasks/v2/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb2\x04\n\x05Queue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12L\n\x1b\x61pp_engine_routing_override\x18\x02 \x01(\x0b\x32\'.google.cloud.tasks.v2.AppEngineRouting\x12\x36\n\x0brate_limits\x18\x03 \x01(\x0b\x32!.google.cloud.tasks.v2.RateLimits\x12\x38\n\x0cretry_config\x18\x04 \x01(\x0b\x32\".google.cloud.tasks.v2.RetryConfig\x12\x31\n\x05state\x18\x05 \x01(\x0e\x32\".google.cloud.tasks.v2.Queue.State\x12.\n\npurge_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12S\n\x1astackdriver_logging_config\x18\t \x01(\x0b\x32/.google.cloud.tasks.v2.StackdriverLoggingConfig\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03:\\\xea\x41Y\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x36projects/{project}/locations/{location}/queues/{queue}\"j\n\nRateLimits\x12!\n\x19max_dispatches_per_second\x18\x01 \x01(\x01\x12\x16\n\x0emax_burst_size\x18\x02 \x01(\x05\x12!\n\x19max_concurrent_dispatches\x18\x03 \x01(\x05\"\xd1\x01\n\x0bRetryConfig\x12\x14\n\x0cmax_attempts\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmin_backoff\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmax_backoff\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\"2\n\x18StackdriverLoggingConfig\x12\x16\n\x0esampling_ratio\x18\x01 \x01(\x01\x42i\n\x19\x63om.google.cloud.tasks.v2B\nQueueProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspbb\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.tasks.v2.AppEngineRouting", "google/cloud/tasks/v2/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.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 Tasks + module V2 + Queue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Queue").msgclass + Queue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Queue.State").enummodule + RateLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.RateLimits").msgclass + RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.RetryConfig").msgclass + StackdriverLoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.StackdriverLoggingConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb new file mode 100644 index 000000000000..4c702f14da87 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloud_tasks/rest" +require "google/cloud/tasks/v2/bindings_override" +require "google/cloud/tasks/v2/version" + +module Google + module Cloud + module Tasks + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/tasks/v2/rest" + # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb new file mode 100644 index 000000000000..d5652cbc79ee --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2/target.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n\"google/cloud/tasks/v2/target.proto\x12\x15google.cloud.tasks.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xe1\x02\n\x0bHttpRequest\x12\x10\n\x03url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x0bhttp_method\x18\x02 \x01(\x0e\x32!.google.cloud.tasks.v2.HttpMethod\x12@\n\x07headers\x18\x03 \x03(\x0b\x32/.google.cloud.tasks.v2.HttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12\x38\n\x0boauth_token\x18\x05 \x01(\x0b\x32!.google.cloud.tasks.v2.OAuthTokenH\x00\x12\x36\n\noidc_token\x18\x06 \x01(\x0b\x32 .google.cloud.tasks.v2.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xb2\x02\n\x14\x41ppEngineHttpRequest\x12\x36\n\x0bhttp_method\x18\x01 \x01(\x0e\x32!.google.cloud.tasks.v2.HttpMethod\x12\x43\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32\'.google.cloud.tasks.v2.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12I\n\x07headers\x18\x04 \x03(\x0b\x32\x38.google.cloud.tasks.v2.AppEngineHttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42j\n\x19\x63om.google.cloud.tasks.v2B\x0bTargetProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspbb\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 = [ + ] + 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 Tasks + module V2 + HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.HttpRequest").msgclass + AppEngineHttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.AppEngineHttpRequest").msgclass + AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.AppEngineRouting").msgclass + OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.OAuthToken").msgclass + OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.OidcToken").msgclass + HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.HttpMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb new file mode 100644 index 000000000000..de632c9ad771 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2/task.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/tasks/v2/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n google/cloud/tasks/v2/task.proto\x12\x15google.cloud.tasks.v2\x1a\x19google/api/resource.proto\x1a\"google/cloud/tasks/v2/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb4\x05\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x17\x61pp_engine_http_request\x18\x02 \x01(\x0b\x32+.google.cloud.tasks.v2.AppEngineHttpRequestH\x00\x12:\n\x0chttp_request\x18\x03 \x01(\x0b\x32\".google.cloud.tasks.v2.HttpRequestH\x00\x12\x31\n\rschedule_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x11\x64ispatch_deadline\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x16\n\x0e\x64ispatch_count\x18\x07 \x01(\x05\x12\x16\n\x0eresponse_count\x18\x08 \x01(\x05\x12\x35\n\rfirst_attempt\x18\t \x01(\x0b\x32\x1e.google.cloud.tasks.v2.Attempt\x12\x34\n\x0clast_attempt\x18\n \x01(\x0b\x32\x1e.google.cloud.tasks.v2.Attempt\x12.\n\x04view\x18\x0b \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\"1\n\x04View\x12\x14\n\x10VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02:h\xea\x41\x65\n\x1e\x63loudtasks.googleapis.com/Task\x12\x43projects/{project}/locations/{location}/queues/{queue}/tasks/{task}B\x0e\n\x0cmessage_type\"\xcf\x01\n\x07\x41ttempt\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rdispatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rresponse_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x0fresponse_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusBh\n\x19\x63om.google.cloud.tasks.v2B\tTaskProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspbb\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.tasks.v2.AppEngineHttpRequest", "google/cloud/tasks/v2/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.rpc.Status", "google/rpc/status.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 Tasks + module V2 + Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Task").msgclass + Task::View = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Task.View").enummodule + Attempt = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Attempt").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb new file mode 100644 index 000000000000..f4f62b513076 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md new file mode 100644 index 000000000000..4412e67816f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Tasks V2 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-tasks-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb new file mode 100644 index 000000000000..d756876962c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb @@ -0,0 +1,375 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2 + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @!attribute [rw] filter + # @return [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "state: PAUSED". + # + # Note that using filters might cause fewer queues than the + # requested page_size to be returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues} method. It is an + # error to switch the value of the + # {::Google::Cloud::Tasks::V2::ListQueuesRequest#filter filter} while iterating + # through pages. + class ListQueuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues}. + # @!attribute [rw] queues + # @return [::Array<::Google::Cloud::Tasks::V2::Queue>] + # The list of queues. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # + # To return the next page of results, call + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues} with this value + # as the {::Google::Cloud::Tasks::V2::ListQueuesRequest#page_token page_token}. + # + # If the next_page_token is empty, there are no more results. + # + # The page token is valid for only 2 hours. + class ListQueuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for {::Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue GetQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + class GetQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue CreateQueue}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @!attribute [rw] queue + # @return [::Google::Cloud::Tasks::V2::Queue] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an + # existing queue. + class CreateQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue UpdateQueue}. + # @!attribute [rw] queue + # @return [::Google::Cloud::Tasks::V2::Queue] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} must be specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} cannot be changed. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + class UpdateQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue DeleteQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + class DeleteQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue PurgeQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class PurgeQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue PauseQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class PauseQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue ResumeQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class ResumeQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing tasks using + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks}. + # @!attribute [rw] parent + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + class ListTasksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing tasks using + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks}. + # @!attribute [rw] tasks + # @return [::Array<::Google::Cloud::Tasks::V2::Task>] + # The list of tasks. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # + # To return the next page of results, call + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks} with this value as + # the {::Google::Cloud::Tasks::V2::ListTasksRequest#page_token page_token}. + # + # If the next_page_token is empty, there are no more results. + class ListTasksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a task using + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#get_task GetTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + class GetTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask}. + # @!attribute [rw] parent + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @!attribute [rw] task + # @return [::Google::Cloud::Tasks::V2::Task] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2::Task#name name}. If a name is not specified then + # the system will generate a random unique task id, which will be set in the + # task returned in the {::Google::Cloud::Tasks::V2::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} is not set or + # is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or executed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1hour after the original task was + # deleted or executed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9days after the original task was deleted or executed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + class CreateTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a task using + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task DeleteTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + class DeleteTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for forcing a task to run now using + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} will be returned. + # + # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; + # not all information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. + class RunTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb new file mode 100644 index 000000000000..48b30becd0e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb @@ -0,0 +1,376 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2 + # A queue is a container of related tasks. Queues are configured to manage + # how those tasks are dispatched. Configurable properties include rate limits, + # retry options, queue types, and others. + # @!attribute [rw] name + # @return [::String] + # Caller-specified and required in + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue CreateQueue}, after which it + # becomes output only. + # + # The queue name. + # + # The queue name must have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the queue's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + # hyphens (-). The maximum length is 100 characters. + # @!attribute [rw] app_engine_routing_override + # @return [::Google::Cloud::Tasks::V2::AppEngineRouting] + # Overrides for + # [task-level + # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + # These settings apply only to + # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in this + # queue. {::Google::Cloud::Tasks::V2::HttpRequest Http tasks} are not affected. + # + # If set, `app_engine_routing_override` is used for all + # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in the + # queue, no matter what the setting is for the [task-level + # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + # @!attribute [rw] rate_limits + # @return [::Google::Cloud::Tasks::V2::RateLimits] + # Rate limits for task dispatches. + # + # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits} and + # {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config} are related + # because they both control task attempts. However they control task attempts + # in different ways: + # + # * {::Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits} controls the total + # rate of + # dispatches from a queue (i.e. all traffic dispatched from the + # queue, regardless of whether the dispatch is from a first + # attempt or a retry). + # * {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config} controls what + # happens to + # particular a task after its first attempt fails. That is, + # {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config} controls task + # retries (the second attempt, third attempt, etc). + # + # The queue's actual dispatch rate is the result of: + # + # * Number of tasks in the queue + # * User-specified throttling: + # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits}, + # {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config}, and the + # [queue's state][google.cloud.tasks.v2.Queue.state]. + # * System throttling due to `429` (Too Many Requests) or `503` (Service + # Unavailable) responses from the worker, high error rates, or to smooth + # sudden large traffic spikes. + # @!attribute [rw] retry_config + # @return [::Google::Cloud::Tasks::V2::RetryConfig] + # Settings that determine the retry behavior. + # + # * For tasks created using Cloud Tasks: the queue-level retry settings + # apply to all tasks in the queue that were created using Cloud Tasks. + # Retry settings cannot be set on individual tasks. + # * For tasks created using the App Engine SDK: the queue-level retry + # settings apply to all tasks in the queue which do not have retry settings + # explicitly set on the task and were created by the App Engine SDK. See + # [App Engine + # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + # @!attribute [rw] state + # @return [::Google::Cloud::Tasks::V2::Queue::State] + # Output only. The state of the queue. + # + # `state` can only be changed by calling + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue PauseQueue}, + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue ResumeQueue}, or uploading + # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue UpdateQueue} cannot be used + # to change `state`. + # @!attribute [rw] purge_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time this queue was purged. + # + # All tasks that were {::Google::Cloud::Tasks::V2::Task#create_time created} + # before this time were purged. + # + # A queue can be purged using + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue PurgeQueue}, the [App Engine + # Task Queue SDK, or the Cloud + # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + # + # Purge time will be truncated to the nearest microsecond. Purge + # time will be unset if the queue has never been purged. + # @!attribute [rw] stackdriver_logging_config + # @return [::Google::Cloud::Tasks::V2::StackdriverLoggingConfig] + # Configuration options for writing logs to + # [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + # field is unset, then no logs are written. + class Queue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the queue. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The queue is running. Tasks can be dispatched. + # + # If the queue was created using Cloud Tasks and the queue has + # had no activity (method calls or task dispatches) for 30 days, + # the queue may take a few minutes to re-activate. Some method + # calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and + # tasks may not be dispatched for a few minutes until the queue + # has been re-activated. + RUNNING = 1 + + # Tasks are paused by the user. If the queue is paused then Cloud + # Tasks will stop delivering tasks from it, but more tasks can + # still be added to it by the user. + PAUSED = 2 + + # The queue is disabled. + # + # A queue becomes `DISABLED` when + # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) + # or + # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) + # is uploaded which does not contain the queue. You cannot directly disable + # a queue. + # + # When a queue is disabled, tasks can still be added to a queue + # but the tasks are not dispatched. + # + # To permanently delete this queue and all of its tasks, call + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue DeleteQueue}. + DISABLED = 3 + end + end + + # Rate limits. + # + # This message determines the maximum rate that tasks can be dispatched by a + # queue, regardless of whether the dispatch is a first task attempt or a retry. + # + # Note: The debugging command, + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask}, will run a task even if + # the queue has reached its {::Google::Cloud::Tasks::V2::RateLimits RateLimits}. + # @!attribute [rw] max_dispatches_per_second + # @return [::Float] + # The maximum rate at which tasks are dispatched from this queue. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # * The maximum allowed value is 500. + # + # + # This field has the same meaning as + # [rate in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + # @!attribute [rw] max_burst_size + # @return [::Integer] + # Output only. The max burst size. + # + # Max burst size limits how fast tasks in queue are processed when + # many tasks are in the queue and the rate is high. This field + # allows the queue to have a high rate so processing starts shortly + # after a task is enqueued, but still limits resource usage when + # many tasks are enqueued in a short period of time. + # + # The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + # algorithm is used to control the rate of task dispatches. Each + # queue has a token bucket that holds tokens, up to the maximum + # specified by `max_burst_size`. Each time a task is dispatched, a + # token is removed from the bucket. Tasks will be dispatched until + # the queue's bucket runs out of tokens. The bucket will be + # continuously refilled with new tokens based on + # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}. + # + # Cloud Tasks will pick the value of `max_burst_size` based on the + # value of + # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}. + # + # For queues that were created or updated using + # `queue.yaml/xml`, `max_burst_size` is equal to + # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + # Since `max_burst_size` is output only, if + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue UpdateQueue} is called on a + # queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on + # the value of + # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}, + # regardless of whether + # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second} + # is updated. + # @!attribute [rw] max_concurrent_dispatches + # @return [::Integer] + # The maximum number of concurrent tasks that Cloud Tasks allows + # to be dispatched for this queue. After this threshold has been + # reached, Cloud Tasks stops dispatching tasks until the number of + # concurrent requests decreases. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # The maximum allowed value is 5,000. + # + # + # This field has the same meaning as + # [max_concurrent_requests in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + class RateLimits + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retry config. + # + # These settings determine when a failed task attempt is retried. + # @!attribute [rw] max_attempts + # @return [::Integer] + # Number of attempts per task. + # + # Cloud Tasks will attempt the task `max_attempts` times (that is, if the + # first attempt fails, then there will be `max_attempts - 1` retries). Must + # be >= -1. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # -1 indicates unlimited attempts. + # + # This field has the same meaning as + # [task_retry_limit in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_retry_duration + # @return [::Google::Protobuf::Duration] + # If positive, `max_retry_duration` specifies the time limit for + # retrying a failed task, measured from when the task was first + # attempted. Once `max_retry_duration` time has passed *and* the + # task has been attempted + # {::Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts} times, no + # further attempts will be made and the task will be deleted. + # + # If zero, then the task age is unlimited. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # `max_retry_duration` will be truncated to the nearest second. + # + # This field has the same meaning as + # [task_age_limit in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] min_backoff + # @return [::Google::Protobuf::Duration] + # A task will be {::Google::Cloud::Tasks::V2::Task#schedule_time scheduled} for + # retry between {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} + # and {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} duration + # after it fails, if the queue's + # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig} specifies that the task + # should be retried. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # `min_backoff` will be truncated to the nearest second. + # + # This field has the same meaning as + # [min_backoff_seconds in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_backoff + # @return [::Google::Protobuf::Duration] + # A task will be {::Google::Cloud::Tasks::V2::Task#schedule_time scheduled} for + # retry between {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} + # and {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} duration + # after it fails, if the queue's + # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig} specifies that the task + # should be retried. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # `max_backoff` will be truncated to the nearest second. + # + # This field has the same meaning as + # [max_backoff_seconds in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_doublings + # @return [::Integer] + # The time between retries will double `max_doublings` times. + # + # A task's retry interval starts at + # {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff}, then doubles + # `max_doublings` times, then increases linearly, and finally + # retries at intervals of + # {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} up to + # {::Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts} times. + # + # For example, if + # {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} is 10s, + # {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} is 300s, and + # `max_doublings` is 3, then the a task will first be retried in + # 10s. The retry interval will double three times, and then + # increase linearly by 2^3 * 10s. Finally, the task will retry at + # intervals of {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} + # until the task has been attempted + # {::Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts} times. Thus, + # the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # This field has the same meaning as + # [max_doublings in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + class RetryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration options for writing logs to + # [Stackdriver Logging](https://cloud.google.com/logging/docs/). + # @!attribute [rw] sampling_ratio + # @return [::Float] + # Specifies the fraction of operations to write to + # [Stackdriver Logging](https://cloud.google.com/logging/docs/). + # This field may contain any value between 0.0 and 1.0, inclusive. + # 0.0 is the default and means that no operations are logged. + class StackdriverLoggingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb new file mode 100644 index 000000000000..fdee342780f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb @@ -0,0 +1,466 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2 + # HTTP request. + # + # The task will be pushed to the worker as an HTTP request. If the worker + # or the redirected worker acknowledges the task by returning a successful HTTP + # response code ([`200` - `299`]), the task will be removed from the queue. If + # any other HTTP response code is returned or no response is received, the + # task will be retried according to the following: + # + # * User-specified throttling: [retry + # configuration][google.cloud.tasks.v2.Queue.retry_config], + # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate limits}, and the [queue's + # state][google.cloud.tasks.v2.Queue.state]. + # + # * System throttling: To prevent the worker from overloading, Cloud Tasks may + # temporarily reduce the queue's effective rate. User-specified settings + # will not be changed. + # + # System throttling happens because: + # + # * Cloud Tasks backs off on all errors. Normally the backoff specified in + # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate limits} will be used. But + # if the worker returns `429` (Too Many Requests), `503` (Service + # Unavailable), or the rate of errors is high, Cloud Tasks will use a + # higher backoff rate. The retry specified in the `Retry-After` HTTP + # response header is considered. + # + # * To prevent traffic spikes and to smooth sudden increases in traffic, + # dispatches ramp up slowly when the queue is newly created or idle and + # if large numbers of tasks suddenly become available to dispatch (due to + # spikes in create task rates, the queue being unpaused, or many tasks + # that are scheduled at the same time). + # @!attribute [rw] url + # @return [::String] + # Required. The full url path that the request will be sent to. + # + # This string must begin with either "http://" or "https://". Some examples + # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + # encode some characters for safety and compatibility. The maximum allowed + # URL length is 2083 characters after encoding. + # + # The `Location` header response from a redirect response [`300` - `399`] + # may be followed. The redirect is not counted as a separate attempt. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2::HttpMethod] + # The HTTP method to use for the request. The default is POST. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. + # Headers can be set when the + # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + # + # These headers represent a subset of the headers that will accompany the + # task's HTTP request. Some HTTP request headers will be ignored or replaced. + # + # A partial list of headers that will be ignored or replaced is: + # + # * Host: This will be computed by Cloud Tasks and derived from + # {::Google::Cloud::Tasks::V2::HttpRequest#url HttpRequest.url}. + # * Content-Length: This will be computed by Cloud Tasks. + # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + # * `X-Google-*`: Google use only. + # * `X-AppEngine-*`: Google use only. + # + # `Content-Type` won't be set by Cloud Tasks. You can explicitly set + # `Content-Type` to a media type when the + # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + # For example, `Content-Type` can be set to `"application/octet-stream"` or + # `"application/json"`. + # + # Headers which can have multiple values (according to RFC2616) can be + # specified using comma-separated values. + # + # The size of the headers must be less than 80KB. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. + # + # A request body is allowed only if the + # {::Google::Cloud::Tasks::V2::HttpRequest#http_method HTTP method} is POST, PUT, + # or PATCH. It is an error to set body on a task with an incompatible + # {::Google::Cloud::Tasks::V2::HttpMethod HttpMethod}. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Tasks::V2::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as an `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # + # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Tasks::V2::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # + # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HttpRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine HTTP request. + # + # The message defines the HTTP request that is sent to an App Engine app when + # the task is dispatched. + # + # Using {::Google::Cloud::Tasks::V2::AppEngineHttpRequest AppEngineHttpRequest} + # requires + # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) + # Google IAM permission for the project + # and the following scope: + # + # `https://www.googleapis.com/auth/cloud-platform` + # + # The task will be delivered to the App Engine app which belongs to the same + # project as the queue. For more information, see + # [How Requests are + # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and how routing is affected by + # [dispatch + # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). + # Traffic is encrypted during transport and never leaves Google datacenters. + # Because this traffic is carried over a communication mechanism internal to + # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). + # The request to the handler, however, will appear to have used the HTTP + # protocol. + # + # The {::Google::Cloud::Tasks::V2::AppEngineRouting AppEngineRouting} used to + # construct the URL that the task is delivered to can be set at the queue-level + # or task-level: + # + # * If [app_engine_routing_override is set on the + # queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this value + # is used for all tasks in the queue, no matter what the setting is for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + # + # + # The `url` that the task will be sent to is: + # + # * `url =` {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} `+` + # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest#relative_uri relative_uri} + # + # Tasks can be dispatched to secure app handlers, unsecure app handlers, and + # URIs restricted with + # [`login: + # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). + # Because tasks are not run as any user, they cannot be dispatched to URIs + # restricted with + # [`login: + # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) + # Task dispatches also do not follow redirects. + # + # The task attempt has succeeded if the app's request handler returns an HTTP + # response code in the range [`200` - `299`]. The task attempt has failed if + # the app's handler returns a non-2xx response code or Cloud Tasks does + # not receive response before the + # {::Google::Cloud::Tasks::V2::Task#dispatch_deadline deadline}. Failed tasks will + # be retried according to the [retry + # configuration][google.cloud.tasks.v2.Queue.retry_config]. `503` (Service + # Unavailable) is considered an App Engine system error instead of an + # application error and will cause Cloud Tasks' traffic congestion control to + # temporarily throttle the queue's dispatches. Unlike other types of task + # targets, a `429` (Too Many Requests) response from an app handler does not + # cause traffic congestion control to throttle the queue. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2::HttpMethod] + # The HTTP method to use for the request. The default is POST. + # + # The app's request handler for the task's target URL must be able to handle + # HTTP requests with this http_method, otherwise the task attempt fails with + # error code 405 (Method Not Allowed). See [Writing a push task request + # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + # and the App Engine documentation for your runtime on [How Requests are + # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + # @!attribute [rw] app_engine_routing + # @return [::Google::Cloud::Tasks::V2::AppEngineRouting] + # Task-level setting for App Engine routing. + # + # * If [app_engine_routing_override is set on the + # queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this + # value is used for all tasks in the queue, no matter what the setting is + # for the [task-level + # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. + # @!attribute [rw] relative_uri + # @return [::String] + # The relative URI. + # + # The relative URI must begin with "/" and must be a valid HTTP relative URI. + # It can contain a path and query string arguments. + # If the relative URI is empty, then the root path "/" will be used. + # No spaces are allowed, and the maximum length allowed is 2083 characters. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. + # Headers can be set when the + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task task is created}. + # Repeated headers are not supported but a header value can contain commas. + # + # Cloud Tasks sets some headers to default values: + # + # * `User-Agent`: By default, this header is + # `"AppEngine-Google; (+http://code.google.com/appengine)"`. + # This header can be modified, but Cloud Tasks will append + # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + # modified `User-Agent`. + # + # If the task has a {::Google::Cloud::Tasks::V2::AppEngineHttpRequest#body body}, + # Cloud Tasks sets the following headers: + # + # * `Content-Type`: By default, the `Content-Type` header is set to + # `"application/octet-stream"`. The default can be overridden by explicitly + # setting `Content-Type` to a particular media type when the + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task task is created}. + # For example, `Content-Type` can be set to `"application/json"`. + # * `Content-Length`: This is computed by Cloud Tasks. This value is + # output only. It cannot be changed. + # + # The headers below cannot be set or overridden: + # + # * `Host` + # * `X-Google-*` + # * `X-AppEngine-*` + # + # In addition, Cloud Tasks sets some headers when the task is dispatched, + # such as headers containing information about the task; see + # [request + # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + # These headers are set only when the task is dispatched, so they are not + # visible when the task is returned in a Cloud Tasks response. + # + # Although there is no specific limit for the maximum number of headers or + # the size, there is a limit on the maximum size of the + # {::Google::Cloud::Tasks::V2::Task Task}. For more information, see the + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask} documentation. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. + # + # A request body is allowed only if the HTTP method is POST or PUT. It is + # an error to set a body on a task with an incompatible + # {::Google::Cloud::Tasks::V2::HttpMethod HttpMethod}. + class AppEngineHttpRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine Routing. + # + # Defines routing characteristics specific to App Engine - service, version, + # and instance. + # + # For more information about services, versions, and instances see + # [An Overview of App + # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), + # [Microservices Architecture on Google App + # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # + # Using {::Google::Cloud::Tasks::V2::AppEngineRouting AppEngineRouting} requires + # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) + # Google IAM permission for the project + # and the following scope: + # + # `https://www.googleapis.com/auth/cloud-platform` + # @!attribute [rw] service + # @return [::String] + # App service. + # + # By default, the task is sent to the service which is the default + # service when the task is attempted. + # + # For some queues or tasks which were created using the App Engine + # Task Queue API, {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not + # parsable into {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. For example, + # some tasks which were created using the App Engine SDK use a custom domain + # name; custom domains are not parsed by Cloud Tasks. If + # {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable, then + # {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance} are the empty + # string. + # @!attribute [rw] version + # @return [::String] + # App version. + # + # By default, the task is sent to the version which is the default + # version when the task is attempted. + # + # For some queues or tasks which were created using the App Engine + # Task Queue API, {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not + # parsable into {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. For example, + # some tasks which were created using the App Engine SDK use a custom domain + # name; custom domains are not parsed by Cloud Tasks. If + # {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable, then + # {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance} are the empty + # string. + # @!attribute [rw] instance + # @return [::String] + # App instance. + # + # By default, the task is sent to an instance which is available when + # the task is attempted. + # + # Requests can only be sent to a specific instance if + # [manual scaling is used in App Engine + # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + # App Engine Flex does not support instances. For more information, see + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] host + # @return [::String] + # Output only. The host that the task is sent to. + # + # The host is constructed from the domain name of the app associated with + # the queue's project ID (for example .appspot.com), and the + # {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. Tasks which + # were created using the App Engine SDK might have a custom domain name. + # + # For more information, see + # [How Requests are + # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + class AppEngineRouting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). + # This type of authorization should generally only be used when calling Google + # APIs hosted on *.googleapis.com. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OAuth token. + # The service account must be within the same project as the queue. The + # caller must have iam.serviceAccounts.actAs permission for the service + # account. + # @!attribute [rw] scope + # @return [::String] + # OAuth scope to be used for generating OAuth access token. + # If not specified, "https://www.googleapis.com/auth/cloud-platform" + # will be used. + class OAuthToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OpenID Connect + # token](https://developers.google.com/identity/protocols/OpenIDConnect). + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OIDC token. + # The service account must be within the same project as the queue. The + # caller must have iam.serviceAccounts.actAs permission for the service + # account. + # @!attribute [rw] audience + # @return [::String] + # Audience to be used when generating OIDC token. If not specified, the URI + # specified in target will be used. + class OidcToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The HTTP method used to deliver the task. + module HttpMethod + # HTTP method unspecified + HTTP_METHOD_UNSPECIFIED = 0 + + # HTTP POST + POST = 1 + + # HTTP GET + GET = 2 + + # HTTP HEAD + HEAD = 3 + + # HTTP PUT + PUT = 4 + + # HTTP DELETE + DELETE = 5 + + # HTTP PATCH + PATCH = 6 + + # HTTP OPTIONS + OPTIONS = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb new file mode 100644 index 000000000000..9a48ee97aae1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb @@ -0,0 +1,196 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2 + # A unit of scheduled work. + # @!attribute [rw] name + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask}. + # + # The task name. + # + # The task name must have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the task's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + # hyphens (-). The maximum length is 100 characters. + # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), or underscores (_). The maximum length is 500 characters. + # @!attribute [rw] app_engine_http_request + # @return [::Google::Cloud::Tasks::V2::AppEngineHttpRequest] + # HTTP request that is sent to the App Engine app handler. + # + # An App Engine task is a task that has + # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest AppEngineHttpRequest} set. + # + # Note: The following fields are mutually exclusive: `app_engine_http_request`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] http_request + # @return [::Google::Cloud::Tasks::V2::HttpRequest] + # HTTP request that is sent to the worker. + # + # An HTTP task is a task that has + # {::Google::Cloud::Tasks::V2::HttpRequest HttpRequest} set. + # + # Note: The following fields are mutually exclusive: `http_request`, `app_engine_http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # The time when the task is scheduled to be attempted or retried. + # + # `schedule_time` will be truncated to the nearest microsecond. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the task was created. + # + # `create_time` will be truncated to the nearest second. + # @!attribute [rw] dispatch_deadline + # @return [::Google::Protobuf::Duration] + # The deadline for requests sent to the worker. If the worker does not + # respond by this deadline then the request is cancelled and the attempt + # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + # task according to the {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig}. + # + # Note that when the request is cancelled, Cloud Tasks will stop listening + # for the response, but whether the worker stops processing depends on the + # worker. For example, if the worker is stuck, it may not react to cancelled + # requests. + # + # The default and maximum values depend on the type of request: + # + # * For {::Google::Cloud::Tasks::V2::HttpRequest HTTP tasks}, the default is 10 + # minutes. The deadline + # must be in the interval [15 seconds, 30 minutes]. + # + # * For {::Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks}, 0 + # indicates that the + # request has the default deadline. The default deadline depends on the + # [scaling + # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + # of the service: 10 minutes for standard apps with automatic scaling, 24 + # hours for standard apps with manual and basic scaling, and 60 minutes for + # flex apps. If the request deadline is set, it must be in the interval [15 + # seconds, 24 hours 15 seconds]. Regardless of the task's + # `dispatch_deadline`, the app handler will not run for longer than than + # the service's timeout. We recommend setting the `dispatch_deadline` to + # at most a few seconds more than the app handler's timeout. For more + # information see + # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + # + # `dispatch_deadline` will be truncated to the nearest millisecond. The + # deadline is an approximate deadline. + # @!attribute [rw] dispatch_count + # @return [::Integer] + # Output only. The number of attempts dispatched. + # + # This count includes attempts which have been dispatched but haven't + # received a response. + # @!attribute [rw] response_count + # @return [::Integer] + # Output only. The number of attempts which have received a response. + # @!attribute [rw] first_attempt + # @return [::Google::Cloud::Tasks::V2::Attempt] + # Output only. The status of the task's first attempt. + # + # Only {::Google::Cloud::Tasks::V2::Attempt#dispatch_time dispatch_time} will be + # set. The other {::Google::Cloud::Tasks::V2::Attempt Attempt} information is not + # retained by Cloud Tasks. + # @!attribute [rw] last_attempt + # @return [::Google::Cloud::Tasks::V2::Attempt] + # Output only. The status of the task's last attempt. + # @!attribute [rw] view + # @return [::Google::Cloud::Tasks::V2::Task::View] + # Output only. The view specifies which subset of the + # {::Google::Cloud::Tasks::V2::Task Task} has been returned. + class Task + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The view specifies a subset of {::Google::Cloud::Tasks::V2::Task Task} data. + # + # When a task is returned in a response, not all + # information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + module View + # Unspecified. Defaults to BASIC. + VIEW_UNSPECIFIED = 0 + + # The basic view omits fields which can be large or can contain + # sensitive data. + # + # This view does not include the + # [body in + # AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body]. + # Bodies are desirable to return only when needed, because they + # can be large and because of the sensitivity of the data that you + # choose to store in it. + BASIC = 1 + + # All information is returned. + # + # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires + # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + # permission on the {::Google::Cloud::Tasks::V2::Queue Queue} resource. + FULL = 2 + end + end + + # The status of a task attempt. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt was scheduled. + # + # `schedule_time` will be truncated to the nearest microsecond. + # @!attribute [rw] dispatch_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt was dispatched. + # + # `dispatch_time` will be truncated to the nearest microsecond. + # @!attribute [rw] response_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt response was received. + # + # `response_time` will be truncated to the nearest microsecond. + # @!attribute [rw] response_status + # @return [::Google::Rpc::Status] + # Output only. The response from the worker for this attempt. + # + # If `response_time` is unset, then the task has not been attempted or is + # currently running and the `response_status` field is meaningless. + class Attempt + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile new file mode 100644 index 000000000000..8480a57dc7a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2", path: "../" +else + gem "google-cloud-tasks-v2" +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-tasks-v2/snippets/cloud_tasks/create_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb new file mode 100644 index 000000000000..89081d8d2d84 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the create_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#create_queue. +# +def create_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::CreateQueueRequest.new + + # Call the create_queue method. + result = client.create_queue request + + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb new file mode 100644 index 000000000000..a12a2894529a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_CreateTask_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the create_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#create_task. +# +def create_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::CreateTaskRequest.new + + # Call the create_task method. + result = client.create_task request + + # The returned object is of type Google::Cloud::Tasks::V2::Task. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb new file mode 100644 index 000000000000..8b80b0958c9b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the delete_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#delete_queue. +# +def delete_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new + + # Call the delete_queue method. + result = client.delete_queue request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb new file mode 100644 index 000000000000..c1e9f301f9ab --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the delete_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#delete_task. +# +def delete_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new + + # Call the delete_task method. + result = client.delete_task request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb new file mode 100644 index 000000000000..8fdd3c8d2cef --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the get_iam_policy call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb new file mode 100644 index 000000000000..c62917b1cb5e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_GetQueue_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the get_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#get_queue. +# +def get_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::GetQueueRequest.new + + # Call the get_queue method. + result = client.get_queue request + + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb new file mode 100644 index 000000000000..64d71ad03392 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_GetTask_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the get_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#get_task. +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::GetTaskRequest.new + + # Call the get_task method. + result = client.get_task request + + # The returned object is of type Google::Cloud::Tasks::V2::Task. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb new file mode 100644 index 000000000000..833568cefc39 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_ListQueues_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the list_queues call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#list_queues. +# +def list_queues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::ListQueuesRequest.new + + # Call the list_queues method. + result = client.list_queues 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::Tasks::V2::Queue. + p item + end +end +# [END cloudtasks_v2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb new file mode 100644 index 000000000000..be8504a93b6b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_ListTasks_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the list_tasks call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#list_tasks. +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::ListTasksRequest.new + + # Call the list_tasks method. + result = client.list_tasks 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::Tasks::V2::Task. + p item + end +end +# [END cloudtasks_v2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb new file mode 100644 index 000000000000..1f82a9e28be0 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the pause_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#pause_queue. +# +def pause_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::PauseQueueRequest.new + + # Call the pause_queue method. + result = client.pause_queue request + + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb new file mode 100644 index 000000000000..cb87bbc3f976 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the purge_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#purge_queue. +# +def purge_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new + + # Call the purge_queue method. + result = client.purge_queue request + + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb new file mode 100644 index 000000000000..7f8d6bd94477 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the resume_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#resume_queue. +# +def resume_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new + + # Call the resume_queue method. + result = client.resume_queue request + + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb new file mode 100644 index 000000000000..08df0ddafb7e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_RunTask_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the run_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#run_task. +# +def run_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::RunTaskRequest.new + + # Call the run_task method. + result = client.run_task request + + # The returned object is of type Google::Cloud::Tasks::V2::Task. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb new file mode 100644 index 000000000000..10fdebb1dcdc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the set_iam_policy call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb new file mode 100644 index 000000000000..abd84456c6c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the test_iam_permissions call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb new file mode 100644 index 000000000000..05400cd443bf --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] +require "google/cloud/tasks/v2" + +## +# Snippet for the update_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#update_queue. +# +def update_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new + + # Call the update_queue method. + result = client.update_queue request + + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end +# [END cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json b/owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json new file mode 100644 index 000000000000..30392ec1961e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json @@ -0,0 +1,655 @@ +{ + "client_library": { + "name": "google-cloud-tasks-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.tasks.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_ListQueues_sync", + "title": "Snippet for the list_queues call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues.", + "file": "cloud_tasks/list_queues.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_queues", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::ListQueuesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::ListQueuesResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "ListQueues", + "full_name": "google.cloud.tasks.v2.CloudTasks.ListQueues", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_GetQueue_sync", + "title": "Snippet for the get_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue.", + "file": "cloud_tasks/get_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_queue", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::GetQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "GetQueue", + "full_name": "google.cloud.tasks.v2.CloudTasks.GetQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_CreateQueue_sync", + "title": "Snippet for the create_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue.", + "file": "cloud_tasks/create_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_queue", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::CreateQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "CreateQueue", + "full_name": "google.cloud.tasks.v2.CloudTasks.CreateQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync", + "title": "Snippet for the update_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue.", + "file": "cloud_tasks/update_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_queue", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::UpdateQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "UpdateQueue", + "full_name": "google.cloud.tasks.v2.CloudTasks.UpdateQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync", + "title": "Snippet for the delete_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue.", + "file": "cloud_tasks/delete_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_queue", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::DeleteQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "DeleteQueue", + "full_name": "google.cloud.tasks.v2.CloudTasks.DeleteQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync", + "title": "Snippet for the purge_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue.", + "file": "cloud_tasks/purge_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_queue", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::PurgeQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "PurgeQueue", + "full_name": "google.cloud.tasks.v2.CloudTasks.PurgeQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_PauseQueue_sync", + "title": "Snippet for the pause_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue.", + "file": "cloud_tasks/pause_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_queue", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::PauseQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "PauseQueue", + "full_name": "google.cloud.tasks.v2.CloudTasks.PauseQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync", + "title": "Snippet for the resume_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue.", + "file": "cloud_tasks/resume_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_queue", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::ResumeQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "ResumeQueue", + "full_name": "google.cloud.tasks.v2.CloudTasks.ResumeQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#get_iam_policy.", + "file": "cloud_tasks/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.tasks.v2.CloudTasks.GetIamPolicy", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#set_iam_policy.", + "file": "cloud_tasks/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.tasks.v2.CloudTasks.SetIamPolicy", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#test_iam_permissions.", + "file": "cloud_tasks/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.tasks.v2.CloudTasks.TestIamPermissions", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_ListTasks_sync", + "title": "Snippet for the list_tasks call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks.", + "file": "cloud_tasks/list_tasks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tasks", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::ListTasksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::ListTasksResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "ListTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks.ListTasks", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_GetTask_sync", + "title": "Snippet for the get_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#get_task.", + "file": "cloud_tasks/get_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_task", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#get_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::GetTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "GetTask", + "full_name": "google.cloud.tasks.v2.CloudTasks.GetTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_CreateTask_sync", + "title": "Snippet for the create_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#create_task.", + "file": "cloud_tasks/create_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_task", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::CreateTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "CreateTask", + "full_name": "google.cloud.tasks.v2.CloudTasks.CreateTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_DeleteTask_sync", + "title": "Snippet for the delete_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task.", + "file": "cloud_tasks/delete_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_task", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::DeleteTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "DeleteTask", + "full_name": "google.cloud.tasks.v2.CloudTasks.DeleteTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2_generated_CloudTasks_RunTask_sync", + "title": "Snippet for the run_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#run_task.", + "file": "cloud_tasks/run_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_task", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2::RunTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" + }, + "method": { + "short_name": "RunTask", + "full_name": "google.cloud.tasks.v2.CloudTasks.RunTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2.CloudTasks" + } + } + }, + "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-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb new file mode 100644 index 000000000000..345d9adc75f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloud_tasks" + +class ::Google::Cloud::Tasks::V2::CloudTasks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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::Tasks::V2::CloudTasks::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_queue_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.queue_path project: "value0", location: "value1", queue: "value2" + assert_equal "projects/value0/locations/value1/queues/value2", path + end + end + + def test_task_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.task_path project: "value0", location: "value1", queue: "value2", task: "value3" + assert_equal "projects/value0/locations/value1/queues/value2/tasks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb new file mode 100644 index 000000000000..5f59bf5f6de1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb @@ -0,0 +1,979 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" +require "google/cloud/tasks/v2/cloud_tasks/rest" + + +class ::Google::Cloud::Tasks::V2::CloudTasks::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_queues + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::ListQueuesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_queues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_list_queues_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_queues_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_queues({ parent: parent, 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_queues parent: parent, 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_queues ::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues({ parent: parent, 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_queues(::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues_client_stub.call_count + end + end + end + + def test_get_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_get_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_queue ::Google::Cloud::Tasks::V2::GetQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_queue(::Google::Cloud::Tasks::V2::GetQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_queue_client_stub.call_count + end + end + end + + def test_create_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + queue = {} + + create_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_create_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_queue({ parent: parent, queue: queue }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_queue parent: parent, queue: queue do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_queue ::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_queue({ parent: parent, queue: queue }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_queue(::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_queue_client_stub.call_count + end + end + end + + def test_update_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + queue = {} + update_mask = {} + + update_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_update_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_queue({ queue: queue, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_queue queue: queue, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_queue ::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_queue({ queue: queue, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_queue(::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_queue_client_stub.call_count + end + end + end + + def test_delete_queue + # 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_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_queue ::Google::Cloud::Tasks::V2::DeleteQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_queue(::Google::Cloud::Tasks::V2::DeleteQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_queue_client_stub.call_count + end + end + end + + def test_purge_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + purge_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_purge_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_queue ::Google::Cloud::Tasks::V2::PurgeQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_queue(::Google::Cloud::Tasks::V2::PurgeQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_queue_client_stub.call_count + end + end + end + + def test_pause_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_pause_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_queue ::Google::Cloud::Tasks::V2::PauseQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_queue(::Google::Cloud::Tasks::V2::PauseQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_queue_client_stub.call_count + end + end + end + + def test_resume_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_resume_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_queue ::Google::Cloud::Tasks::V2::ResumeQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_queue(::Google::Cloud::Tasks::V2::ResumeQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_queue_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_list_tasks + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::ListTasksResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + response_view = :VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tasks({ parent: parent, response_view: response_view, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tasks parent: parent, response_view: response_view, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tasks ::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_count + end + end + end + + def test_get_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + response_view = :VIEW_UNSPECIFIED + + get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_task({ name: name, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_task name: name, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_task ::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_task({ name: name, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_count + end + end + end + + def test_create_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + task = {} + response_view = :VIEW_UNSPECIFIED + + create_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_create_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_task({ parent: parent, task: task, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_task parent: parent, task: task, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_task ::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_task({ parent: parent, task: task, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_task(::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_task_client_stub.call_count + end + end + end + + def test_delete_task + # 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_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_task({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_task name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_task ::Google::Cloud::Tasks::V2::DeleteTaskRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_task({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_task(::Google::Cloud::Tasks::V2::DeleteTaskRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_task_client_stub.call_count + end + end + end + + def test_run_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + response_view = :VIEW_UNSPECIFIED + + run_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_run_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_task({ name: name, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_task name: name, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_task ::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_task({ name: name, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_task(::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_task_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::Tasks::V2::CloudTasks::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::Tasks::V2::CloudTasks::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb new file mode 100644 index 000000000000..7f5678b2ed04 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb @@ -0,0 +1,1074 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" +require "google/cloud/tasks/v2/cloud_tasks" + +class ::Google::Cloud::Tasks::V2::CloudTasks::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_queues + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::ListQueuesResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_queues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_queues, name + assert_kind_of ::Google::Cloud::Tasks::V2::ListQueuesRequest, request + assert_equal "hello world", request["parent"] + 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_queues_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_queues({ parent: parent, 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_queues parent: parent, 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_queues ::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues({ parent: parent, 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_queues(::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues_client_stub.call_rpc_count + end + end + + def test_get_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Queue.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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2::GetQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_queue ::Google::Cloud::Tasks::V2::GetQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_queue({ 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_queue(::Google::Cloud::Tasks::V2::GetQueueRequest.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_queue_client_stub.call_rpc_count + end + end + + def test_create_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" + queue = {} + + create_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2::CreateQueueRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2::Queue), request["queue"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_queue({ parent: parent, queue: queue }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_queue parent: parent, queue: queue do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_queue ::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_queue({ parent: parent, queue: queue }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_queue(::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_queue_client_stub.call_rpc_count + end + end + + def test_update_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Queue.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. + queue = {} + update_mask = {} + + update_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2::UpdateQueueRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2::Queue), request["queue"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_queue({ queue: queue, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_queue queue: queue, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_queue ::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, 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_queue({ queue: queue, 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_queue(::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, 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_queue_client_stub.call_rpc_count + end + end + + def test_delete_queue + # 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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2::DeleteQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_queue ::Google::Cloud::Tasks::V2::DeleteQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_queue({ 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_queue(::Google::Cloud::Tasks::V2::DeleteQueueRequest.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_queue_client_stub.call_rpc_count + end + end + + def test_purge_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" + + purge_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2::PurgeQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_queue ::Google::Cloud::Tasks::V2::PurgeQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_queue(::Google::Cloud::Tasks::V2::PurgeQueueRequest.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, purge_queue_client_stub.call_rpc_count + end + end + + def test_pause_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" + + pause_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2::PauseQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_queue ::Google::Cloud::Tasks::V2::PauseQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pause_queue(::Google::Cloud::Tasks::V2::PauseQueueRequest.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, pause_queue_client_stub.call_rpc_count + end + end + + def test_resume_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" + + resume_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2::ResumeQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_queue ::Google::Cloud::Tasks::V2::ResumeQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resume_queue(::Google::Cloud::Tasks::V2::ResumeQueueRequest.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, resume_queue_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_list_tasks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::ListTasksResponse.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" + response_view = :VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tasks, name + assert_kind_of ::Google::Cloud::Tasks::V2::ListTasksRequest, request + assert_equal "hello world", request["parent"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tasks({ parent: parent, response_view: response_view, 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_tasks parent: parent, response_view: response_view, 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_tasks ::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_rpc_count + end + end + + def test_get_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Task.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" + response_view = :VIEW_UNSPECIFIED + + get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_task, name + assert_kind_of ::Google::Cloud::Tasks::V2::GetTaskRequest, request + assert_equal "hello world", request["name"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_task({ name: name, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_task name: name, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_task ::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_rpc_count + end + end + + def test_create_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Task.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" + task = {} + response_view = :VIEW_UNSPECIFIED + + create_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_task, name + assert_kind_of ::Google::Cloud::Tasks::V2::CreateTaskRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2::Task), request["task"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_task({ parent: parent, task: task, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_task parent: parent, task: task, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_task ::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_task({ parent: parent, task: task, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_task(::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_task_client_stub.call_rpc_count + end + end + + def test_delete_task + # 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_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_task, name + assert_kind_of ::Google::Cloud::Tasks::V2::DeleteTaskRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_task({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_task name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_task ::Google::Cloud::Tasks::V2::DeleteTaskRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_task({ 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_task(::Google::Cloud::Tasks::V2::DeleteTaskRequest.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_task_client_stub.call_rpc_count + end + end + + def test_run_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2::Task.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" + response_view = :VIEW_UNSPECIFIED + + run_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_task, name + assert_kind_of ::Google::Cloud::Tasks::V2::RunTaskRequest, request + assert_equal "hello world", request["name"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_task({ name: name, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_task name: name, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_task ::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_task(::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_task_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::Tasks::V2::CloudTasks::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::Tasks::V2::CloudTasks::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Tasks::V2::CloudTasks::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb b/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/.gitignore b/owl-bot-staging/google-cloud-tasks-v2beta2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/.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-tasks-v2beta2/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta2/.repo-metadata.json new file mode 100644 index 000000000000..7f0b625d0a63 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudtasks.googleapis.com", + "api_shortname": "cloudtasks", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta2/latest", + "distribution_name": "google-cloud-tasks-v2beta2", + "is_cloud": true, + "language": "ruby", + "name": "cloudtasks", + "name_pretty": "Cloud Tasks V2beta2 API", + "product_documentation": "https://cloud.google.com/tasks", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TASKS", + "ruby-cloud-product-url": "https://cloud.google.com/tasks", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml b/owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml new file mode 100644 index 000000000000..21bca46e5821 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-tasks-v2beta2.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-tasks-v2beta2.rb" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/.yardopts b/owl-bot-staging/google-cloud-tasks-v2beta2/.yardopts new file mode 100644 index 000000000000..2480630b8f94 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Tasks V2beta2 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-tasks-v2beta2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks-v2beta2/AUTHENTICATION.md new file mode 100644 index 000000000000..458865effa49 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-tasks-v2beta2 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-tasks-v2beta2 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/tasks/v2beta2" + +client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/tasks/v2beta2" + +::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::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-tasks-v2beta2 +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/tasks/v2beta2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::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-tasks-v2beta2/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks-v2beta2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-tasks-v2beta2/LICENSE.md b/owl-bot-staging/google-cloud-tasks-v2beta2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/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-tasks-v2beta2/README.md b/owl-bot-staging/google-cloud-tasks-v2beta2/README.md new file mode 100644 index 000000000000..7161ac774944 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Tasks V2beta2 API + +Manages the execution of large numbers of distributed requests. + +Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. + +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 Tasks V2beta2 API. Most users should consider using +the main client gem, +[google-cloud-tasks](https://rubygems.org/gems/google-cloud-tasks). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-tasks-v2beta2 +``` + +## 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/cloudtasks.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/tasks/v2beta2" + +client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +request = ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new # (request fields as keyword arguments...) +response = client.list_queues request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/tasks) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/tasks/v2beta2" +require "logger" + +client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-tasks`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-tasks-v2beta2`. +_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-tasks`. +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-tasks-v2beta2`. + +### 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-tasks-v2beta2/Rakefile b/owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile new file mode 100644 index 000000000000..29d824a23b8e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TASKS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TASKS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/tasks/v2beta2/cloud_tasks/credentials" + ::Google::Cloud::Tasks::V2beta2::CloudTasks::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TASKS_PROJECT"] = project + ENV["TASKS_TEST_PROJECT"] = project + ENV["TASKS_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-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-tasks-v2beta2" + header "google-cloud-tasks-v2beta2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-tasks-v2beta2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2/gapic_metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json new file mode 100644 index 000000000000..61fb01febb7c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json @@ -0,0 +1,123 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.tasks.v2beta2", + "libraryPackage": "::Google::Cloud::Tasks::V2beta2", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client", + "rpcs": { + "ListQueues": { + "methods": [ + "list_queues" + ] + }, + "GetQueue": { + "methods": [ + "get_queue" + ] + }, + "CreateQueue": { + "methods": [ + "create_queue" + ] + }, + "UpdateQueue": { + "methods": [ + "update_queue" + ] + }, + "DeleteQueue": { + "methods": [ + "delete_queue" + ] + }, + "PurgeQueue": { + "methods": [ + "purge_queue" + ] + }, + "PauseQueue": { + "methods": [ + "pause_queue" + ] + }, + "ResumeQueue": { + "methods": [ + "resume_queue" + ] + }, + "UploadQueueYaml": { + "methods": [ + "upload_queue_yaml" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "ListTasks": { + "methods": [ + "list_tasks" + ] + }, + "GetTask": { + "methods": [ + "get_task" + ] + }, + "CreateTask": { + "methods": [ + "create_task" + ] + }, + "DeleteTask": { + "methods": [ + "delete_task" + ] + }, + "LeaseTasks": { + "methods": [ + "lease_tasks" + ] + }, + "AcknowledgeTask": { + "methods": [ + "acknowledge_task" + ] + }, + "RenewLease": { + "methods": [ + "renew_lease" + ] + }, + "CancelLease": { + "methods": [ + "cancel_lease" + ] + }, + "RunTask": { + "methods": [ + "run_task" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec b/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec new file mode 100644 index 000000000000..2cebbab90a64 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/tasks/v2beta2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-tasks-v2beta2" + gem.version = Google::Cloud::Tasks::V2beta2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details." + gem.summary = "Manages the execution of large numbers of distributed requests." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb new file mode 100644 index 000000000000..3679450055ab --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb new file mode 100644 index 000000000000..154f4c62635d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloud_tasks" +require "google/cloud/tasks/v2beta2/version" + +module Google + module Cloud + module Tasks + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/tasks/v2beta2" + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/tasks/v2beta2" + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + module V2beta2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2beta2", "_helpers.rb" +require "google/cloud/tasks/v2beta2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb new file mode 100644 index 000000000000..2bf75edd4e89 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" + +module Google + module Cloud + module Tasks + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/tasks/v2beta2/rest" + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + module V2beta2 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Tasks"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2beta2/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb new file mode 100644 index 000000000000..fb7fda664c77 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/version" + +require "google/cloud/tasks/v2beta2/cloud_tasks/credentials" +require "google/cloud/tasks/v2beta2/cloud_tasks/paths" +require "google/cloud/tasks/v2beta2/cloud_tasks/client" +require "google/cloud/tasks/v2beta2/cloud_tasks/rest" + +module Google + module Cloud + module Tasks + module V2beta2 + ## + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/tasks/v2beta2/cloud_tasks" + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/tasks/v2beta2/cloud_tasks/rest" + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + module CloudTasks + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_tasks", "helpers.rb" +require "google/cloud/tasks/v2beta2/cloud_tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb new file mode 100644 index 000000000000..f69060cfe2e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb @@ -0,0 +1,2936 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" +require "google/cloud/location" + +module Google + module Cloud + module Tasks + module V2beta2 + module CloudTasks + ## + # Client for the CloudTasks service. + # + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_tasks_stub + + ## + # Configure the CloudTasks Client class. + # + # See {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudTasks clients + # ::Google::Cloud::Tasks::V2beta2::CloudTasks::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", "Tasks", "V2beta2"] + 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.list_queues.timeout = 20.0 + default_config.rpcs.list_queues.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_queue.timeout = 20.0 + default_config.rpcs.get_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_queue.timeout = 20.0 + + default_config.rpcs.update_queue.timeout = 20.0 + + default_config.rpcs.delete_queue.timeout = 20.0 + default_config.rpcs.delete_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.purge_queue.timeout = 20.0 + + default_config.rpcs.pause_queue.timeout = 20.0 + + default_config.rpcs.resume_queue.timeout = 20.0 + + default_config.rpcs.upload_queue_yaml.timeout = 20.0 + + default_config.rpcs.get_iam_policy.timeout = 20.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 20.0 + + default_config.rpcs.test_iam_permissions.timeout = 20.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_tasks.timeout = 20.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_task.timeout = 20.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_task.timeout = 20.0 + + default_config.rpcs.delete_task.timeout = 20.0 + default_config.rpcs.delete_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.lease_tasks.timeout = 20.0 + + default_config.rpcs.acknowledge_task.timeout = 20.0 + + default_config.rpcs.renew_lease.timeout = 20.0 + + default_config.rpcs.cancel_lease.timeout = 20.0 + + default_config.rpcs.run_task.timeout = 20.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudTasks 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::Tasks::V2beta2::CloudTasks::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 + @cloud_tasks_stub.universe_domain + end + + ## + # Create a new CloudTasks client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudTasks 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/tasks/v2beta2/cloudtasks_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 + + @cloud_tasks_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Tasks::V2beta2::CloudTasks::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, + logger: @config.logger + ) + + @cloud_tasks_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_tasks_stub.logger + end + + # Service calls + + ## + # Lists queues. + # + # Queues are returned in lexicographical order. + # + # @overload list_queues(request, options = nil) + # Pass arguments to `list_queues` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_queues` via keyword arguments. Note that at + # least one keyword argument is 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 location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @param filter [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2beta2::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "app_engine_http_target: *". + # + # Note that using filters might cause fewer queues than the + # requested_page size to be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues} method. It + # is an error to switch the value of the + # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#filter filter} while + # iterating through pages. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new + # + # # Call the list_queues method. + # result = client.list_queues 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::Tasks::V2beta2::Queue. + # p item + # end + # + def list_queues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest + + # Converts hash 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_queues.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::Tasks::V2beta2::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_queues.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_queues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a queue. + # + # @overload get_queue(request, options = nil) + # Pass arguments to `get_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::GetQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::GetQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) + # Pass arguments to `get_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new + # + # # Call the get_queue method. + # result = client.get_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def get_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload create_queue(request, options = nil) + # Pass arguments to `create_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::CreateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) + # Pass arguments to `create_queue` via keyword arguments. Note that at + # least one keyword argument is 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 location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + # an existing queue. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new + # + # # Call the create_queue method. + # result = client.create_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def create_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload update_queue(request, options = nil) + # Pass arguments to `update_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) + # Pass arguments to `update_queue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} must be + # specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} cannot be + # changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new + # + # # Call the update_queue method. + # result = client.update_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def update_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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.queue&.name + header_params["queue.name"] = request.queue.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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload delete_queue(request, options = nil) + # Pass arguments to `delete_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `delete_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new + # + # # Call the delete_queue method. + # result = client.delete_queue request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + # + # @overload purge_queue(request, options = nil) + # Pass arguments to `purge_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_queue(name: nil) + # Pass arguments to `purge_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new + # + # # Call the purge_queue method. + # result = client.purge_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def purge_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest + + # Converts hash 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.purge_queue.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::Tasks::V2beta2::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.purge_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can + # still be added when the queue is paused. A queue is paused if its + # {::Google::Cloud::Tasks::V2beta2::Queue#state state} is + # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. + # + # @overload pause_queue(request, options = nil) + # Pass arguments to `pause_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::PauseQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_queue(name: nil) + # Pass arguments to `pause_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new + # + # # Call the pause_queue method. + # result = client.pause_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def pause_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest + + # Converts hash 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.pause_queue.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::Tasks::V2beta2::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.pause_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a queue. + # + # This method resumes a queue after it has been + # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED} or + # {::Google::Cloud::Tasks::V2beta2::Queue::State::DISABLED DISABLED}. The state of a + # queue is stored in the queue's + # {::Google::Cloud::Tasks::V2beta2::Queue#state state}; after calling this method + # it will be set to + # {::Google::Cloud::Tasks::V2beta2::Queue::State::RUNNING RUNNING}. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + # + # @overload resume_queue(request, options = nil) + # Pass arguments to `resume_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_queue(name: nil) + # Pass arguments to `resume_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new + # + # # Call the resume_queue method. + # result = client.resume_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def resume_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest + + # Converts hash 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.resume_queue.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::Tasks::V2beta2::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.resume_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update queue list by uploading a queue.yaml file. + # + # The queue.yaml file is supplied in the request body as a YAML encoded + # string. This method was added to support gcloud clients versions before + # 322.0.0. New clients should use CreateQueue instead of this method. + # + # @overload upload_queue_yaml(request, options = nil) + # Pass arguments to `upload_queue_yaml` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upload_queue_yaml(app_id: nil, http_body: nil) + # Pass arguments to `upload_queue_yaml` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param app_id [::String] + # Required. The App ID is supplied as an HTTP parameter. Unlike internal + # usage of App ID, it does not include a region prefix. Rather, the App ID + # represents the Project ID against which to make the request. + # @param http_body [::Google::Api::HttpBody, ::Hash] + # The http body contains the queue.yaml file which used to update queue lists + # + # @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/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new + # + # # Call the upload_queue_yaml method. + # result = client.upload_queue_yaml request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def upload_queue_yaml request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest + + # Converts hash 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.upload_queue_yaml.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::Tasks::V2beta2::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.upload_queue_yaml.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_queue_yaml.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :upload_queue_yaml, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a + # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Returns an empty policy if the + # resource exists and does not have a policy set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_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::Tasks::V2beta2::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.resource + header_params["resource"] = request.resource + 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_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy for a + # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_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::Tasks::V2beta2::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.resource + header_params["resource"] = request.resource + 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.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on a + # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. If the resource does not exist, + # this will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Tasks::V2beta2::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.resource + header_params["resource"] = request.resource + 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.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the tasks in a queue. + # + # By default, only the {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC} + # view is retrieved due to performance considerations; + # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest#response_view response_view} + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @param page_size [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks 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::Tasks::V2beta2::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListTasksRequest + + # Converts hash 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_tasks.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::Tasks::V2beta2::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_tasks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * For {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, + # the maximum task size is + # 100KB. + # * For {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}, the maximum + # task size is 1MB. + # + # @overload create_task(request, options = nil) + # Pass arguments to `create_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::CreateTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) + # Pass arguments to `create_task` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task [::Google::Cloud::Tasks::V2beta2::Task, ::Hash] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2beta2::Task#name name}. If a name is not specified + # then the system will generate a random unique task id, which will be set in + # the task returned in the {::Google::Cloud::Tasks::V2beta2::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} is not + # set or is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or completed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1 hour after the original task was + # deleted or completed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9 days after the original task was deleted or completed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new + # + # # Call the create_task method. + # result = client.create_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def create_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has completed successfully or permanently + # failed. + # + # @overload delete_task(request, options = nil) + # Pass arguments to `delete_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil) + # Pass arguments to `delete_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new + # + # # Call the delete_task method. + # result = client.delete_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Leases tasks from a pull queue for + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration}. + # + # This method is invoked by the worker to obtain a lease. The + # worker must acknowledge the task via + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask} + # after they have performed the work associated with the task. + # + # The {::Google::Cloud::Tasks::V2beta2::PullMessage#payload payload} is intended + # to store data that the worker needs to perform the work associated with the + # task. To return the payloads in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response}, set + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#response_view response_view} + # to {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL}. + # + # A maximum of 10 qps of + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} requests are + # allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + # is returned when this limit is + # exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + # is also returned when + # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second} + # is exceeded. + # + # @overload lease_tasks(request, options = nil) + # Pass arguments to `lease_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload lease_tasks(parent: nil, max_tasks: nil, lease_duration: nil, response_view: nil, filter: nil) + # Pass arguments to `lease_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param max_tasks [::Integer] + # The maximum number of tasks to lease. + # + # The system will make a best effort to return as close to as + # `max_tasks` as possible. + # + # The largest that `max_tasks` can be is 1000. + # + # The maximum total size of a [lease tasks + # response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + # sum of all task sizes requested reaches this limit, fewer tasks than + # requested are returned. + # @param lease_duration [::Google::Protobuf::Duration, ::Hash] + # Required. The duration of the lease. + # + # Each task returned in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will have its + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} set to the + # current time plus the `lease_duration`. The task is leased until its + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}; thus, the + # task will not be returned to another + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call before + # its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # + # + # After the worker has successfully finished the work associated + # with the task, the worker must call via + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask} + # before the {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # Otherwise the task will be returned to a later + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call so that + # another worker can retry it. + # + # The maximum lease duration is 1 week. + # `lease_duration` will be truncated to the nearest second. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @param filter [::String] + # `filter` can be used to specify a subset of tasks to lease. + # + # When `filter` is set to `tag=` then the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will contain only + # tasks whose {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} is equal to + # ``. `` must be less than 500 characters. + # + # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + # the same tag as the task with the oldest + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be + # returned. + # + # Grammar Syntax: + # + # * `filter = "tag=" tag | "tag_function=" function` + # + # * `tag = string` + # + # * `function = "oldest_tag()"` + # + # The `oldest_tag()` function returns tasks which have the same tag as the + # oldest task (ordered by schedule time). + # + # SDK compatibility: Although the SDK allows tags to be either + # string or + # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + # aren't UTF-8 encoded can't be used in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter} and the + # task's {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} will be displayed + # as empty in Cloud Tasks. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new + # + # # Call the lease_tasks method. + # result = client.lease_tasks request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. + # p result + # + def lease_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest + + # Converts hash 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.lease_tasks.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::Tasks::V2beta2::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.lease_tasks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.lease_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :lease_tasks, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Acknowledges a pull task. + # + # The worker, that is, the entity that + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks leased} this task must + # call this method to indicate that the work associated with the task has + # finished. + # + # The worker must acknowledge a task within the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration} + # or the lease will expire and the task will become available to be leased + # again. After the task is acknowledged, it will not be returned + # by a later {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}, + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task GetTask}, or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks}. + # + # @overload acknowledge_task(request, options = nil) + # Pass arguments to `acknowledge_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload acknowledge_task(name: nil, schedule_time: nil) + # Pass arguments to `acknowledge_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # + # @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/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new + # + # # Call the acknowledge_task method. + # result = client.acknowledge_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def acknowledge_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest + + # Converts hash 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.acknowledge_task.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::Tasks::V2beta2::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.acknowledge_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.acknowledge_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :acknowledge_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renew the current lease of a pull task. + # + # The worker can use this method to extend the lease by a new + # duration, starting from now. The new task lease will be + # returned in the task's + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # + # @overload renew_lease(request, options = nil) + # Pass arguments to `renew_lease` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload renew_lease(name: nil, schedule_time: nil, lease_duration: nil, response_view: nil) + # Pass arguments to `renew_lease` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # @param lease_duration [::Google::Protobuf::Duration, ::Hash] + # Required. The desired new lease duration, starting from now. + # + # + # The maximum lease duration is 1 week. + # `lease_duration` will be truncated to the nearest second. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new + # + # # Call the renew_lease method. + # result = client.renew_lease request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def renew_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest + + # Converts hash 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.renew_lease.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::Tasks::V2beta2::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.renew_lease.timeout, + metadata: metadata, + retry_policy: @config.rpcs.renew_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :renew_lease, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Cancel a pull task's lease. + # + # The worker can use this method to cancel a task's lease by + # setting its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} + # to now. This will make the task available to be leased to the next caller + # of {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}. + # + # @overload cancel_lease(request, options = nil) + # Pass arguments to `cancel_lease` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_lease(name: nil, schedule_time: nil, response_view: nil) + # Pass arguments to `cancel_lease` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new + # + # # Call the cancel_lease method. + # result = client.cancel_lease request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def cancel_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest + + # Converts hash 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_lease.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::Tasks::V2beta2::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_lease.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :cancel_lease, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # {::Google::Cloud::Tasks::V2beta2::RateLimits RateLimits} or is + # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. + # + # This command is meant to be used for manual debugging. For + # example, {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} can be + # used to retry a failed task after a fix has been made or to manually force + # a task to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the {::Google::Cloud::Tasks::V2beta2::Task#status status} after the + # task is dispatched but before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be + # reset to the time that + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} was called plus + # the retry delay specified in the queue's + # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig}. + # + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + # + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} cannot be called + # on a {::Google::Cloud::Tasks::V2beta2::PullMessage pull task}. + # + # @overload run_task(request, options = nil) + # Pass arguments to `run_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::RunTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::RunTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_task(name: nil, response_view: nil) + # Pass arguments to `run_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new + # + # # Call the run_task method. + # result = client.run_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def run_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RunTaskRequest + + # Converts hash 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.run_task.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::Tasks::V2beta2::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.run_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudTasks API. + # + # This class represents the configuration for CloudTasks, + # 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::Tasks::V2beta2::CloudTasks::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_queues to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CloudTasks 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_queues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_queues + ## + # RPC-specific configuration for `get_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_queue + ## + # RPC-specific configuration for `create_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_queue + ## + # RPC-specific configuration for `update_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_queue + ## + # RPC-specific configuration for `delete_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_queue + ## + # RPC-specific configuration for `purge_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_queue + ## + # RPC-specific configuration for `pause_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_queue + ## + # RPC-specific configuration for `resume_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_queue + ## + # RPC-specific configuration for `upload_queue_yaml` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_queue_yaml + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `create_task` + # @return [::Gapic::Config::Method] + # + attr_reader :create_task + ## + # RPC-specific configuration for `delete_task` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_task + ## + # RPC-specific configuration for `lease_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :lease_tasks + ## + # RPC-specific configuration for `acknowledge_task` + # @return [::Gapic::Config::Method] + # + attr_reader :acknowledge_task + ## + # RPC-specific configuration for `renew_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :renew_lease + ## + # RPC-specific configuration for `cancel_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_lease + ## + # RPC-specific configuration for `run_task` + # @return [::Gapic::Config::Method] + # + attr_reader :run_task + + # @private + def initialize parent_rpcs = nil + list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues + @list_queues = ::Gapic::Config::Method.new list_queues_config + get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue + @get_queue = ::Gapic::Config::Method.new get_queue_config + create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue + @create_queue = ::Gapic::Config::Method.new create_queue_config + update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue + @update_queue = ::Gapic::Config::Method.new update_queue_config + delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue + @delete_queue = ::Gapic::Config::Method.new delete_queue_config + purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue + @purge_queue = ::Gapic::Config::Method.new purge_queue_config + pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue + @pause_queue = ::Gapic::Config::Method.new pause_queue_config + resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue + @resume_queue = ::Gapic::Config::Method.new resume_queue_config + upload_queue_yaml_config = parent_rpcs.upload_queue_yaml if parent_rpcs.respond_to? :upload_queue_yaml + @upload_queue_yaml = ::Gapic::Config::Method.new upload_queue_yaml_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task + @create_task = ::Gapic::Config::Method.new create_task_config + delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task + @delete_task = ::Gapic::Config::Method.new delete_task_config + lease_tasks_config = parent_rpcs.lease_tasks if parent_rpcs.respond_to? :lease_tasks + @lease_tasks = ::Gapic::Config::Method.new lease_tasks_config + acknowledge_task_config = parent_rpcs.acknowledge_task if parent_rpcs.respond_to? :acknowledge_task + @acknowledge_task = ::Gapic::Config::Method.new acknowledge_task_config + renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease + @renew_lease = ::Gapic::Config::Method.new renew_lease_config + cancel_lease_config = parent_rpcs.cancel_lease if parent_rpcs.respond_to? :cancel_lease + @cancel_lease = ::Gapic::Config::Method.new cancel_lease_config + run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task + @run_task = ::Gapic::Config::Method.new run_task_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb new file mode 100644 index 000000000000..6851ba771f0a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta2 + module CloudTasks + # Credentials for the CloudTasks API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "TASKS_CREDENTIALS", + "TASKS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TASKS_CREDENTIALS_JSON", + "TASKS_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-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb new file mode 100644 index 000000000000..aa8084ac1821 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta2 + module CloudTasks + # Path helper methods for the CloudTasks 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 Queue resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/queues/{queue}` + # + # @param project [String] + # @param location [String] + # @param queue [String] + # + # @return [::String] + def queue_path project:, location:, queue: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/queues/#{queue}" + end + + ## + # Create a fully-qualified Task resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/queues/{queue}/tasks/{task}` + # + # @param project [String] + # @param location [String] + # @param queue [String] + # @param task [String] + # + # @return [::String] + def task_path project:, location:, queue:, task: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "queue cannot contain /" if queue.to_s.include? "/" + + "projects/#{project}/locations/#{location}/queues/#{queue}/tasks/#{task}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb new file mode 100644 index 000000000000..0813806ca563 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/version" +require "google/cloud/tasks/v2beta2/bindings_override" + +require "google/cloud/tasks/v2beta2/cloud_tasks/credentials" +require "google/cloud/tasks/v2beta2/cloud_tasks/paths" +require "google/cloud/tasks/v2beta2/cloud_tasks/rest/client" + +module Google + module Cloud + module Tasks + module V2beta2 + ## + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/tasks/v2beta2/cloud_tasks/rest" + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + module CloudTasks + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/tasks/v2beta2/cloud_tasks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb new file mode 100644 index 000000000000..559c626e3aed --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb @@ -0,0 +1,2667 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" +require "google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Tasks + module V2beta2 + module CloudTasks + module Rest + ## + # REST client for the CloudTasks service. + # + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_tasks_stub + + ## + # Configure the CloudTasks Client class. + # + # See {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudTasks clients + # ::Google::Cloud::Tasks::V2beta2::CloudTasks::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", "Tasks", "V2beta2"] + 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.list_queues.timeout = 20.0 + default_config.rpcs.list_queues.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_queue.timeout = 20.0 + default_config.rpcs.get_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_queue.timeout = 20.0 + + default_config.rpcs.update_queue.timeout = 20.0 + + default_config.rpcs.delete_queue.timeout = 20.0 + default_config.rpcs.delete_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.purge_queue.timeout = 20.0 + + default_config.rpcs.pause_queue.timeout = 20.0 + + default_config.rpcs.resume_queue.timeout = 20.0 + + default_config.rpcs.get_iam_policy.timeout = 20.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.set_iam_policy.timeout = 20.0 + + default_config.rpcs.test_iam_permissions.timeout = 20.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_tasks.timeout = 20.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_task.timeout = 20.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_task.timeout = 20.0 + + default_config.rpcs.delete_task.timeout = 20.0 + default_config.rpcs.delete_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.lease_tasks.timeout = 20.0 + + default_config.rpcs.acknowledge_task.timeout = 20.0 + + default_config.rpcs.renew_lease.timeout = 20.0 + + default_config.rpcs.cancel_lease.timeout = 20.0 + + default_config.rpcs.run_task.timeout = 20.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudTasks 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::Tasks::V2beta2::CloudTasks::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 + @cloud_tasks_stub.universe_domain + end + + ## + # Create a new CloudTasks REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudTasks 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 + + @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_tasks_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_tasks_stub.logger + end + + # Service calls + + ## + # Lists queues. + # + # Queues are returned in lexicographical order. + # + # @overload list_queues(request, options = nil) + # Pass arguments to `list_queues` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_queues` via keyword arguments. Note that at + # least one keyword argument is 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 location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @param filter [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2beta2::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "app_engine_http_target: *". + # + # Note that using filters might cause fewer queues than the + # requested_page size to be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#list_queues ListQueues} method. It + # is an error to switch the value of the + # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#filter filter} while + # iterating through pages. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new + # + # # Call the list_queues method. + # result = client.list_queues 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::Tasks::V2beta2::Queue. + # p item + # end + # + def list_queues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest + + # Converts hash 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_queues.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::Tasks::V2beta2::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_queues.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_queues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.list_queues request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a queue. + # + # @overload get_queue(request, options = nil) + # Pass arguments to `get_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::GetQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::GetQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) + # Pass arguments to `get_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new + # + # # Call the get_queue method. + # result = client.get_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def get_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload create_queue(request, options = nil) + # Pass arguments to `create_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::CreateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) + # Pass arguments to `create_queue` via keyword arguments. Note that at + # least one keyword argument is 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 location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + # an existing queue. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new + # + # # Call the create_queue method. + # result = client.create_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def create_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.create_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload update_queue(request, options = nil) + # Pass arguments to `update_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) + # Pass arguments to `update_queue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} must be + # specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} cannot be + # changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new + # + # # Call the update_queue method. + # result = client.update_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def update_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.update_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload delete_queue(request, options = nil) + # Pass arguments to `delete_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `delete_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new + # + # # Call the delete_queue method. + # result = client.delete_queue request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.delete_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + # + # @overload purge_queue(request, options = nil) + # Pass arguments to `purge_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_queue(name: nil) + # Pass arguments to `purge_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new + # + # # Call the purge_queue method. + # result = client.purge_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def purge_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest + + # Converts hash 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.purge_queue.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::Tasks::V2beta2::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.purge_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.purge_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can + # still be added when the queue is paused. A queue is paused if its + # {::Google::Cloud::Tasks::V2beta2::Queue#state state} is + # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. + # + # @overload pause_queue(request, options = nil) + # Pass arguments to `pause_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::PauseQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_queue(name: nil) + # Pass arguments to `pause_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new + # + # # Call the pause_queue method. + # result = client.pause_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def pause_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest + + # Converts hash 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.pause_queue.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::Tasks::V2beta2::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.pause_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.pause_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a queue. + # + # This method resumes a queue after it has been + # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED} or + # {::Google::Cloud::Tasks::V2beta2::Queue::State::DISABLED DISABLED}. The state of a + # queue is stored in the queue's + # {::Google::Cloud::Tasks::V2beta2::Queue#state state}; after calling this method + # it will be set to + # {::Google::Cloud::Tasks::V2beta2::Queue::State::RUNNING RUNNING}. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + # + # @overload resume_queue(request, options = nil) + # Pass arguments to `resume_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_queue(name: nil) + # Pass arguments to `resume_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new + # + # # Call the resume_queue method. + # result = client.resume_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + # p result + # + def resume_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest + + # Converts hash 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.resume_queue.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::Tasks::V2beta2::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.resume_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.resume_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a + # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Returns an empty policy if the + # resource exists and does not have a policy set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_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::Tasks::V2beta2::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_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy for a + # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_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::Tasks::V2beta2::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.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on a + # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. If the resource does not exist, + # this will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Tasks::V2beta2::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.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the tasks in a queue. + # + # By default, only the {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC} + # view is retrieved due to performance considerations; + # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest#response_view response_view} + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @param page_size [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks 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::Tasks::V2beta2::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListTasksRequest + + # Converts hash 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_tasks.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::Tasks::V2beta2::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_tasks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.list_tasks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * For {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, + # the maximum task size is + # 100KB. + # * For {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}, the maximum + # task size is 1MB. + # + # @overload create_task(request, options = nil) + # Pass arguments to `create_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::CreateTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) + # Pass arguments to `create_task` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task [::Google::Cloud::Tasks::V2beta2::Task, ::Hash] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2beta2::Task#name name}. If a name is not specified + # then the system will generate a random unique task id, which will be set in + # the task returned in the {::Google::Cloud::Tasks::V2beta2::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} is not + # set or is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or completed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1 hour after the original task was + # deleted or completed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9 days after the original task was deleted or completed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new + # + # # Call the create_task method. + # result = client.create_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def create_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.create_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has completed successfully or permanently + # failed. + # + # @overload delete_task(request, options = nil) + # Pass arguments to `delete_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil) + # Pass arguments to `delete_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new + # + # # Call the delete_task method. + # result = client.delete_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.delete_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Leases tasks from a pull queue for + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration}. + # + # This method is invoked by the worker to obtain a lease. The + # worker must acknowledge the task via + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#acknowledge_task AcknowledgeTask} + # after they have performed the work associated with the task. + # + # The {::Google::Cloud::Tasks::V2beta2::PullMessage#payload payload} is intended + # to store data that the worker needs to perform the work associated with the + # task. To return the payloads in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response}, set + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#response_view response_view} + # to {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL}. + # + # A maximum of 10 qps of + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} requests are + # allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + # is returned when this limit is + # exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + # is also returned when + # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second} + # is exceeded. + # + # @overload lease_tasks(request, options = nil) + # Pass arguments to `lease_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload lease_tasks(parent: nil, max_tasks: nil, lease_duration: nil, response_view: nil, filter: nil) + # Pass arguments to `lease_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param max_tasks [::Integer] + # The maximum number of tasks to lease. + # + # The system will make a best effort to return as close to as + # `max_tasks` as possible. + # + # The largest that `max_tasks` can be is 1000. + # + # The maximum total size of a [lease tasks + # response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + # sum of all task sizes requested reaches this limit, fewer tasks than + # requested are returned. + # @param lease_duration [::Google::Protobuf::Duration, ::Hash] + # Required. The duration of the lease. + # + # Each task returned in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will have its + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} set to the + # current time plus the `lease_duration`. The task is leased until its + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}; thus, the + # task will not be returned to another + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} call before + # its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # + # + # After the worker has successfully finished the work associated + # with the task, the worker must call via + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#acknowledge_task AcknowledgeTask} + # before the {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # Otherwise the task will be returned to a later + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} call so that + # another worker can retry it. + # + # The maximum lease duration is 1 week. + # `lease_duration` will be truncated to the nearest second. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @param filter [::String] + # `filter` can be used to specify a subset of tasks to lease. + # + # When `filter` is set to `tag=` then the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will contain only + # tasks whose {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} is equal to + # ``. `` must be less than 500 characters. + # + # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + # the same tag as the task with the oldest + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be + # returned. + # + # Grammar Syntax: + # + # * `filter = "tag=" tag | "tag_function=" function` + # + # * `tag = string` + # + # * `function = "oldest_tag()"` + # + # The `oldest_tag()` function returns tasks which have the same tag as the + # oldest task (ordered by schedule time). + # + # SDK compatibility: Although the SDK allows tags to be either + # string or + # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + # aren't UTF-8 encoded can't be used in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter} and the + # task's {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} will be displayed + # as empty in Cloud Tasks. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new + # + # # Call the lease_tasks method. + # result = client.lease_tasks request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. + # p result + # + def lease_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest + + # Converts hash 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.lease_tasks.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::Tasks::V2beta2::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.lease_tasks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.lease_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.lease_tasks request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Acknowledges a pull task. + # + # The worker, that is, the entity that + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks leased} this task must + # call this method to indicate that the work associated with the task has + # finished. + # + # The worker must acknowledge a task within the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration} + # or the lease will expire and the task will become available to be leased + # again. After the task is acknowledged, it will not be returned + # by a later {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks}, + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#get_task GetTask}, or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#list_tasks ListTasks}. + # + # @overload acknowledge_task(request, options = nil) + # Pass arguments to `acknowledge_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload acknowledge_task(name: nil, schedule_time: nil) + # Pass arguments to `acknowledge_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # @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/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new + # + # # Call the acknowledge_task method. + # result = client.acknowledge_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def acknowledge_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest + + # Converts hash 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.acknowledge_task.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::Tasks::V2beta2::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.acknowledge_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.acknowledge_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.acknowledge_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renew the current lease of a pull task. + # + # The worker can use this method to extend the lease by a new + # duration, starting from now. The new task lease will be + # returned in the task's + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # + # @overload renew_lease(request, options = nil) + # Pass arguments to `renew_lease` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload renew_lease(name: nil, schedule_time: nil, lease_duration: nil, response_view: nil) + # Pass arguments to `renew_lease` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # @param lease_duration [::Google::Protobuf::Duration, ::Hash] + # Required. The desired new lease duration, starting from now. + # + # + # The maximum lease duration is 1 week. + # `lease_duration` will be truncated to the nearest second. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new + # + # # Call the renew_lease method. + # result = client.renew_lease request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def renew_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest + + # Converts hash 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.renew_lease.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::Tasks::V2beta2::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.renew_lease.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.renew_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.renew_lease request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Cancel a pull task's lease. + # + # The worker can use this method to cancel a task's lease by + # setting its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} + # to now. This will make the task available to be leased to the next caller + # of {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks}. + # + # @overload cancel_lease(request, options = nil) + # Pass arguments to `cancel_lease` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_lease(name: nil, schedule_time: nil, response_view: nil) + # Pass arguments to `cancel_lease` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new + # + # # Call the cancel_lease method. + # result = client.cancel_lease request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def cancel_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest + + # Converts hash 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_lease.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::Tasks::V2beta2::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_lease.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.cancel_lease request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # {::Google::Cloud::Tasks::V2beta2::RateLimits RateLimits} or is + # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. + # + # This command is meant to be used for manual debugging. For + # example, {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} can be + # used to retry a failed task after a fix has been made or to manually force + # a task to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the {::Google::Cloud::Tasks::V2beta2::Task#status status} after the + # task is dispatched but before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be + # reset to the time that + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} was called plus + # the retry delay specified in the queue's + # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig}. + # + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + # + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} cannot be called + # on a {::Google::Cloud::Tasks::V2beta2::PullMessage pull task}. + # + # @overload run_task(request, options = nil) + # Pass arguments to `run_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta2::RunTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta2::RunTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_task(name: nil, response_view: nil) + # Pass arguments to `run_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new + # + # # Call the run_task method. + # result = client.run_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + # p result + # + def run_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RunTaskRequest + + # Converts hash 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.run_task.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::Tasks::V2beta2::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.run_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.run_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudTasks REST API. + # + # This class represents the configuration for CloudTasks 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::Tasks::V2beta2::CloudTasks::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_queues to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CloudTasks 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_queues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_queues + ## + # RPC-specific configuration for `get_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_queue + ## + # RPC-specific configuration for `create_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_queue + ## + # RPC-specific configuration for `update_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_queue + ## + # RPC-specific configuration for `delete_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_queue + ## + # RPC-specific configuration for `purge_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_queue + ## + # RPC-specific configuration for `pause_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_queue + ## + # RPC-specific configuration for `resume_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_queue + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `create_task` + # @return [::Gapic::Config::Method] + # + attr_reader :create_task + ## + # RPC-specific configuration for `delete_task` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_task + ## + # RPC-specific configuration for `lease_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :lease_tasks + ## + # RPC-specific configuration for `acknowledge_task` + # @return [::Gapic::Config::Method] + # + attr_reader :acknowledge_task + ## + # RPC-specific configuration for `renew_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :renew_lease + ## + # RPC-specific configuration for `cancel_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_lease + ## + # RPC-specific configuration for `run_task` + # @return [::Gapic::Config::Method] + # + attr_reader :run_task + + # @private + def initialize parent_rpcs = nil + list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues + @list_queues = ::Gapic::Config::Method.new list_queues_config + get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue + @get_queue = ::Gapic::Config::Method.new get_queue_config + create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue + @create_queue = ::Gapic::Config::Method.new create_queue_config + update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue + @update_queue = ::Gapic::Config::Method.new update_queue_config + delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue + @delete_queue = ::Gapic::Config::Method.new delete_queue_config + purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue + @purge_queue = ::Gapic::Config::Method.new purge_queue_config + pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue + @pause_queue = ::Gapic::Config::Method.new pause_queue_config + resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue + @resume_queue = ::Gapic::Config::Method.new resume_queue_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task + @create_task = ::Gapic::Config::Method.new create_task_config + delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task + @delete_task = ::Gapic::Config::Method.new delete_task_config + lease_tasks_config = parent_rpcs.lease_tasks if parent_rpcs.respond_to? :lease_tasks + @lease_tasks = ::Gapic::Config::Method.new lease_tasks_config + acknowledge_task_config = parent_rpcs.acknowledge_task if parent_rpcs.respond_to? :acknowledge_task + @acknowledge_task = ::Gapic::Config::Method.new acknowledge_task_config + renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease + @renew_lease = ::Gapic::Config::Method.new renew_lease_config + cancel_lease_config = parent_rpcs.cancel_lease if parent_rpcs.respond_to? :cancel_lease + @cancel_lease = ::Gapic::Config::Method.new cancel_lease_config + run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task + @run_task = ::Gapic::Config::Method.new run_task_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb new file mode 100644 index 000000000000..f7a7c052bb3f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb @@ -0,0 +1,1315 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" + +module Google + module Cloud + module Tasks + module V2beta2 + module CloudTasks + module Rest + ## + # REST service stub for the CloudTasks service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_queues REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest] + # 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::Tasks::V2beta2::ListQueuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::ListQueuesResponse] + # A result object deserialized from the server's reply + def list_queues request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_queues_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, + method_name: "list_queues", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetQueueRequest] + # 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::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # A result object deserialized from the server's reply + def get_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_queue_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, + method_name: "get_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest] + # 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::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # A result object deserialized from the server's reply + def create_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_queue_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, + method_name: "create_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest] + # 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::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # A result object deserialized from the server's reply + def update_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_queue_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, + method_name: "update_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest] + # 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_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_queue_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, + method_name: "delete_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest] + # 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::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # A result object deserialized from the server's reply + def purge_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_queue_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, + method_name: "purge_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the pause_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest] + # 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::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # A result object deserialized from the server's reply + def pause_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_queue_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, + method_name: "pause_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the resume_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest] + # 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::Tasks::V2beta2::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # A result object deserialized from the server's reply + def resume_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_queue_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, + method_name: "resume_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_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, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_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, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # 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::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListTasksRequest] + # 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::Tasks::V2beta2::ListTasksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::ListTasksResponse] + # A result object deserialized from the server's reply + def list_tasks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_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, + method_name: "list_tasks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetTaskRequest] + # 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::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # A result object deserialized from the server's reply + def get_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_task_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, + method_name: "get_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest] + # 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::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # A result object deserialized from the server's reply + def create_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_task_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, + method_name: "create_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest] + # 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_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_task_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, + method_name: "delete_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the lease_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest] + # 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::Tasks::V2beta2::LeaseTasksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] + # A result object deserialized from the server's reply + def lease_tasks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_lease_tasks_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, + method_name: "lease_tasks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the acknowledge_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest] + # 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 acknowledge_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_acknowledge_task_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, + method_name: "acknowledge_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the renew_lease REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest] + # 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::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # A result object deserialized from the server's reply + def renew_lease request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_renew_lease_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, + method_name: "renew_lease", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the cancel_lease REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest] + # 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::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # A result object deserialized from the server's reply + def cancel_lease request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_lease_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, + method_name: "cancel_lease", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::RunTaskRequest] + # 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::Tasks::V2beta2::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # A result object deserialized from the server's reply + def run_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_task_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, + method_name: "run_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_queues REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest] + # 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_queues_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta2/{parent}/queues", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{parent}/queues", + body: "queue", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2beta2/{queue.name}", + body: "queue", + matches: [ + ["queue.name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{name}:purge", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListTasksRequest] + # 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_tasks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta2/{parent}/tasks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{parent}/tasks", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2beta2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the lease_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_lease_tasks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{parent}/tasks:lease", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the acknowledge_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_acknowledge_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{name}:acknowledge", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the renew_lease REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_renew_lease_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{name}:renewLease", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_lease REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest] + # 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_lease_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{name}:cancelLease", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta2::RunTaskRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta2/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb new file mode 100644 index 000000000000..8b4aa633aa01 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta2/cloudtasks.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/httpbody_pb' +require 'google/api/resource_pb' +require 'google/cloud/tasks/v2beta2/queue_pb' +require 'google/cloud/tasks/v2beta2/task_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n+google/cloud/tasks/v2beta2/cloudtasks.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/tasks/v2beta2/queue.proto\x1a%google/cloud/tasks/v2beta2/task.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x01\n\x11ListQueuesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"`\n\x12ListQueuesResponse\x12\x31\n\x06queues\x18\x01 \x03(\x0b\x32!.google.cloud.tasks.v2beta2.Queue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"|\n\x0fGetQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x32\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x84\x01\n\x12\x43reateQueueRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x35\n\x05queue\x18\x02 \x01(\x0b\x32!.google.cloud.tasks.v2beta2.QueueB\x03\xe0\x41\x02\"|\n\x12UpdateQueueRequest\x12\x35\n\x05queue\x18\x01 \x01(\x0b\x32!.google.cloud.tasks.v2beta2.QueueB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PurgeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PauseQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"K\n\x12ResumeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"i\n\x16UploadQueueYamlRequest\x12\x13\n\x06\x61pp_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBodyH\x00\x88\x01\x01\x42\x0c\n\n_http_body\"\xaf\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"]\n\x11ListTasksResponse\x12/\n\x05tasks\x18\x01 \x03(\x0b\x32 .google.cloud.tasks.v2beta2.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x84\x01\n\x0eGetTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"\xbe\x01\n\x11\x43reateTaskRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x33\n\x04task\x18\x02 \x01(\x0b\x32 .google.cloud.tasks.v2beta2.TaskB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x03 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"I\n\x11\x44\x65leteTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\"\xe4\x01\n\x11LeaseTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x11\n\tmax_tasks\x18\x02 \x01(\x05\x12\x36\n\x0elease_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x04 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\"E\n\x12LeaseTasksResponse\x12/\n\x05tasks\x18\x01 \x03(\x0b\x32 .google.cloud.tasks.v2beta2.Task\"\x86\x01\n\x16\x41\x63knowledgeTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x36\n\rschedule_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\xf7\x01\n\x11RenewLeaseRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x36\n\rschedule_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x36\n\x0elease_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x04 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"\xc0\x01\n\x12\x43\x61ncelLeaseRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x36\n\rschedule_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x03 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"\x84\x01\n\x0eRunTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View2\xb5\x1d\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta2.ListQueuesRequest\x1a..google.cloud.tasks.v2beta2.ListQueuesResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{parent=projects/*/locations/*}/queues\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta2.GetQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{name=projects/*/locations/*/queues/*}\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta2.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"M\xda\x41\x0cparent,queue\x82\xd3\xe4\x93\x02\x38\"//v2beta2/{parent=projects/*/locations/*}/queues:\x05queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta2.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"X\xda\x41\x11queue,update_mask\x82\xd3\xe4\x93\x02>25/v2beta2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2beta2/{name=projects/*/locations/*/queues/*}\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta2.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:purge:\x01*\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta2.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:pause:\x01*\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta2.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v2beta2/{name=projects/*/locations/*/queues/*}:resume:\x01*\x12_\n\x0fUploadQueueYaml\x12\x32.google.cloud.tasks.v2beta2.UploadQueueYamlRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\xa1\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"V\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02K\"F/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta2.ListTasksRequest\x1a-.google.cloud.tasks.v2beta2.ListTasksResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta2.GetTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta2.CreateTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"P\xda\x41\x0bparent,task\x82\xd3\xe4\x93\x02<\"7/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xcd\x01\n\nLeaseTasks\x12-.google.cloud.tasks.v2beta2.LeaseTasksRequest\x1a..google.cloud.tasks.v2beta2.LeaseTasksResponse\"`\xda\x41\x15parent,lease_duration\x82\xd3\xe4\x93\x02\x42\"=/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease:\x01*\x12\xc2\x01\n\x0f\x41\x63knowledgeTask\x12\x32.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest\x1a\x16.google.protobuf.Empty\"c\xda\x41\x12name,schedule_time\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge:\x01*\x12\xd0\x01\n\nRenewLease\x12-.google.cloud.tasks.v2beta2.RenewLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"q\xda\x41!name,schedule_time,lease_duration\x82\xd3\xe4\x93\x02G\"B/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease:\x01*\x12\xc4\x01\n\x0b\x43\x61ncelLease\x12..google.cloud.tasks.v2beta2.CancelLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"c\xda\x41\x12name,schedule_time\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease:\x01*\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta2.RunTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\x1aM\xca\x41\x19\x63loudtasks.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd0\x01\n\x1e\x63om.google.cloud.tasks.v2beta2B\x0f\x43loudTasksProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspb\xa2\x02\x05TASKS\xea\x41M\n\"cloudtasks.googleapis.com/Location\x12\'projects/{project}/locations/{location}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.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.tasks.v2beta2.Queue", "google/cloud/tasks/v2beta2/queue.proto"], + ["google.api.HttpBody", "google/api/httpbody.proto"], + ["google.cloud.tasks.v2beta2.Task", "google/cloud/tasks/v2beta2/task.proto"], + ["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 Tasks + module V2beta2 + ListQueuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListQueuesRequest").msgclass + ListQueuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListQueuesResponse").msgclass + GetQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.GetQueueRequest").msgclass + CreateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.CreateQueueRequest").msgclass + UpdateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UpdateQueueRequest").msgclass + DeleteQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.DeleteQueueRequest").msgclass + PurgeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PurgeQueueRequest").msgclass + PauseQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PauseQueueRequest").msgclass + ResumeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ResumeQueueRequest").msgclass + UploadQueueYamlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UploadQueueYamlRequest").msgclass + ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListTasksRequest").msgclass + ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListTasksResponse").msgclass + GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.GetTaskRequest").msgclass + CreateTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.CreateTaskRequest").msgclass + DeleteTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.DeleteTaskRequest").msgclass + LeaseTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.LeaseTasksRequest").msgclass + LeaseTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.LeaseTasksResponse").msgclass + AcknowledgeTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AcknowledgeTaskRequest").msgclass + RenewLeaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RenewLeaseRequest").msgclass + CancelLeaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.CancelLeaseRequest").msgclass + RunTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RunTaskRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb new file mode 100644 index 000000000000..a80defa38d7a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb @@ -0,0 +1,274 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/tasks/v2beta2/cloudtasks.proto for package 'google.cloud.tasks.v2beta2' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/tasks/v2beta2/cloudtasks_pb' + +module Google + module Cloud + module Tasks + module V2beta2 + module CloudTasks + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.tasks.v2beta2.CloudTasks' + + # Lists queues. + # + # Queues are returned in lexicographical order. + rpc :ListQueues, ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse + # Gets a queue. + rpc :GetQueue, ::Google::Cloud::Tasks::V2beta2::GetQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :CreateQueue, ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :UpdateQueue, ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :DeleteQueue, ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, ::Google::Protobuf::Empty + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + rpc :PurgeQueue, ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue]. Tasks can + # still be added when the queue is paused. A queue is paused if its + # [state][google.cloud.tasks.v2beta2.Queue.state] is + # [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. + rpc :PauseQueue, ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue + # Resume a queue. + # + # This method resumes a queue after it has been + # [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED] or + # [DISABLED][google.cloud.tasks.v2beta2.Queue.State.DISABLED]. The state of a + # queue is stored in the queue's + # [state][google.cloud.tasks.v2beta2.Queue.state]; after calling this method + # it will be set to + # [RUNNING][google.cloud.tasks.v2beta2.Queue.State.RUNNING]. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + rpc :ResumeQueue, ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue + # Update queue list by uploading a queue.yaml file. + # + # The queue.yaml file is supplied in the request body as a YAML encoded + # string. This method was added to support gcloud clients versions before + # 322.0.0. New clients should use CreateQueue instead of this method. + rpc :UploadQueueYaml, ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest, ::Google::Protobuf::Empty + # Gets the access control policy for a + # [Queue][google.cloud.tasks.v2beta2.Queue]. Returns an empty policy if the + # resource exists and does not have a policy set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the access control policy for a + # [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on a + # [Queue][google.cloud.tasks.v2beta2.Queue]. If the resource does not exist, + # this will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Lists the tasks in a queue. + # + # By default, only the [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC] + # view is retrieved due to performance considerations; + # [response_view][google.cloud.tasks.v2beta2.ListTasksRequest.response_view] + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + rpc :ListTasks, ::Google::Cloud::Tasks::V2beta2::ListTasksRequest, ::Google::Cloud::Tasks::V2beta2::ListTasksResponse + # Gets a task. + rpc :GetTask, ::Google::Cloud::Tasks::V2beta2::GetTaskRequest, ::Google::Cloud::Tasks::V2beta2::Task + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], + # the maximum task size is + # 100KB. + # * For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum + # task size is 1MB. + rpc :CreateTask, ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, ::Google::Cloud::Tasks::V2beta2::Task + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has completed successfully or permanently + # failed. + rpc :DeleteTask, ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, ::Google::Protobuf::Empty + # Leases tasks from a pull queue for + # [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. + # + # This method is invoked by the worker to obtain a lease. The + # worker must acknowledge the task via + # [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] + # after they have performed the work associated with the task. + # + # The [payload][google.cloud.tasks.v2beta2.PullMessage.payload] is intended + # to store data that the worker needs to perform the work associated with the + # task. To return the payloads in the + # [response][google.cloud.tasks.v2beta2.LeaseTasksResponse], set + # [response_view][google.cloud.tasks.v2beta2.LeaseTasksRequest.response_view] + # to [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]. + # + # A maximum of 10 qps of + # [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests are + # allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + # is returned when this limit is + # exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] + # is also returned when + # [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] + # is exceeded. + rpc :LeaseTasks, ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse + # Acknowledges a pull task. + # + # The worker, that is, the entity that + # [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must + # call this method to indicate that the work associated with the task has + # finished. + # + # The worker must acknowledge a task within the + # [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration] + # or the lease will expire and the task will become available to be leased + # again. After the task is acknowledged, it will not be returned + # by a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks], + # [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or + # [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. + rpc :AcknowledgeTask, ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, ::Google::Protobuf::Empty + # Renew the current lease of a pull task. + # + # The worker can use this method to extend the lease by a new + # duration, starting from now. The new task lease will be + # returned in the task's + # [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + rpc :RenewLease, ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, ::Google::Cloud::Tasks::V2beta2::Task + # Cancel a pull task's lease. + # + # The worker can use this method to cancel a task's lease by + # setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] + # to now. This will make the task available to be leased to the next caller + # of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. + rpc :CancelLease, ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, ::Google::Cloud::Tasks::V2beta2::Task + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # [RateLimits][google.cloud.tasks.v2beta2.RateLimits] or is + # [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. + # + # This command is meant to be used for manual debugging. For + # example, [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] can be + # used to retry a failed task after a fix has been made or to manually force + # a task to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the [status][google.cloud.tasks.v2beta2.Task.status] after the + # task is dispatched but before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be + # reset to the time that + # [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] was called plus + # the retry delay specified in the queue's + # [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig]. + # + # [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + # + # [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] cannot be called + # on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. + rpc :RunTask, ::Google::Cloud::Tasks::V2beta2::RunTaskRequest, ::Google::Cloud::Tasks::V2beta2::Task + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb new file mode 100644 index 000000000000..0ba4333a5205 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta2/old_target.proto + +require 'google/protobuf' + + +descriptor_data = "\n+google/cloud/tasks/v2beta2/old_target.proto\x12\x1agoogle.cloud.tasks.v2beta2Bw\n\x1e\x63om.google.cloud.tasks.v2beta2B\x0eOldTargetProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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 = [ + ] + 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 Tasks + module V2beta2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb new file mode 100644 index 000000000000..7abbc48905fd --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta2/queue.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/tasks/v2beta2/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/tasks/v2beta2/queue.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta2/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\x06\n\x05Queue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12Q\n\x16\x61pp_engine_http_target\x18\x03 \x01(\x0b\x32/.google.cloud.tasks.v2beta2.AppEngineHttpTargetH\x00\x12=\n\x0bpull_target\x18\x04 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.PullTargetH\x00\x12=\n\x0bhttp_target\x18\x11 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.HttpTargetH\x00\x12;\n\x0brate_limits\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.RateLimits\x12=\n\x0cretry_config\x18\x06 \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.RetryConfig\x12\x36\n\x05state\x18\x07 \x01(\x0e\x32\'.google.cloud.tasks.v2beta2.Queue.State\x12.\n\npurge_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x08task_ttl\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x30\n\rtombstone_ttl\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12:\n\x05stats\x18\x10 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.QueueStatsB\x03\xe0\x41\x03\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03:\\\xea\x41Y\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x36projects/{project}/locations/{location}/queues/{queue}B\r\n\x0btarget_type\"k\n\nRateLimits\x12\'\n\x1fmax_tasks_dispatched_per_second\x18\x01 \x01(\x01\x12\x16\n\x0emax_burst_size\x18\x02 \x01(\x05\x12\x1c\n\x14max_concurrent_tasks\x18\x03 \x01(\x05\"\x81\x02\n\x0bRetryConfig\x12\x16\n\x0cmax_attempts\x18\x01 \x01(\x05H\x00\x12\x1c\n\x12unlimited_attempts\x18\x02 \x01(\x08H\x00\x12\x35\n\x12max_retry_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmin_backoff\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmax_backoff\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x06 \x01(\x05\x42\x0e\n\x0cnum_attempts\"\xe8\x01\n\nQueueStats\x12\x18\n\x0btasks_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x46\n\x1doldest_estimated_arrival_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\'\n\x1a\x65xecuted_last_minute_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12(\n\x1b\x63oncurrent_dispatches_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12%\n\x18\x65\x66\x66\x65\x63tive_execution_rate\x18\x05 \x01(\x01\x42\x03\xe0\x41\x03\x42s\n\x1e\x63om.google.cloud.tasks.v2beta2B\nQueueProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta2.AppEngineHttpTarget", "google/cloud/tasks/v2beta2/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.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 Tasks + module V2beta2 + Queue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Queue").msgclass + Queue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Queue.State").enummodule + RateLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RateLimits").msgclass + RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RetryConfig").msgclass + QueueStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.QueueStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb new file mode 100644 index 000000000000..d3a2ea31d304 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloud_tasks/rest" +require "google/cloud/tasks/v2beta2/bindings_override" +require "google/cloud/tasks/v2beta2/version" + +module Google + module Cloud + module Tasks + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/tasks/v2beta2/rest" + # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new + # + module V2beta2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb new file mode 100644 index 000000000000..87c3bb0dfc07 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta2/target.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n\'google/cloud/tasks/v2beta2/target.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x1fgoogle/api/field_behavior.proto\"\x0c\n\nPullTarget\"+\n\x0bPullMessage\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x0b\n\x03tag\x18\x02 \x01(\t\"h\n\x13\x41ppEngineHttpTarget\x12Q\n\x1b\x61pp_engine_routing_override\x18\x01 \x01(\x0b\x32,.google.cloud.tasks.v2beta2.AppEngineRouting\"\xc4\x02\n\x14\x41ppEngineHttpRequest\x12;\n\x0bhttp_method\x18\x01 \x01(\x0e\x32&.google.cloud.tasks.v2beta2.HttpMethod\x12H\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32,.google.cloud.tasks.v2beta2.AppEngineRouting\x12\x14\n\x0crelative_url\x18\x03 \x01(\t\x12N\n\x07headers\x18\x04 \x03(\x0b\x32=.google.cloud.tasks.v2beta2.AppEngineHttpRequest.HeadersEntry\x12\x0f\n\x07payload\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\"\xf5\x02\n\x0bHttpRequest\x12\x10\n\x03url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta2.HttpMethod\x12\x45\n\x07headers\x18\x03 \x03(\x0b\x32\x34.google.cloud.tasks.v2beta2.HttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta2.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\x1c\n\x0cPathOverride\x12\x0c\n\x04path\x18\x01 \x01(\t\"%\n\rQueryOverride\x12\x14\n\x0cquery_params\x18\x01 \x01(\t\"\x97\x04\n\x0bUriOverride\x12\x43\n\x06scheme\x18\x01 \x01(\x0e\x32..google.cloud.tasks.v2beta2.UriOverride.SchemeH\x00\x88\x01\x01\x12\x11\n\x04host\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\x03H\x02\x88\x01\x01\x12?\n\rpath_override\x18\x04 \x01(\x0b\x32(.google.cloud.tasks.v2beta2.PathOverride\x12\x41\n\x0equery_override\x18\x05 \x01(\x0b\x32).google.cloud.tasks.v2beta2.QueryOverride\x12\x61\n\x19uri_override_enforce_mode\x18\x06 \x01(\x0e\x32>.google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode\"5\n\x06Scheme\x12\x16\n\x12SCHEME_UNSPECIFIED\x10\x00\x12\x08\n\x04HTTP\x10\x01\x12\t\n\x05HTTPS\x10\x02\"b\n\x16UriOverrideEnforceMode\x12)\n%URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED\x10\x00\x12\x11\n\rIF_NOT_EXISTS\x10\x01\x12\n\n\x06\x41LWAYS\x10\x02\x42\t\n\x07_schemeB\x07\n\x05_hostB\x07\n\x05_port\"\xe4\x03\n\nHttpTarget\x12=\n\x0curi_override\x18\x01 \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.UriOverride\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta2.HttpMethod\x12O\n\x10header_overrides\x18\x03 \x03(\x0b\x32\x35.google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta2.OidcTokenH\x00\x1a$\n\x06Header\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x1aO\n\x0eHeaderOverride\x12=\n\x06header\x18\x01 \x01(\x0b\x32-.google.cloud.tasks.v2beta2.HttpTarget.HeaderB\x16\n\x14\x61uthorization_header\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42t\n\x1e\x63om.google.cloud.tasks.v2beta2B\x0bTargetProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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 = [ + ] + 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 Tasks + module V2beta2 + PullTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PullTarget").msgclass + PullMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PullMessage").msgclass + AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AppEngineHttpTarget").msgclass + AppEngineHttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AppEngineHttpRequest").msgclass + AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AppEngineRouting").msgclass + HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpRequest").msgclass + PathOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PathOverride").msgclass + QueryOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.QueryOverride").msgclass + UriOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UriOverride").msgclass + UriOverride::Scheme = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UriOverride.Scheme").enummodule + UriOverride::UriOverrideEnforceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode").enummodule + HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpTarget").msgclass + HttpTarget::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpTarget.Header").msgclass + HttpTarget::HeaderOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride").msgclass + OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.OAuthToken").msgclass + OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.OidcToken").msgclass + HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb new file mode 100644 index 000000000000..a188a88287b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta2/task.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/tasks/v2beta2/target_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n%google/cloud/tasks/v2beta2/task.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta2/target.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xe9\x04\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12S\n\x17\x61pp_engine_http_request\x18\x03 \x01(\x0b\x32\x30.google.cloud.tasks.v2beta2.AppEngineHttpRequestH\x00\x12?\n\x0cpull_message\x18\x04 \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.PullMessageH\x00\x12?\n\x0chttp_request\x18\r \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.HttpRequestH\x00\x12\x31\n\rschedule_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x06status\x18\x07 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.TaskStatus\x12\x33\n\x04view\x18\x08 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"1\n\x04View\x12\x14\n\x10VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02:h\xea\x41\x65\n\x1e\x63loudtasks.googleapis.com/Task\x12\x43projects/{project}/locations/{location}/queues/{queue}/tasks/{task}B\x0e\n\x0cpayload_type\"\xdd\x01\n\nTaskStatus\x12\x1e\n\x16\x61ttempt_dispatch_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x61ttempt_response_count\x18\x02 \x01(\x05\x12G\n\x14\x66irst_attempt_status\x18\x03 \x01(\x0b\x32).google.cloud.tasks.v2beta2.AttemptStatus\x12\x46\n\x13last_attempt_status\x18\x04 \x01(\x0b\x32).google.cloud.tasks.v2beta2.AttemptStatus\"\xd5\x01\n\rAttemptStatus\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rdispatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rresponse_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x0fresponse_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusBr\n\x1e\x63om.google.cloud.tasks.v2beta2B\tTaskProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta2.AppEngineHttpRequest", "google/cloud/tasks/v2beta2/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.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 Tasks + module V2beta2 + Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Task").msgclass + Task::View = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Task.View").enummodule + TaskStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.TaskStatus").msgclass + AttemptStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AttemptStatus").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb new file mode 100644 index 000000000000..fb19c639de63 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md new file mode 100644 index 000000000000..da33c0281ced --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Tasks V2beta2 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-tasks-v2beta2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/httpbody.rb new file mode 100644 index 000000000000..938f7ac6b2fd --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/httpbody.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Message that represents an arbitrary HTTP body. It should only be used for + # payload formats that can't be represented as JSON, such as raw binary or + # an HTML page. + # + # + # This message can be used both in streaming and non-streaming API methods in + # the request as well as the response. + # + # It can be used as a top-level request field, which is convenient if one + # wants to extract parameters from either the URL or HTTP template into the + # request fields and also want access to the raw HTTP body. + # + # Example: + # + # message GetResourceRequest { + # // A unique request id. + # string request_id = 1; + # + # // The raw HTTP body is bound to this field. + # google.api.HttpBody http_body = 2; + # + # } + # + # service ResourceService { + # rpc GetResource(GetResourceRequest) + # returns (google.api.HttpBody); + # rpc UpdateResource(google.api.HttpBody) + # returns (google.protobuf.Empty); + # + # } + # + # Example with streaming methods: + # + # service CaldavService { + # rpc GetCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # rpc UpdateCalendar(stream google.api.HttpBody) + # returns (stream google.api.HttpBody); + # + # } + # + # Use of this type only changes how the request and response bodies are + # handled, all other features will continue to work unchanged. + # @!attribute [rw] content_type + # @return [::String] + # The HTTP Content-Type header value specifying the content type of the body. + # @!attribute [rw] data + # @return [::String] + # The HTTP request/response body as raw binary. + # @!attribute [rw] extensions + # @return [::Array<::Google::Protobuf::Any>] + # Application specific response metadata. Must be set in the first response + # for streaming APIs. + class HttpBody + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb new file mode 100644 index 000000000000..91f3d9930425 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb @@ -0,0 +1,608 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta2 + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @!attribute [rw] filter + # @return [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2beta2::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "app_engine_http_target: *". + # + # Note that using filters might cause fewer queues than the + # requested_page size to be returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues} method. It + # is an error to switch the value of the + # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#filter filter} while + # iterating through pages. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + class ListQueuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues}. + # @!attribute [rw] queues + # @return [::Array<::Google::Cloud::Tasks::V2beta2::Queue>] + # The list of queues. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # + # To return the next page of results, call + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues} with this + # value as the + # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#page_token page_token}. + # + # If the next_page_token is empty, there are no more results. + # + # The page token is valid for only 2 hours. + class ListQueuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue GetQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + class GetQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue CreateQueue}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @!attribute [rw] queue + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as + # an existing queue. + class CreateQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue}. + # @!attribute [rw] queue + # @return [::Google::Cloud::Tasks::V2beta2::Queue] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} must be + # specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} cannot be + # changed. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + class UpdateQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue DeleteQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + class DeleteQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue PurgeQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class PurgeQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue PauseQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class PauseQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue ResumeQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class ResumeQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml UploadQueueYaml}. + # @!attribute [rw] app_id + # @return [::String] + # Required. The App ID is supplied as an HTTP parameter. Unlike internal + # usage of App ID, it does not include a region prefix. Rather, the App ID + # represents the Project ID against which to make the request. + # @!attribute [rw] http_body + # @return [::Google::Api::HttpBody] + # The http body contains the queue.yaml file which used to update queue lists + class UploadQueueYamlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing tasks using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks}. + # @!attribute [rw] parent + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + class ListTasksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing tasks using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks}. + # @!attribute [rw] tasks + # @return [::Array<::Google::Cloud::Tasks::V2beta2::Task>] + # The list of tasks. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # + # To return the next page of results, call + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks} with this + # value as the + # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest#page_token page_token}. + # + # If the next_page_token is empty, there are no more results. + class ListTasksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a task using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task GetTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + class GetTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask}. + # @!attribute [rw] parent + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @!attribute [rw] task + # @return [::Google::Cloud::Tasks::V2beta2::Task] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2beta2::Task#name name}. If a name is not specified + # then the system will generate a random unique task id, which will be set in + # the task returned in the {::Google::Cloud::Tasks::V2beta2::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} is not + # set or is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or completed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1 hour after the original task was + # deleted or completed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9 days after the original task was deleted or completed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + class CreateTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a task using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task DeleteTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + class DeleteTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for leasing tasks using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}. + # @!attribute [rw] parent + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @!attribute [rw] max_tasks + # @return [::Integer] + # The maximum number of tasks to lease. + # + # The system will make a best effort to return as close to as + # `max_tasks` as possible. + # + # The largest that `max_tasks` can be is 1000. + # + # The maximum total size of a [lease tasks + # response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the + # sum of all task sizes requested reaches this limit, fewer tasks than + # requested are returned. + # @!attribute [rw] lease_duration + # @return [::Google::Protobuf::Duration] + # Required. The duration of the lease. + # + # Each task returned in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will have its + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} set to the + # current time plus the `lease_duration`. The task is leased until its + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}; thus, the + # task will not be returned to another + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call before + # its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # + # + # After the worker has successfully finished the work associated + # with the task, the worker must call via + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask} + # before the {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. + # Otherwise the task will be returned to a later + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call so that + # another worker can retry it. + # + # The maximum lease duration is 1 week. + # `lease_duration` will be truncated to the nearest second. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + # @!attribute [rw] filter + # @return [::String] + # `filter` can be used to specify a subset of tasks to lease. + # + # When `filter` is set to `tag=` then the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will contain only + # tasks whose {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} is equal to + # ``. `` must be less than 500 characters. + # + # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + # the same tag as the task with the oldest + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be + # returned. + # + # Grammar Syntax: + # + # * `filter = "tag=" tag | "tag_function=" function` + # + # * `tag = string` + # + # * `function = "oldest_tag()"` + # + # The `oldest_tag()` function returns tasks which have the same tag as the + # oldest task (ordered by schedule time). + # + # SDK compatibility: Although the SDK allows tags to be either + # string or + # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which + # aren't UTF-8 encoded can't be used in the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter} and the + # task's {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} will be displayed + # as empty in Cloud Tasks. + class LeaseTasksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for leasing tasks using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}. + # @!attribute [rw] tasks + # @return [::Array<::Google::Cloud::Tasks::V2beta2::Task>] + # The leased tasks. + class LeaseTasksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for acknowledging a task using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + class AcknowledgeTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for renewing a lease using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # @!attribute [rw] lease_duration + # @return [::Google::Protobuf::Duration] + # Required. The desired new lease duration, starting from now. + # + # + # The maximum lease duration is 1 week. + # `lease_duration` will be truncated to the nearest second. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + class RenewLeaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for canceling a lease using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease CancelLease}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Required. The task's current schedule time, available in the + # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. + # This restriction is to ensure that your worker currently holds the lease. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + class CancelLeaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for forcing a task to run now using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. + class RunTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb new file mode 100644 index 000000000000..c00a2ec7be5e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb @@ -0,0 +1,448 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta2 + # A queue is a container of related tasks. Queues are configured to manage + # how those tasks are dispatched. Configurable properties include rate limits, + # retry options, target types, and others. + # @!attribute [rw] name + # @return [::String] + # Caller-specified and required in + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue CreateQueue}, after + # which it becomes output only. + # + # The queue name. + # + # The queue name must have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the queue's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + # hyphens (-). The maximum length is 100 characters. + # @!attribute [rw] app_engine_http_target + # @return [::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget] + # App Engine HTTP target. + # + # An App Engine queue is a queue that has an + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget}. + # + # Note: The following fields are mutually exclusive: `app_engine_http_target`, `pull_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] pull_target + # @return [::Google::Cloud::Tasks::V2beta2::PullTarget] + # Pull target. + # + # A pull queue is a queue that has a + # {::Google::Cloud::Tasks::V2beta2::PullTarget PullTarget}. + # + # Note: The following fields are mutually exclusive: `pull_target`, `app_engine_http_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] http_target + # @return [::Google::Cloud::Tasks::V2beta2::HttpTarget] + # An http_target is used to override the target values for HTTP tasks. + # + # Note: The following fields are mutually exclusive: `http_target`, `app_engine_http_target`, `pull_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] rate_limits + # @return [::Google::Cloud::Tasks::V2beta2::RateLimits] + # Rate limits for task dispatches. + # + # {::Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} and + # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} are related + # because they both control task attempts however they control how tasks are + # attempted in different ways: + # + # * {::Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} controls the + # total rate of + # dispatches from a queue (i.e. all traffic dispatched from the + # queue, regardless of whether the dispatch is from a first + # attempt or a retry). + # * {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls + # what happens to + # particular a task after its first attempt fails. That is, + # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls + # task retries (the second attempt, third attempt, etc). + # @!attribute [rw] retry_config + # @return [::Google::Cloud::Tasks::V2beta2::RetryConfig] + # Settings that determine the retry behavior. + # + # * For tasks created using Cloud Tasks: the queue-level retry settings + # apply to all tasks in the queue that were created using Cloud Tasks. + # Retry settings cannot be set on individual tasks. + # * For tasks created using the App Engine SDK: the queue-level retry + # settings apply to all tasks in the queue which do not have retry settings + # explicitly set on the task and were created by the App Engine SDK. See + # [App Engine + # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + # @!attribute [rw] state + # @return [::Google::Cloud::Tasks::V2beta2::Queue::State] + # Output only. The state of the queue. + # + # `state` can only be changed by called + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue PauseQueue}, + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue ResumeQueue}, or + # uploading + # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} cannot be + # used to change `state`. + # @!attribute [rw] purge_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time this queue was purged. + # + # All tasks that were {::Google::Cloud::Tasks::V2beta2::Task#create_time created} + # before this time were purged. + # + # A queue can be purged using + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue PurgeQueue}, the [App + # Engine Task Queue SDK, or the Cloud + # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + # + # Purge time will be truncated to the nearest microsecond. Purge + # time will be unset if the queue has never been purged. + # @!attribute [rw] task_ttl + # @return [::Google::Protobuf::Duration] + # The maximum amount of time that a task will be retained in + # this queue. + # + # Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + # After a task has lived for `task_ttl`, the task will be deleted + # regardless of whether it was dispatched or not. + # + # The `task_ttl` for queues created via queue.yaml/xml is equal to the + # maximum duration because there is a + # [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + # these queues. To view the maximum valid duration, see the documentation for + # {::Google::Protobuf::Duration Duration}. + # @!attribute [rw] tombstone_ttl + # @return [::Google::Protobuf::Duration] + # The task tombstone time to live (TTL). + # + # After a task is deleted or completed, the task's tombstone is + # retained for the length of time specified by `tombstone_ttl`. + # The tombstone is used by task de-duplication; another task with the same + # name can't be created until the tombstone has expired. For more information + # about task de-duplication, see the documentation for + # {::Google::Cloud::Tasks::V2beta2::CreateTaskRequest#task CreateTaskRequest}. + # + # Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + # @!attribute [r] stats + # @return [::Google::Cloud::Tasks::V2beta2::QueueStats] + # Output only. The realtime, informational statistics for a queue. In order + # to receive the statistics the caller should include this field in the + # FieldMask. + class Queue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the queue. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The queue is running. Tasks can be dispatched. + # + # If the queue was created using Cloud Tasks and the queue has + # had no activity (method calls or task dispatches) for 30 days, + # the queue may take a few minutes to re-activate. Some method + # calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and + # tasks may not be dispatched for a few minutes until the queue + # has been re-activated. + RUNNING = 1 + + # Tasks are paused by the user. If the queue is paused then Cloud + # Tasks will stop delivering tasks from it, but more tasks can + # still be added to it by the user. When a pull queue is paused, + # all {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} calls + # will return a [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION]. + PAUSED = 2 + + # The queue is disabled. + # + # A queue becomes `DISABLED` when + # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) + # or + # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) + # is uploaded which does not contain the queue. You cannot directly disable + # a queue. + # + # When a queue is disabled, tasks can still be added to a queue + # but the tasks are not dispatched and + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} calls + # return a `FAILED_PRECONDITION` error. + # + # To permanently delete this queue and all of its tasks, call + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue DeleteQueue}. + DISABLED = 3 + end + end + + # Rate limits. + # + # This message determines the maximum rate that tasks can be dispatched by a + # queue, regardless of whether the dispatch is a first task attempt or a retry. + # + # Note: The debugging command, + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask}, will run a task + # even if the queue has reached its + # {::Google::Cloud::Tasks::V2beta2::RateLimits RateLimits}. + # @!attribute [rw] max_tasks_dispatched_per_second + # @return [::Float] + # The maximum rate at which tasks are dispatched from this queue. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # * For {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, + # the maximum allowed value + # is 500. + # * This field is output only for [pull + # queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the + # `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} requests + # are allowed per pull queue. + # + # + # This field has the same meaning as + # [rate in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + # @!attribute [rw] max_burst_size + # @return [::Integer] + # The max burst size. + # + # Max burst size limits how fast tasks in queue are processed when + # many tasks are in the queue and the rate is high. This field + # allows the queue to have a high rate so processing starts shortly + # after a task is enqueued, but still limits resource usage when + # many tasks are enqueued in a short period of time. + # + # The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + # algorithm is used to control the rate of task dispatches. Each + # queue has a token bucket that holds tokens, up to the maximum + # specified by `max_burst_size`. Each time a task is dispatched, a + # token is removed from the bucket. Tasks will be dispatched until + # the queue's bucket runs out of tokens. The bucket will be + # continuously refilled with new tokens based on + # [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + # + # The default value of `max_burst_size` is picked by Cloud Tasks + # based on the value of + # [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + # + # The maximum value of `max_burst_size` is 500. + # + # For App Engine queues that were created or updated using + # `queue.yaml/xml`, `max_burst_size` is equal to + # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + # If + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} is called + # on a queue without explicitly setting a value for `max_burst_size`, + # `max_burst_size` value will get updated if + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} is + # updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. + # @!attribute [rw] max_concurrent_tasks + # @return [::Integer] + # The maximum number of concurrent tasks that Cloud Tasks allows + # to be dispatched for this queue. After this threshold has been + # reached, Cloud Tasks stops dispatching tasks until the number of + # concurrent requests decreases. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # The maximum allowed value is 5,000. + # + # This field is output only for + # {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues} and always -1, which + # indicates no limit. No other queue types can have `max_concurrent_tasks` + # set to -1. + # + # + # This field has the same meaning as + # [max_concurrent_requests in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + class RateLimits + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retry config. + # + # These settings determine how a failed task attempt is retried. + # @!attribute [rw] max_attempts + # @return [::Integer] + # The maximum number of attempts for a task. + # + # Cloud Tasks will attempt the task `max_attempts` times (that + # is, if the first attempt fails, then there will be + # `max_attempts - 1` retries). Must be > 0. + # + # Note: The following fields are mutually exclusive: `max_attempts`, `unlimited_attempts`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] unlimited_attempts + # @return [::Boolean] + # If true, then the number of attempts is unlimited. + # + # Note: The following fields are mutually exclusive: `unlimited_attempts`, `max_attempts`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_retry_duration + # @return [::Google::Protobuf::Duration] + # If positive, `max_retry_duration` specifies the time limit for + # retrying a failed task, measured from when the task was first + # attempted. Once `max_retry_duration` time has passed *and* the + # task has been attempted + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times, + # no further attempts will be made and the task will be deleted. + # + # If zero, then the task age is unlimited. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # This field is output only for [pull + # queues][google.cloud.tasks.v2beta2.PullTarget]. + # + # + # `max_retry_duration` will be truncated to the nearest second. + # + # This field has the same meaning as + # [task_age_limit in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] min_backoff + # @return [::Google::Protobuf::Duration] + # A task will be {::Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} + # for retry between + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration + # after it fails, if the queue's + # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the + # task should be retried. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # This field is output only for [pull + # queues][google.cloud.tasks.v2beta2.PullTarget]. + # + # + # `min_backoff` will be truncated to the nearest second. + # + # This field has the same meaning as + # [min_backoff_seconds in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_backoff + # @return [::Google::Protobuf::Duration] + # A task will be {::Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} + # for retry between + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration + # after it fails, if the queue's + # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the + # task should be retried. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # This field is output only for [pull + # queues][google.cloud.tasks.v2beta2.PullTarget]. + # + # + # `max_backoff` will be truncated to the nearest second. + # + # This field has the same meaning as + # [max_backoff_seconds in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_doublings + # @return [::Integer] + # The time between retries will double `max_doublings` times. + # + # A task's retry interval starts at + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff}, then + # doubles `max_doublings` times, then increases linearly, and finally retries + # at intervals of + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} up to + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times. + # + # For example, if + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} is 10s, + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} is 300s, + # and `max_doublings` is 3, then the a task will first be retried in 10s. The + # retry interval will double three times, and then increase linearly by 2^3 * + # 10s. Finally, the task will retry at intervals of + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} until the + # task has been attempted + # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times. + # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + # 300s, .... + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # This field is output only for [pull + # queues][google.cloud.tasks.v2beta2.PullTarget]. + # + # + # This field has the same meaning as + # [max_doublings in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + class RetryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Statistics for a queue. + # @!attribute [r] tasks_count + # @return [::Integer] + # Output only. An estimation of the number of tasks in the queue, that is, + # the tasks in the queue that haven't been executed, the tasks in the queue + # which the queue has dispatched but has not yet received a reply for, and + # the failed tasks that the queue is retrying. + # @!attribute [r] oldest_estimated_arrival_time + # @return [::Google::Protobuf::Timestamp] + # Output only. An estimation of the nearest time in the future where a task + # in the queue is scheduled to be executed. + # @!attribute [r] executed_last_minute_count + # @return [::Integer] + # Output only. The number of tasks that the queue has dispatched and received + # a reply for during the last minute. This variable counts both successful + # and non-successful executions. + # @!attribute [r] concurrent_dispatches_count + # @return [::Integer] + # Output only. The number of requests that the queue has dispatched but has + # not received a reply for yet. + # @!attribute [r] effective_execution_rate + # @return [::Float] + # Output only. The current maximum number of tasks per second executed by the + # queue. The maximum value of this variable is controlled by the RateLimits + # of the Queue. However, this value could be less to avoid overloading the + # endpoints tasks in the queue are targeting. + class QueueStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb new file mode 100644 index 000000000000..0ca9fafc9695 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb @@ -0,0 +1,775 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta2 + # Pull target. + class PullTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The pull message contains data that can be used by the caller of + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} to process the + # task. + # + # This proto can only be used for tasks in a queue which has + # {::Google::Cloud::Tasks::V2beta2::Queue#pull_target pull_target} set. + # @!attribute [rw] payload + # @return [::String] + # A data payload consumed by the worker to execute the task. + # @!attribute [rw] tag + # @return [::String] + # The task's tag. + # + # Tags allow similar tasks to be processed in a batch. If you label + # tasks with a tag, your worker can + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks lease tasks} with the + # same tag using + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter}. For example, + # if you want to aggregate the events associated with a specific user once a + # day, you could tag tasks with the user ID. + # + # The task's tag can only be set when the + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}. + # + # The tag must be less than 500 characters. + # + # SDK compatibility: Although the SDK allows tags to be either + # string or + # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + # encoded, the tag will be empty when the task is returned by Cloud Tasks. + class PullMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # App Engine HTTP target. + # + # The task will be delivered to the App Engine application hostname + # specified by its + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} and + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest}. The + # documentation for + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} + # explains how the task's host URL is constructed. + # + # Using {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} + # requires + # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) + # Google IAM permission for the project + # and the following scope: + # + # `https://www.googleapis.com/auth/cloud-platform` + # @!attribute [rw] app_engine_routing_override + # @return [::Google::Cloud::Tasks::V2beta2::AppEngineRouting] + # Overrides for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + # + # If set, `app_engine_routing_override` is used for all tasks in + # the queue, no matter what the setting is for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + class AppEngineHttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # App Engine HTTP request. + # + # The message defines the HTTP request that is sent to an App Engine app when + # the task is dispatched. + # + # This proto can only be used for tasks in a queue which has + # {::Google::Cloud::Tasks::V2beta2::Queue#app_engine_http_target app_engine_http_target} + # set. + # + # Using {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} + # requires + # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) + # Google IAM permission for the project + # and the following scope: + # + # `https://www.googleapis.com/auth/cloud-platform` + # + # The task will be delivered to the App Engine app which belongs to the same + # project as the queue. For more information, see + # [How Requests are + # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and how routing is affected by + # [dispatch + # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). + # Traffic is encrypted during transport and never leaves Google datacenters. + # Because this traffic is carried over a communication mechanism internal to + # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). + # The request to the handler, however, will appear to have used the HTTP + # protocol. + # + # The {::Google::Cloud::Tasks::V2beta2::AppEngineRouting AppEngineRouting} used to + # construct the URL that the task is delivered to can be set at the queue-level + # or task-level: + # + # * If set, + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override} + # is used for all tasks in the queue, no matter what the setting + # is for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + # + # + # The `url` that the task will be sent to is: + # + # * `url =` {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} `+` + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#relative_url relative_url} + # + # Tasks can be dispatched to secure app handlers, unsecure app handlers, and + # URIs restricted with + # [`login: + # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). + # Because tasks are not run as any user, they cannot be dispatched to URIs + # restricted with + # [`login: + # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) + # Task dispatches also do not follow redirects. + # + # The task attempt has succeeded if the app's request handler returns an HTTP + # response code in the range [`200` - `299`]. The task attempt has failed if + # the app's handler returns a non-2xx response code or Cloud Tasks does + # not receive response before the [deadline][Task.dispatch_deadline]. Failed + # tasks will be retried according to the + # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry configuration}. `503` + # (Service Unavailable) is considered an App Engine system error instead of an + # application error and will cause Cloud Tasks' traffic congestion control to + # temporarily throttle the queue's dispatches. Unlike other types of task + # targets, a `429` (Too Many Requests) response from an app handler does not + # cause traffic congestion control to throttle the queue. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2beta2::HttpMethod] + # The HTTP method to use for the request. The default is POST. + # + # The app's request handler for the task's target URL must be able to handle + # HTTP requests with this http_method, otherwise the task attempt fails with + # error code 405 (Method Not Allowed). See [Writing a push task request + # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + # and the App Engine documentation for your runtime on [How Requests are + # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + # @!attribute [rw] app_engine_routing + # @return [::Google::Cloud::Tasks::V2beta2::AppEngineRouting] + # Task-level setting for App Engine routing. + # + # If set, + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override} + # is used for all tasks in the queue, no matter what the setting is for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. + # @!attribute [rw] relative_url + # @return [::String] + # The relative URL. + # + # The relative URL must begin with "/" and must be a valid HTTP relative URL. + # It can contain a path and query string arguments. + # If the relative URL is empty, then the root path "/" will be used. + # No spaces are allowed, and the maximum length allowed is 2083 characters. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. + # Headers can be set when the + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}. + # Repeated headers are not supported but a header value can contain commas. + # + # Cloud Tasks sets some headers to default values: + # + # * `User-Agent`: By default, this header is + # `"AppEngine-Google; (+http://code.google.com/appengine)"`. + # This header can be modified, but Cloud Tasks will append + # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + # modified `User-Agent`. + # + # If the task has a + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#payload payload}, Cloud + # Tasks sets the following headers: + # + # * `Content-Type`: By default, the `Content-Type` header is set to + # `"application/octet-stream"`. The default can be overridden by explicitly + # setting `Content-Type` to a particular media type when the + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}. + # For example, `Content-Type` can be set to `"application/json"`. + # * `Content-Length`: This is computed by Cloud Tasks. This value is + # output only. It cannot be changed. + # + # The headers below cannot be set or overridden: + # + # * `Host` + # * `X-Google-*` + # * `X-AppEngine-*` + # + # In addition, Cloud Tasks sets some headers when the task is dispatched, + # such as headers containing information about the task; see + # [request + # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + # These headers are set only when the task is dispatched, so they are not + # visible when the task is returned in a Cloud Tasks response. + # + # Although there is no specific limit for the maximum number of headers or + # the size, there is a limit on the maximum size of the + # {::Google::Cloud::Tasks::V2beta2::Task Task}. For more information, see the + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask} + # documentation. + # @!attribute [rw] payload + # @return [::String] + # Payload. + # + # The payload will be sent as the HTTP message body. A message + # body, and thus a payload, is allowed only if the HTTP method is + # POST or PUT. It is an error to set a data payload on a task with + # an incompatible {::Google::Cloud::Tasks::V2beta2::HttpMethod HttpMethod}. + class AppEngineHttpRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine Routing. + # + # Defines routing characteristics specific to App Engine - service, version, + # and instance. + # + # For more information about services, versions, and instances see + # [An Overview of App + # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), + # [Microservices Architecture on Google App + # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] service + # @return [::String] + # App service. + # + # By default, the task is sent to the service which is the default + # service when the task is attempted. + # + # For some queues or tasks which were created using the App Engine + # Task Queue API, {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is + # not parsable into + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For + # example, some tasks which were created using the App Engine SDK use a + # custom domain name; custom domains are not parsed by Cloud Tasks. If + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, + # then {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the + # empty string. + # @!attribute [rw] version + # @return [::String] + # App version. + # + # By default, the task is sent to the version which is the default + # version when the task is attempted. + # + # For some queues or tasks which were created using the App Engine + # Task Queue API, {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is + # not parsable into + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For + # example, some tasks which were created using the App Engine SDK use a + # custom domain name; custom domains are not parsed by Cloud Tasks. If + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, + # then {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the + # empty string. + # @!attribute [rw] instance + # @return [::String] + # App instance. + # + # By default, the task is sent to an instance which is available when + # the task is attempted. + # + # Requests can only be sent to a specific instance if + # [manual scaling is used in App Engine + # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + # App Engine Flex does not support instances. For more information, see + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] host + # @return [::String] + # Output only. The host that the task is sent to. + # + # For more information, see + # [How Requests are + # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + # + # The host is constructed as: + # + # + # * `host = [application_domain_name]`
+ # `| [service] + '.' + [application_domain_name]`
+ # `| [version] + '.' + [application_domain_name]`
+ # `| [version_dot_service]+ '.' + [application_domain_name]`
+ # `| [instance] + '.' + [application_domain_name]`
+ # `| [instance_dot_service] + '.' + [application_domain_name]`
+ # `| [instance_dot_version] + '.' + [application_domain_name]`
+ # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + # + # * `application_domain_name` = The domain name of the app, for + # example .appspot.com, which is associated with the + # queue's project ID. Some tasks which were created using the App Engine + # SDK use a custom domain name. + # + # * `service =` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} + # + # * `version =` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} + # + # * `version_dot_service =` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} `+ '.' +` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} + # + # * `instance =` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} + # + # * `instance_dot_service =` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' + # +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + # + # * `instance_dot_version =` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' + # +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] + # + # * `instance_dot_version_dot_service =` + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' + # +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' + # +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] + # + # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} is empty, + # then the task will be sent to the service which is the default service when + # the task is attempted. + # + # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} is empty, + # then the task will be sent to the version which is the default version when + # the task is attempted. + # + # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is + # empty, then the task will be sent to an instance which is available when + # the task is attempted. + # + # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, or + # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is + # invalid, then the task will be sent to the default version of the default + # service when the task is attempted. + class AppEngineRouting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # HTTP request. + # + # The task will be pushed to the worker as an HTTP request. An HTTP request + # embodies a url, an http method, headers, body and authorization for the http + # task. + # @!attribute [rw] url + # @return [::String] + # Required. The full url path that the request will be sent to. + # + # This string must begin with either "http://" or "https://". Some examples + # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + # encode some characters for safety and compatibility. The maximum allowed + # URL length is 2083 characters after encoding. + # + # The `Location` header response from a redirect response [`300` - `399`] + # may be followed. The redirect is not counted as a separate attempt. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2beta2::HttpMethod] + # The HTTP method to use for the request. The default is POST. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. + # Headers can be set when running the + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created} or + # [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + # + # These headers represent a subset of the headers that will accompany the + # task's HTTP request. Some HTTP request headers will be ignored or replaced. + # + # A partial list of headers that will be ignored or replaced is: + # + # * Any header that is prefixed with "X-CloudTasks-" will be treated + # as service header. Service headers define properties of the task and are + # predefined in CloudTask. + # * Host: This will be computed by Cloud Tasks and derived from + # {::Google::Cloud::Tasks::V2beta2::HttpRequest#url HttpRequest.url}. + # * Content-Length: This will be computed by Cloud Tasks. + # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + # * `X-Google-*`: Google use only. + # * `X-AppEngine-*`: Google use only. + # + # `Content-Type` won't be set by Cloud Tasks. You can explicitly set + # `Content-Type` to a media type when the + # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + # For example, `Content-Type` can be set to `"application/octet-stream"` or + # `"application/json"`. + # + # Headers which can have multiple values (according to RFC2616) can be + # specified using comma-separated values. + # + # The size of the headers must be less than 80KB. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. + # + # A request body is allowed only if the + # {::Google::Cloud::Tasks::V2beta2::HttpRequest#http_method HTTP method} is POST, + # PUT, or PATCH. It is an error to set body on a task with an incompatible + # {::Google::Cloud::Tasks::V2beta2::HttpMethod HttpMethod}. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Tasks::V2beta2::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as an `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # + # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Tasks::V2beta2::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # + # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HttpRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # PathOverride. + # + # Path message defines path override for HTTP targets. + # @!attribute [rw] path + # @return [::String] + # The URI path (e.g., /users/1234). Default is an empty string. + class PathOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # QueryOverride. + # + # Query message defines query override for HTTP targets. + # @!attribute [rw] query_params + # @return [::String] + # The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + # string. + class QueryOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Uri Override. + # + # When specified, all the HTTP tasks inside the queue will be partially or + # fully overridden depending on the configured values. + # @!attribute [rw] scheme + # @return [::Google::Cloud::Tasks::V2beta2::UriOverride::Scheme] + # Scheme override. + # + # When specified, the task URI scheme is replaced by the provided value (HTTP + # or HTTPS). + # @!attribute [rw] host + # @return [::String] + # Host override. + # + # When specified, replaces the host part of the task URL. For example, + # if the task URL is "https://www.google.com," and host value is set to + # "example.net", the overridden URI will be changed to "https://example.net." + # Host value cannot be an empty string (INVALID_ARGUMENT). + # @!attribute [rw] port + # @return [::Integer] + # Port override. + # + # When specified, replaces the port part of the task URI. For instance, + # for a URI http://www.google.com/foo and port=123, the overridden URI + # becomes http://www.google.com:123/foo. Note that the port value must be a + # positive integer. Setting the port to 0 (Zero) clears the URI port. + # @!attribute [rw] path_override + # @return [::Google::Cloud::Tasks::V2beta2::PathOverride] + # URI path. + # + # When specified, replaces the existing path of the task URL. Setting the + # path value to an empty string clears the URI path segment. + # @!attribute [rw] query_override + # @return [::Google::Cloud::Tasks::V2beta2::QueryOverride] + # URI Query. + # + # When specified, replaces the query part of the task URI. Setting the + # query value to an empty string clears the URI query segment. + # @!attribute [rw] uri_override_enforce_mode + # @return [::Google::Cloud::Tasks::V2beta2::UriOverride::UriOverrideEnforceMode] + # URI Override Enforce Mode + # + # When specified, determines the Target UriOverride mode. If not specified, + # it defaults to ALWAYS. + class UriOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The Scheme for an HTTP request. By default, it is HTTPS. + module Scheme + # Scheme unspecified. Defaults to HTTPS. + SCHEME_UNSPECIFIED = 0 + + # Convert the scheme to HTTP, e.g., https://www.google.ca will change to + # http://www.google.ca. + HTTP = 1 + + # Convert the scheme to HTTPS, e.g., http://www.google.ca will change to + # https://www.google.ca. + HTTPS = 2 + end + + # UriOverrideEnforceMode mode is to define enforcing mode for the override + # modes. + module UriOverrideEnforceMode + # OverrideMode Unspecified. Defaults to ALWAYS. + URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0 + + # In the IF_NOT_EXISTS mode, queue-level configuration is only + # applied where task-level configuration does not exist. + IF_NOT_EXISTS = 1 + + # In the ALWAYS mode, queue-level configuration overrides all + # task-level configuration + ALWAYS = 2 + end + end + + # HTTP target. + # + # When specified as a [Queue][target_type], all the tasks with [HttpRequest] + # will be overridden according to the target. + # @!attribute [rw] uri_override + # @return [::Google::Cloud::Tasks::V2beta2::UriOverride] + # Uri override. + # + # When specified, overrides the execution Uri for all the tasks in the queue. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2beta2::HttpMethod] + # The HTTP method to use for the request. + # + # When specified, it overrides + # {::Google::Cloud::Tasks::V2beta2::HttpTarget#http_method HttpRequest} for the + # task. Note that if the value is set to [HttpMethod][GET] the + # [HttpRequest][body] of the task will be ignored at execution time. + # @!attribute [rw] header_overrides + # @return [::Array<::Google::Cloud::Tasks::V2beta2::HttpTarget::HeaderOverride>] + # HTTP target headers. + # + # This map contains the header field names and values. + # Headers will be set when running the + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created} and/or + # [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. + # + # These headers represent a subset of the headers that will accompany the + # task's HTTP request. Some HTTP request headers will be ignored or replaced. + # + # A partial list of headers that will be ignored or replaced is: + # * Any header that is prefixed with "X-CloudTasks-" will be treated + # as service header. Service headers define properties of the task and are + # predefined in CloudTask. + # * Host: This will be computed by Cloud Tasks and derived from + # {::Google::Cloud::Tasks::V2beta2::HttpRequest#url HttpRequest.url}. + # * Content-Length: This will be computed by Cloud Tasks. + # * User-Agent: This will be set to `"Google-CloudTasks"`. + # * `X-Google-*`: Google use only. + # * `X-AppEngine-*`: Google use only. + # + # `Content-Type` won't be set by Cloud Tasks. You can explicitly set + # `Content-Type` to a media type when the + # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. + # For example, `Content-Type` can be set to `"application/octet-stream"` or + # `"application/json"`. + # + # Headers which can have multiple values (according to RFC2616) can be + # specified using comma-separated values. + # + # The size of the headers must be less than 80KB. + # Queue-level headers to override headers of all the tasks in the queue. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Tasks::V2beta2::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as an `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # + # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Tasks::V2beta2::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # + # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines a header message. A header can have a key and a value. + # @!attribute [rw] key + # @return [::String] + # The key of the header. + # @!attribute [rw] value + # @return [::String] + # The value of the header. + class Header + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wraps the Header object. + # @!attribute [rw] header + # @return [::Google::Cloud::Tasks::V2beta2::HttpTarget::Header] + # header embodying a key and a value. + class HeaderOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains information needed for generating an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). + # This type of authorization should generally only be used when calling Google + # APIs hosted on *.googleapis.com. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OAuth token. + # The service account must be within the same project as the queue. The + # caller must have iam.serviceAccounts.actAs permission for the service + # account. + # @!attribute [rw] scope + # @return [::String] + # OAuth scope to be used for generating OAuth access token. + # If not specified, "https://www.googleapis.com/auth/cloud-platform" + # will be used. + class OAuthToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OpenID Connect + # token](https://developers.google.com/identity/protocols/OpenIDConnect). + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OIDC token. + # The service account must be within the same project as the queue. The + # caller must have iam.serviceAccounts.actAs permission for the service + # account. + # @!attribute [rw] audience + # @return [::String] + # Audience to be used when generating OIDC token. If not specified, the URI + # specified in target will be used. + class OidcToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The HTTP method used to execute the task. + module HttpMethod + # HTTP method unspecified + HTTP_METHOD_UNSPECIFIED = 0 + + # HTTP POST + POST = 1 + + # HTTP GET + GET = 2 + + # HTTP HEAD + HEAD = 3 + + # HTTP PUT + PUT = 4 + + # HTTP DELETE + DELETE = 5 + + # HTTP PATCH + PATCH = 6 + + # HTTP OPTIONS + OPTIONS = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb new file mode 100644 index 000000000000..aae0f9e8995f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta2 + # A unit of scheduled work. + # @!attribute [rw] name + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask}. + # + # The task name. + # + # The task name must have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the task's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + # hyphens (-). The maximum length is 100 characters. + # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), or underscores (_). The maximum length is 500 characters. + # @!attribute [rw] app_engine_http_request + # @return [::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest] + # App Engine HTTP request that is sent to the task's target. Can + # be set only if + # {::Google::Cloud::Tasks::V2beta2::Queue#app_engine_http_target app_engine_http_target} + # is set on the queue. + # + # An App Engine task is a task that has + # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} + # set. + # + # Note: The following fields are mutually exclusive: `app_engine_http_request`, `pull_message`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] pull_message + # @return [::Google::Cloud::Tasks::V2beta2::PullMessage] + # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} to process + # the task. Can be set only if + # {::Google::Cloud::Tasks::V2beta2::Queue#pull_target pull_target} is set on the + # queue. + # + # A pull task is a task that has + # {::Google::Cloud::Tasks::V2beta2::PullMessage PullMessage} set. + # + # Note: The following fields are mutually exclusive: `pull_message`, `app_engine_http_request`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] http_request + # @return [::Google::Cloud::Tasks::V2beta2::HttpRequest] + # HTTP request that is sent to the task's target. + # + # An HTTP task is a task that has + # {::Google::Cloud::Tasks::V2beta2::HttpRequest HttpRequest} set. + # + # Note: The following fields are mutually exclusive: `http_request`, `app_engine_http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # The time when the task is scheduled to be attempted. + # + # For App Engine queues, this is when the task will be attempted or retried. + # + # For pull queues, this is the time when the task is available to + # be leased; if a task is currently leased, this is the time when + # the current lease expires, that is, the time that the task was + # leased plus the + # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration}. + # + # `schedule_time` will be truncated to the nearest microsecond. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the task was created. + # + # `create_time` will be truncated to the nearest second. + # @!attribute [rw] status + # @return [::Google::Cloud::Tasks::V2beta2::TaskStatus] + # Output only. The task status. + # @!attribute [rw] view + # @return [::Google::Cloud::Tasks::V2beta2::Task::View] + # Output only. The view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta2::Task Task} has been returned. + class Task + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The view specifies a subset of {::Google::Cloud::Tasks::V2beta2::Task Task} + # data. + # + # When a task is returned in a response, not all + # information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + module View + # Unspecified. Defaults to BASIC. + VIEW_UNSPECIFIED = 0 + + # The basic view omits fields which can be large or can contain + # sensitive data. + # + # This view does not include the + # ([payload in + # AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] + # and [payload in + # PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These + # payloads are desirable to return only when needed, because they can be + # large and because of the sensitivity of the data that you choose to store + # in it. + BASIC = 1 + + # All information is returned. + # + # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta2::Queue Queue} resource. + FULL = 2 + end + end + + # Status of the task. + # @!attribute [rw] attempt_dispatch_count + # @return [::Integer] + # Output only. The number of attempts dispatched. + # + # This count includes attempts which have been dispatched but haven't + # received a response. + # @!attribute [rw] attempt_response_count + # @return [::Integer] + # Output only. The number of attempts which have received a response. + # + # This field is not calculated for [pull + # tasks][google.cloud.tasks.v2beta2.PullMessage]. + # @!attribute [rw] first_attempt_status + # @return [::Google::Cloud::Tasks::V2beta2::AttemptStatus] + # Output only. The status of the task's first attempt. + # + # Only + # {::Google::Cloud::Tasks::V2beta2::AttemptStatus#dispatch_time dispatch_time} + # will be set. The other + # {::Google::Cloud::Tasks::V2beta2::AttemptStatus AttemptStatus} information is + # not retained by Cloud Tasks. + # + # This field is not calculated for [pull + # tasks][google.cloud.tasks.v2beta2.PullMessage]. + # @!attribute [rw] last_attempt_status + # @return [::Google::Cloud::Tasks::V2beta2::AttemptStatus] + # Output only. The status of the task's last attempt. + # + # This field is not calculated for [pull + # tasks][google.cloud.tasks.v2beta2.PullMessage]. + class TaskStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The status of a task attempt. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt was scheduled. + # + # `schedule_time` will be truncated to the nearest microsecond. + # @!attribute [rw] dispatch_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt was dispatched. + # + # `dispatch_time` will be truncated to the nearest microsecond. + # @!attribute [rw] response_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt response was received. + # + # `response_time` will be truncated to the nearest microsecond. + # @!attribute [rw] response_status + # @return [::Google::Rpc::Status] + # Output only. The response from the target for this attempt. + # + # If the task has not been attempted or the task is currently running + # then the response status is unset. + class AttemptStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/snippets/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile new file mode 100644 index 000000000000..3e8ffddf5b75 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2", path: "../" +else + gem "google-cloud-tasks-v2beta2" +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-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb new file mode 100644 index 000000000000..b6dc7e27d406 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the acknowledge_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#acknowledge_task. +# +def acknowledge_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new + + # Call the acknowledge_task method. + result = client.acknowledge_task request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb new file mode 100644 index 000000000000..d14830cb0974 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the cancel_lease call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#cancel_lease. +# +def cancel_lease + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new + + # Call the cancel_lease method. + result = client.cancel_lease request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb new file mode 100644 index 000000000000..9c97427bd607 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the create_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#create_queue. +# +def create_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new + + # Call the create_queue method. + result = client.create_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb new file mode 100644 index 000000000000..e0bf7a6bb378 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the create_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#create_task. +# +def create_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new + + # Call the create_task method. + result = client.create_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb new file mode 100644 index 000000000000..b5a51bf66325 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the delete_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#delete_queue. +# +def delete_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new + + # Call the delete_queue method. + result = client.delete_queue request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb new file mode 100644 index 000000000000..e140f2dd5bed --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the delete_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#delete_task. +# +def delete_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new + + # Call the delete_task method. + result = client.delete_task request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb new file mode 100644 index 000000000000..1c993e8e0b61 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the get_iam_policy call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb new file mode 100644 index 000000000000..5ec8ef1c332d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the get_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#get_queue. +# +def get_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new + + # Call the get_queue method. + result = client.get_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb new file mode 100644 index 000000000000..a4511bfe5be7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the get_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#get_task. +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new + + # Call the get_task method. + result = client.get_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb new file mode 100644 index 000000000000..20aec0526b69 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the lease_tasks call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#lease_tasks. +# +def lease_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new + + # Call the lease_tasks method. + result = client.lease_tasks request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb new file mode 100644 index 000000000000..0338b25067c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the list_queues call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#list_queues. +# +def list_queues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new + + # Call the list_queues method. + result = client.list_queues 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::Tasks::V2beta2::Queue. + p item + end +end +# [END cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb new file mode 100644 index 000000000000..a88f6c92ccec --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the list_tasks call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#list_tasks. +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new + + # Call the list_tasks method. + result = client.list_tasks 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::Tasks::V2beta2::Task. + p item + end +end +# [END cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb new file mode 100644 index 000000000000..f37d59216de0 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the pause_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#pause_queue. +# +def pause_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new + + # Call the pause_queue method. + result = client.pause_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb new file mode 100644 index 000000000000..8e55f1adbd2b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the purge_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#purge_queue. +# +def purge_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new + + # Call the purge_queue method. + result = client.purge_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb new file mode 100644 index 000000000000..c73fde9eddb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the renew_lease call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#renew_lease. +# +def renew_lease + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new + + # Call the renew_lease method. + result = client.renew_lease request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb new file mode 100644 index 000000000000..d2636e095fa1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the resume_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#resume_queue. +# +def resume_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new + + # Call the resume_queue method. + result = client.resume_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb new file mode 100644 index 000000000000..e68873afd93c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the run_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#run_task. +# +def run_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new + + # Call the run_task method. + result = client.run_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb new file mode 100644 index 000000000000..9ceb07ceada7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the set_iam_policy call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb new file mode 100644 index 000000000000..eb20412a5689 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the test_iam_permissions call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb new file mode 100644 index 000000000000..1811e14dc6e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the update_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#update_queue. +# +def update_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new + + # Call the update_queue method. + result = client.update_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb new file mode 100644 index 000000000000..affb52517a64 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync] +require "google/cloud/tasks/v2beta2" + +## +# Snippet for the upload_queue_yaml call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml. +# +def upload_queue_yaml + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new + + # Call the upload_queue_yaml method. + result = client.upload_queue_yaml request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json new file mode 100644 index 000000000000..cc2f4452567f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json @@ -0,0 +1,855 @@ +{ + "client_library": { + "name": "google-cloud-tasks-v2beta2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.tasks.v2beta2", + "version": "v2beta2" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync", + "title": "Snippet for the list_queues call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues.", + "file": "cloud_tasks/list_queues.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_queues", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::ListQueuesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::ListQueuesResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "ListQueues", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.ListQueues", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync", + "title": "Snippet for the get_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue.", + "file": "cloud_tasks/get_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_queue", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::GetQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "GetQueue", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.GetQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync", + "title": "Snippet for the create_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue.", + "file": "cloud_tasks/create_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_queue", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::CreateQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "CreateQueue", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.CreateQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync", + "title": "Snippet for the update_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue.", + "file": "cloud_tasks/update_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_queue", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "UpdateQueue", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync", + "title": "Snippet for the delete_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue.", + "file": "cloud_tasks/delete_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_queue", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "DeleteQueue", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync", + "title": "Snippet for the purge_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue.", + "file": "cloud_tasks/purge_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_queue", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "PurgeQueue", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync", + "title": "Snippet for the pause_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue.", + "file": "cloud_tasks/pause_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_queue", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::PauseQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "PauseQueue", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.PauseQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync", + "title": "Snippet for the resume_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue.", + "file": "cloud_tasks/resume_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_queue", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "ResumeQueue", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync", + "title": "Snippet for the upload_queue_yaml call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml.", + "file": "cloud_tasks/upload_queue_yaml.rb", + "language": "RUBY", + "client_method": { + "short_name": "upload_queue_yaml", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "UploadQueueYaml", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.UploadQueueYaml", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_iam_policy.", + "file": "cloud_tasks/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicy", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#set_iam_policy.", + "file": "cloud_tasks/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicy", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#test_iam_permissions.", + "file": "cloud_tasks/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissions", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync", + "title": "Snippet for the list_tasks call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks.", + "file": "cloud_tasks/list_tasks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tasks", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::ListTasksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::ListTasksResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "ListTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.ListTasks", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync", + "title": "Snippet for the get_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task.", + "file": "cloud_tasks/get_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_task", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::GetTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "GetTask", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.GetTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync", + "title": "Snippet for the create_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task.", + "file": "cloud_tasks/create_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_task", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::CreateTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "CreateTask", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.CreateTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync", + "title": "Snippet for the delete_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task.", + "file": "cloud_tasks/delete_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_task", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "DeleteTask", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.DeleteTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync", + "title": "Snippet for the lease_tasks call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks.", + "file": "cloud_tasks/lease_tasks.rb", + "language": "RUBY", + "client_method": { + "short_name": "lease_tasks", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "LeaseTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync", + "title": "Snippet for the acknowledge_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task.", + "file": "cloud_tasks/acknowledge_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "acknowledge_task", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "AcknowledgeTask", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync", + "title": "Snippet for the renew_lease call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease.", + "file": "cloud_tasks/renew_lease.rb", + "language": "RUBY", + "client_method": { + "short_name": "renew_lease", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "RenewLease", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.RenewLease", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync", + "title": "Snippet for the cancel_lease call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease.", + "file": "cloud_tasks/cancel_lease.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_lease", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "CancelLease", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.CancelLease", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync", + "title": "Snippet for the run_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task.", + "file": "cloud_tasks/run_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_task", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta2::RunTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta2::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" + }, + "method": { + "short_name": "RunTask", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks.RunTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta2.CloudTasks" + } + } + }, + "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-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb new file mode 100644 index 000000000000..898df1868940 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloud_tasks" + +class ::Google::Cloud::Tasks::V2beta2::CloudTasks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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::Tasks::V2beta2::CloudTasks::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_queue_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.queue_path project: "value0", location: "value1", queue: "value2" + assert_equal "projects/value0/locations/value1/queues/value2", path + end + end + + def test_task_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.task_path project: "value0", location: "value1", queue: "value2", task: "value3" + assert_equal "projects/value0/locations/value1/queues/value2/tasks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb new file mode 100644 index 000000000000..adc077978678 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb @@ -0,0 +1,1207 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" +require "google/cloud/tasks/v2beta2/cloud_tasks/rest" + + +class ::Google::Cloud::Tasks::V2beta2::CloudTasks::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_queues + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + read_mask = {} + + list_queues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_list_queues_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_queues_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_queues ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_queues(::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_queues_client_stub.call_count + end + end + end + + def test_get_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + read_mask = {} + + get_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_get_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_queue({ name: name, read_mask: read_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_queue name: name, read_mask: read_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_queue ::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_queue({ name: name, read_mask: read_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_queue(::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_queue_client_stub.call_count + end + end + end + + def test_create_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + queue = {} + + create_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_create_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_queue({ parent: parent, queue: queue }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_queue parent: parent, queue: queue do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_queue ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_queue({ parent: parent, queue: queue }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_queue(::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_queue_client_stub.call_count + end + end + end + + def test_update_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + queue = {} + update_mask = {} + + update_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_update_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_queue({ queue: queue, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_queue queue: queue, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_queue ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_queue({ queue: queue, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_queue(::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_queue_client_stub.call_count + end + end + end + + def test_delete_queue + # 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_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_queue ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_queue(::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_queue_client_stub.call_count + end + end + end + + def test_purge_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + purge_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_purge_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_queue ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_queue(::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_queue_client_stub.call_count + end + end + end + + def test_pause_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_pause_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_queue ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_queue(::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_queue_client_stub.call_count + end + end + end + + def test_resume_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_resume_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_queue ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_queue(::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_queue_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_list_tasks + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + response_view = :VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tasks({ parent: parent, response_view: response_view, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tasks parent: parent, response_view: response_view, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tasks ::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_count + end + end + end + + def test_get_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + response_view = :VIEW_UNSPECIFIED + + get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_task({ name: name, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_task name: name, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_task ::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_task({ name: name, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_count + end + end + end + + def test_create_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + task = {} + response_view = :VIEW_UNSPECIFIED + + create_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_create_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_task({ parent: parent, task: task, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_task parent: parent, task: task, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_task ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_task({ parent: parent, task: task, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_task(::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_task_client_stub.call_count + end + end + end + + def test_delete_task + # 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_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_task({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_task name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_task ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_task({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_task(::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_task_client_stub.call_count + end + end + end + + def test_lease_tasks + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + max_tasks = 42 + lease_duration = {} + response_view = :VIEW_UNSPECIFIED + filter = "hello world" + + lease_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_lease_tasks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, lease_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.lease_tasks parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.lease_tasks ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.lease_tasks(::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, lease_tasks_client_stub.call_count + end + end + end + + def test_acknowledge_task + # 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" + schedule_time = {} + + acknowledge_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_acknowledge_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, acknowledge_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.acknowledge_task({ name: name, schedule_time: schedule_time }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.acknowledge_task name: name, schedule_time: schedule_time do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.acknowledge_task ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.acknowledge_task({ name: name, schedule_time: schedule_time }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.acknowledge_task(::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, acknowledge_task_client_stub.call_count + end + end + end + + def test_renew_lease + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + schedule_time = {} + lease_duration = {} + response_view = :VIEW_UNSPECIFIED + + renew_lease_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_renew_lease_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, renew_lease_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.renew_lease name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.renew_lease ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.renew_lease(::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, renew_lease_client_stub.call_count + end + end + end + + def test_cancel_lease + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + schedule_time = {} + response_view = :VIEW_UNSPECIFIED + + cancel_lease_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_cancel_lease_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_lease_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_lease name: name, schedule_time: schedule_time, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_lease ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.cancel_lease(::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, cancel_lease_client_stub.call_count + end + end + end + + def test_run_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta2::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + response_view = :VIEW_UNSPECIFIED + + run_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_run_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_task({ name: name, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_task name: name, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_task ::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_task({ name: name, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_task(::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_task_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::Tasks::V2beta2::CloudTasks::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::Tasks::V2beta2::CloudTasks::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb new file mode 100644 index 000000000000..e8e1832596d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb @@ -0,0 +1,1391 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" +require "google/cloud/tasks/v2beta2/cloud_tasks" + +class ::Google::Cloud::Tasks::V2beta2::CloudTasks::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_queues + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + read_mask = {} + + list_queues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_queues, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_queues_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) 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_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask 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_queues ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) 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_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, 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_queues(::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), 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_queues_client_stub.call_rpc_count + end + end + + def test_get_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" + read_mask = {} + + get_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::GetQueueRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_queue({ name: name, read_mask: read_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_queue name: name, read_mask: read_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_queue ::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_queue({ name: name, read_mask: read_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_queue(::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_queue_client_stub.call_rpc_count + end + end + + def test_create_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" + queue = {} + + create_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta2::Queue), request["queue"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_queue({ parent: parent, queue: queue }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_queue parent: parent, queue: queue do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_queue ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_queue({ parent: parent, queue: queue }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_queue(::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_queue_client_stub.call_rpc_count + end + end + + def test_update_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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. + queue = {} + update_mask = {} + + update_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta2::Queue), request["queue"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_queue({ queue: queue, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_queue queue: queue, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_queue ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, 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_queue({ queue: queue, 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_queue(::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, 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_queue_client_stub.call_rpc_count + end + end + + def test_delete_queue + # 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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_queue ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_queue({ 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_queue(::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.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_queue_client_stub.call_rpc_count + end + end + + def test_purge_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" + + purge_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_queue ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_queue(::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.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, purge_queue_client_stub.call_rpc_count + end + end + + def test_pause_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" + + pause_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_queue ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pause_queue(::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.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, pause_queue_client_stub.call_rpc_count + end + end + + def test_resume_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" + + resume_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_queue ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resume_queue(::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.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, resume_queue_client_stub.call_rpc_count + end + end + + def test_upload_queue_yaml + # 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. + app_id = "hello world" + http_body = {} + + upload_queue_yaml_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upload_queue_yaml, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest, request + assert_equal "hello world", request["app_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::HttpBody), request["http_body"] + assert request.has_http_body? + refute_nil options + end + + Gapic::ServiceStub.stub :new, upload_queue_yaml_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upload_queue_yaml({ app_id: app_id, http_body: http_body }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.upload_queue_yaml app_id: app_id, http_body: http_body do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.upload_queue_yaml ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new(app_id: app_id, http_body: http_body) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.upload_queue_yaml({ app_id: app_id, http_body: http_body }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.upload_queue_yaml(::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new(app_id: app_id, http_body: http_body), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, upload_queue_yaml_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_list_tasks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.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" + response_view = :VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tasks, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::ListTasksRequest, request + assert_equal "hello world", request["parent"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tasks({ parent: parent, response_view: response_view, 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_tasks parent: parent, response_view: response_view, 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_tasks ::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_rpc_count + end + end + + def test_get_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" + response_view = :VIEW_UNSPECIFIED + + get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::GetTaskRequest, request + assert_equal "hello world", request["name"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_task({ name: name, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_task name: name, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_task ::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_rpc_count + end + end + + def test_create_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" + task = {} + response_view = :VIEW_UNSPECIFIED + + create_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta2::Task), request["task"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_task({ parent: parent, task: task, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_task parent: parent, task: task, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_task ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_task({ parent: parent, task: task, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_task(::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_task_client_stub.call_rpc_count + end + end + + def test_delete_task + # 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_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_task({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_task name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_task ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_task({ 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_task(::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.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_task_client_stub.call_rpc_count + end + end + + def test_lease_tasks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.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" + max_tasks = 42 + lease_duration = {} + response_view = :VIEW_UNSPECIFIED + filter = "hello world" + + lease_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :lease_tasks, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["max_tasks"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["lease_duration"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, lease_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.lease_tasks parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.lease_tasks ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.lease_tasks(::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, lease_tasks_client_stub.call_rpc_count + end + end + + def test_acknowledge_task + # 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" + schedule_time = {} + + acknowledge_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :acknowledge_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, acknowledge_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.acknowledge_task({ name: name, schedule_time: schedule_time }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.acknowledge_task name: name, schedule_time: schedule_time do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.acknowledge_task ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.acknowledge_task({ name: name, schedule_time: schedule_time }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.acknowledge_task(::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, acknowledge_task_client_stub.call_rpc_count + end + end + + def test_renew_lease + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" + schedule_time = {} + lease_duration = {} + response_view = :VIEW_UNSPECIFIED + + renew_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :renew_lease, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["lease_duration"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, renew_lease_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.renew_lease name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.renew_lease ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.renew_lease(::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, renew_lease_client_stub.call_rpc_count + end + end + + def test_cancel_lease + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" + schedule_time = {} + response_view = :VIEW_UNSPECIFIED + + cancel_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_lease, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_lease_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_lease name: name, schedule_time: schedule_time, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_lease ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_lease(::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_lease_client_stub.call_rpc_count + end + end + + def test_run_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" + response_view = :VIEW_UNSPECIFIED + + run_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta2::RunTaskRequest, request + assert_equal "hello world", request["name"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_task({ name: name, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_task name: name, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_task ::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_task(::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_task_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::Tasks::V2beta2::CloudTasks::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::Tasks::V2beta2::CloudTasks::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/.gitignore b/owl-bot-staging/google-cloud-tasks-v2beta3/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/.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-tasks-v2beta3/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta3/.repo-metadata.json new file mode 100644 index 000000000000..1acb6f32f0fe --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudtasks.googleapis.com", + "api_shortname": "cloudtasks", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta3/latest", + "distribution_name": "google-cloud-tasks-v2beta3", + "is_cloud": true, + "language": "ruby", + "name": "cloudtasks", + "name_pretty": "Cloud Tasks V2beta3 API", + "product_documentation": "https://cloud.google.com/tasks", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TASKS", + "ruby-cloud-product-url": "https://cloud.google.com/tasks", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml b/owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml new file mode 100644 index 000000000000..da9d8f7ee985 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-tasks-v2beta3.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-tasks-v2beta3.rb" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/.yardopts b/owl-bot-staging/google-cloud-tasks-v2beta3/.yardopts new file mode 100644 index 000000000000..07f7a83a5822 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Tasks V2beta3 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-tasks-v2beta3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks-v2beta3/AUTHENTICATION.md new file mode 100644 index 000000000000..8a26642ba1e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-tasks-v2beta3 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-tasks-v2beta3 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/tasks/v2beta3" + +client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/tasks/v2beta3" + +::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::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-tasks-v2beta3 +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/tasks/v2beta3" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::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-tasks-v2beta3/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks-v2beta3/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-tasks-v2beta3/LICENSE.md b/owl-bot-staging/google-cloud-tasks-v2beta3/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/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-tasks-v2beta3/README.md b/owl-bot-staging/google-cloud-tasks-v2beta3/README.md new file mode 100644 index 000000000000..410125fde32f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Tasks V2beta3 API + +Manages the execution of large numbers of distributed requests. + +Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. + +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 Tasks V2beta3 API. Most users should consider using +the main client gem, +[google-cloud-tasks](https://rubygems.org/gems/google-cloud-tasks). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-tasks-v2beta3 +``` + +## 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/cloudtasks.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/tasks/v2beta3" + +client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +request = ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new # (request fields as keyword arguments...) +response = client.list_queues request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta3/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/tasks) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/tasks/v2beta3" +require "logger" + +client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-tasks`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-tasks-v2beta3`. +_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-tasks`. +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-tasks-v2beta3`. + +### 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-tasks-v2beta3/Rakefile b/owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile new file mode 100644 index 000000000000..9d14c39d473d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TASKS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TASKS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/tasks/v2beta3/cloud_tasks/credentials" + ::Google::Cloud::Tasks::V2beta3::CloudTasks::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TASKS_PROJECT"] = project + ENV["TASKS_TEST_PROJECT"] = project + ENV["TASKS_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-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-tasks-v2beta3" + header "google-cloud-tasks-v2beta3 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-tasks-v2beta3 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json new file mode 100644 index 000000000000..d31c26024e7f --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.tasks.v2beta3", + "libraryPackage": "::Google::Cloud::Tasks::V2beta3", + "services": { + "CloudTasks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client", + "rpcs": { + "ListQueues": { + "methods": [ + "list_queues" + ] + }, + "GetQueue": { + "methods": [ + "get_queue" + ] + }, + "CreateQueue": { + "methods": [ + "create_queue" + ] + }, + "UpdateQueue": { + "methods": [ + "update_queue" + ] + }, + "DeleteQueue": { + "methods": [ + "delete_queue" + ] + }, + "PurgeQueue": { + "methods": [ + "purge_queue" + ] + }, + "PauseQueue": { + "methods": [ + "pause_queue" + ] + }, + "ResumeQueue": { + "methods": [ + "resume_queue" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "ListTasks": { + "methods": [ + "list_tasks" + ] + }, + "GetTask": { + "methods": [ + "get_task" + ] + }, + "CreateTask": { + "methods": [ + "create_task" + ] + }, + "DeleteTask": { + "methods": [ + "delete_task" + ] + }, + "RunTask": { + "methods": [ + "run_task" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec b/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec new file mode 100644 index 000000000000..b069a59eb484 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/tasks/v2beta3/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-tasks-v2beta3" + gem.version = Google::Cloud::Tasks::V2beta3::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details." + gem.summary = "Manages the execution of large numbers of distributed requests." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb new file mode 100644 index 000000000000..dbe62c531a09 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb new file mode 100644 index 000000000000..4a4e1bf079bd --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloud_tasks" +require "google/cloud/tasks/v2beta3/version" + +module Google + module Cloud + module Tasks + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/tasks/v2beta3" + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/tasks/v2beta3" + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + module V2beta3 + end + end + end +end + +helper_path = ::File.join __dir__, "v2beta3", "_helpers.rb" +require "google/cloud/tasks/v2beta3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb new file mode 100644 index 000000000000..52093b505354 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" + +module Google + module Cloud + module Tasks + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/tasks/v2beta3/rest" + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + module V2beta3 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Tasks"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2beta3/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb new file mode 100644 index 000000000000..ab36034a01a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/version" + +require "google/cloud/tasks/v2beta3/cloud_tasks/credentials" +require "google/cloud/tasks/v2beta3/cloud_tasks/paths" +require "google/cloud/tasks/v2beta3/cloud_tasks/client" +require "google/cloud/tasks/v2beta3/cloud_tasks/rest" + +module Google + module Cloud + module Tasks + module V2beta3 + ## + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/tasks/v2beta3/cloud_tasks" + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/tasks/v2beta3/cloud_tasks/rest" + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + module CloudTasks + end + end + end + end +end + +helper_path = ::File.join __dir__, "cloud_tasks", "helpers.rb" +require "google/cloud/tasks/v2beta3/cloud_tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb new file mode 100644 index 000000000000..87441ecbb60b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb @@ -0,0 +1,2277 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" +require "google/cloud/location" + +module Google + module Cloud + module Tasks + module V2beta3 + module CloudTasks + ## + # Client for the CloudTasks service. + # + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_tasks_stub + + ## + # Configure the CloudTasks Client class. + # + # See {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudTasks clients + # ::Google::Cloud::Tasks::V2beta3::CloudTasks::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", "Tasks", "V2beta3"] + 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.list_queues.timeout = 20.0 + default_config.rpcs.list_queues.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_queue.timeout = 20.0 + default_config.rpcs.get_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_queue.timeout = 20.0 + + default_config.rpcs.update_queue.timeout = 20.0 + + default_config.rpcs.delete_queue.timeout = 20.0 + default_config.rpcs.delete_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.purge_queue.timeout = 20.0 + + default_config.rpcs.pause_queue.timeout = 20.0 + + default_config.rpcs.resume_queue.timeout = 20.0 + + default_config.rpcs.get_iam_policy.timeout = 20.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.set_iam_policy.timeout = 20.0 + + default_config.rpcs.test_iam_permissions.timeout = 20.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tasks.timeout = 20.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_task.timeout = 20.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_task.timeout = 20.0 + + default_config.rpcs.delete_task.timeout = 20.0 + default_config.rpcs.delete_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_task.timeout = 20.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudTasks 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::Tasks::V2beta3::CloudTasks::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 + @cloud_tasks_stub.universe_domain + end + + ## + # Create a new CloudTasks client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudTasks 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/tasks/v2beta3/cloudtasks_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 + + @cloud_tasks_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Tasks::V2beta3::CloudTasks::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, + logger: @config.logger + ) + + @cloud_tasks_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_tasks_stub.logger + end + + # Service calls + + ## + # Lists queues. + # + # Queues are returned in lexicographical order. + # + # @overload list_queues(request, options = nil) + # Pass arguments to `list_queues` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_queues` via keyword arguments. Note that at + # least one keyword argument is 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 location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @param filter [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "state: PAUSED". + # + # Note that using filters might cause fewer queues than the + # requested page_size to be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} method. It + # is an error to switch the value of the + # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while + # iterating through pages. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new + # + # # Call the list_queues method. + # result = client.list_queues 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::Tasks::V2beta3::Queue. + # p item + # end + # + def list_queues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest + + # Converts hash 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_queues.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::Tasks::V2beta3::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_queues.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_queues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a queue. + # + # @overload get_queue(request, options = nil) + # Pass arguments to `get_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::GetQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::GetQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) + # Pass arguments to `get_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new + # + # # Call the get_queue method. + # result = client.get_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def get_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload create_queue(request, options = nil) + # Pass arguments to `create_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::CreateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) + # Pass arguments to `create_queue` via keyword arguments. Note that at + # least one keyword argument is 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 location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + # an existing queue. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new + # + # # Call the create_queue method. + # result = client.create_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def create_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload update_queue(request, options = nil) + # Pass arguments to `update_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) + # Pass arguments to `update_queue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be + # specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be + # changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new + # + # # Call the update_queue method. + # result = client.update_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def update_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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.queue&.name + header_params["queue.name"] = request.queue.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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload delete_queue(request, options = nil) + # Pass arguments to `delete_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `delete_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new + # + # # Call the delete_queue method. + # result = client.delete_queue request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + # + # @overload purge_queue(request, options = nil) + # Pass arguments to `purge_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_queue(name: nil) + # Pass arguments to `purge_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new + # + # # Call the purge_queue method. + # result = client.purge_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def purge_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest + + # Converts hash 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.purge_queue.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::Tasks::V2beta3::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.purge_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can + # still be added when the queue is paused. A queue is paused if its + # {::Google::Cloud::Tasks::V2beta3::Queue#state state} is + # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. + # + # @overload pause_queue(request, options = nil) + # Pass arguments to `pause_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::PauseQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_queue(name: nil) + # Pass arguments to `pause_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new + # + # # Call the pause_queue method. + # result = client.pause_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def pause_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest + + # Converts hash 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.pause_queue.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::Tasks::V2beta3::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.pause_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a queue. + # + # This method resumes a queue after it has been + # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED} or + # {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a + # queue is stored in the queue's + # {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method + # it will be set to + # {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + # + # @overload resume_queue(request, options = nil) + # Pass arguments to `resume_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_queue(name: nil) + # Pass arguments to `resume_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new + # + # # Call the resume_queue method. + # result = client.resume_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def resume_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest + + # Converts hash 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.resume_queue.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::Tasks::V2beta3::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.resume_queue.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a + # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Returns an empty policy if the + # resource exists and does not have a policy set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_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::Tasks::V2beta3::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.resource + header_params["resource"] = request.resource + 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_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy for a + # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_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::Tasks::V2beta3::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.resource + header_params["resource"] = request.resource + 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.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on a + # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. If the resource does not exist, + # this will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Tasks::V2beta3::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.resource + header_params["resource"] = request.resource + 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.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the tasks in a queue. + # + # By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC} + # view is retrieved due to performance considerations; + # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view} + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # @param page_size [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks 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::Tasks::V2beta3::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListTasksRequest + + # Converts hash 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_tasks.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::Tasks::V2beta3::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_tasks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * The maximum task size is 100KB. + # + # @overload create_task(request, options = nil) + # Pass arguments to `create_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::CreateTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) + # Pass arguments to `create_task` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task [::Google::Cloud::Tasks::V2beta3::Task, ::Hash] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified + # then the system will generate a random unique task id, which will be set in + # the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not + # set or is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or executed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1 hour after the original task was + # deleted or executed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9 days after the original task was deleted or executed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new + # + # # Call the create_task method. + # result = client.create_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + # p result + # + def create_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has executed successfully or permanently + # failed. + # + # @overload delete_task(request, options = nil) + # Pass arguments to `delete_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil) + # Pass arguments to `delete_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new + # + # # Call the delete_task method. + # result = client.delete_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or is + # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. + # + # This command is meant to be used for manual debugging. For + # example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} can be + # used to retry a failed task after a fix has been made or to manually force + # a task to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the [status][Task.status] after the task is dispatched but + # before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be + # reset to the time that + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} was called plus + # the retry delay specified in the queue's + # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}. + # + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + # + # @overload run_task(request, options = nil) + # Pass arguments to `run_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::RunTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::RunTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_task(name: nil, response_view: nil) + # Pass arguments to `run_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new + # + # # Call the run_task method. + # result = client.run_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + # p result + # + def run_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::RunTaskRequest + + # Converts hash 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.run_task.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::Tasks::V2beta3::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.run_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudTasks API. + # + # This class represents the configuration for CloudTasks, + # 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::Tasks::V2beta3::CloudTasks::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_queues to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CloudTasks 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_queues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_queues + ## + # RPC-specific configuration for `get_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_queue + ## + # RPC-specific configuration for `create_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_queue + ## + # RPC-specific configuration for `update_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_queue + ## + # RPC-specific configuration for `delete_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_queue + ## + # RPC-specific configuration for `purge_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_queue + ## + # RPC-specific configuration for `pause_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_queue + ## + # RPC-specific configuration for `resume_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_queue + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `create_task` + # @return [::Gapic::Config::Method] + # + attr_reader :create_task + ## + # RPC-specific configuration for `delete_task` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_task + ## + # RPC-specific configuration for `run_task` + # @return [::Gapic::Config::Method] + # + attr_reader :run_task + + # @private + def initialize parent_rpcs = nil + list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues + @list_queues = ::Gapic::Config::Method.new list_queues_config + get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue + @get_queue = ::Gapic::Config::Method.new get_queue_config + create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue + @create_queue = ::Gapic::Config::Method.new create_queue_config + update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue + @update_queue = ::Gapic::Config::Method.new update_queue_config + delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue + @delete_queue = ::Gapic::Config::Method.new delete_queue_config + purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue + @purge_queue = ::Gapic::Config::Method.new purge_queue_config + pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue + @pause_queue = ::Gapic::Config::Method.new pause_queue_config + resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue + @resume_queue = ::Gapic::Config::Method.new resume_queue_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task + @create_task = ::Gapic::Config::Method.new create_task_config + delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task + @delete_task = ::Gapic::Config::Method.new delete_task_config + run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task + @run_task = ::Gapic::Config::Method.new run_task_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb new file mode 100644 index 000000000000..3bccd23bae21 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta3 + module CloudTasks + # Credentials for the CloudTasks API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "TASKS_CREDENTIALS", + "TASKS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TASKS_CREDENTIALS_JSON", + "TASKS_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-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb new file mode 100644 index 000000000000..eecb06ef35df --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta3 + module CloudTasks + # Path helper methods for the CloudTasks 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 Queue resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/queues/{queue}` + # + # @param project [String] + # @param location [String] + # @param queue [String] + # + # @return [::String] + def queue_path project:, location:, queue: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/queues/#{queue}" + end + + ## + # Create a fully-qualified Task resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/queues/{queue}/tasks/{task}` + # + # @param project [String] + # @param location [String] + # @param queue [String] + # @param task [String] + # + # @return [::String] + def task_path project:, location:, queue:, task: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "queue cannot contain /" if queue.to_s.include? "/" + + "projects/#{project}/locations/#{location}/queues/#{queue}/tasks/#{task}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb new file mode 100644 index 000000000000..b443ca9c286e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/version" +require "google/cloud/tasks/v2beta3/bindings_override" + +require "google/cloud/tasks/v2beta3/cloud_tasks/credentials" +require "google/cloud/tasks/v2beta3/cloud_tasks/paths" +require "google/cloud/tasks/v2beta3/cloud_tasks/rest/client" + +module Google + module Cloud + module Tasks + module V2beta3 + ## + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/tasks/v2beta3/cloud_tasks/rest" + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + module CloudTasks + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/tasks/v2beta3/cloud_tasks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb new file mode 100644 index 000000000000..0c27095bec5c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb @@ -0,0 +1,2130 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" +require "google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Tasks + module V2beta3 + module CloudTasks + module Rest + ## + # REST client for the CloudTasks service. + # + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cloud_tasks_stub + + ## + # Configure the CloudTasks Client class. + # + # See {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all CloudTasks clients + # ::Google::Cloud::Tasks::V2beta3::CloudTasks::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", "Tasks", "V2beta3"] + 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.list_queues.timeout = 20.0 + default_config.rpcs.list_queues.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_queue.timeout = 20.0 + default_config.rpcs.get_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_queue.timeout = 20.0 + + default_config.rpcs.update_queue.timeout = 20.0 + + default_config.rpcs.delete_queue.timeout = 20.0 + default_config.rpcs.delete_queue.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.purge_queue.timeout = 20.0 + + default_config.rpcs.pause_queue.timeout = 20.0 + + default_config.rpcs.resume_queue.timeout = 20.0 + + default_config.rpcs.get_iam_policy.timeout = 20.0 + default_config.rpcs.get_iam_policy.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.set_iam_policy.timeout = 20.0 + + default_config.rpcs.test_iam_permissions.timeout = 20.0 + default_config.rpcs.test_iam_permissions.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_tasks.timeout = 20.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_task.timeout = 20.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_task.timeout = 20.0 + + default_config.rpcs.delete_task.timeout = 20.0 + default_config.rpcs.delete_task.retry_policy = { + initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.run_task.timeout = 20.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the CloudTasks 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::Tasks::V2beta3::CloudTasks::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 + @cloud_tasks_stub.universe_domain + end + + ## + # Create a new CloudTasks REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the CloudTasks 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 + + @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @cloud_tasks_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cloud_tasks_stub.endpoint + config.universe_domain = @cloud_tasks_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @cloud_tasks_stub.logger + end + + # Service calls + + ## + # Lists queues. + # + # Queues are returned in lexicographical order. + # + # @overload list_queues(request, options = nil) + # Pass arguments to `list_queues` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) + # Pass arguments to `list_queues` via keyword arguments. Note that at + # least one keyword argument is 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 location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @param filter [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "state: PAUSED". + # + # Note that using filters might cause fewer queues than the + # requested page_size to be returned. + # @param page_size [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#list_queues ListQueues} method. It + # is an error to switch the value of the + # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while + # iterating through pages. + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new + # + # # Call the list_queues method. + # result = client.list_queues 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::Tasks::V2beta3::Queue. + # p item + # end + # + def list_queues request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest + + # Converts hash 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_queues.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::Tasks::V2beta3::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_queues.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_queues.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.list_queues request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a queue. + # + # @overload get_queue(request, options = nil) + # Pass arguments to `get_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::GetQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::GetQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) + # Pass arguments to `get_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new + # + # # Call the get_queue method. + # result = client.get_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def get_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload create_queue(request, options = nil) + # Pass arguments to `create_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::CreateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) + # Pass arguments to `create_queue` via keyword arguments. Note that at + # least one keyword argument is 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 location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + # an existing queue. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new + # + # # Call the create_queue method. + # result = client.create_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def create_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.create_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload update_queue(request, options = nil) + # Pass arguments to `update_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) + # Pass arguments to `update_queue` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be + # specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be + # changed. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new + # + # # Call the update_queue method. + # result = client.update_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def update_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.update_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + # + # @overload delete_queue(request, options = nil) + # Pass arguments to `delete_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_queue(name: nil) + # Pass arguments to `delete_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new + # + # # Call the delete_queue method. + # result = client.delete_queue request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest + + # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.delete_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + # + # @overload purge_queue(request, options = nil) + # Pass arguments to `purge_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_queue(name: nil) + # Pass arguments to `purge_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new + # + # # Call the purge_queue method. + # result = client.purge_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def purge_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest + + # Converts hash 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.purge_queue.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::Tasks::V2beta3::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.purge_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.purge_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can + # still be added when the queue is paused. A queue is paused if its + # {::Google::Cloud::Tasks::V2beta3::Queue#state state} is + # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. + # + # @overload pause_queue(request, options = nil) + # Pass arguments to `pause_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::PauseQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_queue(name: nil) + # Pass arguments to `pause_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new + # + # # Call the pause_queue method. + # result = client.pause_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def pause_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest + + # Converts hash 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.pause_queue.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::Tasks::V2beta3::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.pause_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.pause_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resume a queue. + # + # This method resumes a queue after it has been + # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED} or + # {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a + # queue is stored in the queue's + # {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method + # it will be set to + # {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + # + # @overload resume_queue(request, options = nil) + # Pass arguments to `resume_queue` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_queue(name: nil) + # Pass arguments to `resume_queue` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new + # + # # Call the resume_queue method. + # result = client.resume_queue request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + # p result + # + def resume_queue request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest + + # Converts hash 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.resume_queue.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::Tasks::V2beta3::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.resume_queue.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_queue.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.resume_queue request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a + # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Returns an empty policy if the + # resource exists and does not have a policy set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_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::Tasks::V2beta3::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_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy for a + # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_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 resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_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::Tasks::V2beta3::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.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on a + # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. If the resource does not exist, + # this will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Tasks::V2beta3::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.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the tasks in a queue. + # + # By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC} + # view is retrieved due to performance considerations; + # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view} + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # @param page_size [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @param page_token [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks 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::Tasks::V2beta3::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListTasksRequest + + # Converts hash 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_tasks.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::Tasks::V2beta3::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_tasks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.list_tasks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.get_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * The maximum task size is 100KB. + # + # @overload create_task(request, options = nil) + # Pass arguments to `create_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::CreateTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) + # Pass arguments to `create_task` via keyword arguments. Note that at + # least one keyword argument is 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 queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @param task [::Google::Cloud::Tasks::V2beta3::Task, ::Hash] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified + # then the system will generate a random unique task id, which will be set in + # the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not + # set or is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or executed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1 hour after the original task was + # deleted or executed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9 days after the original task was deleted or executed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new + # + # # Call the create_task method. + # result = client.create_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + # p result + # + def create_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.create_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has executed successfully or permanently + # failed. + # + # @overload delete_task(request, options = nil) + # Pass arguments to `delete_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_task(name: nil) + # Pass arguments to `delete_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new + # + # # Call the delete_task method. + # result = client.delete_task request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest + + # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.delete_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or is + # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. + # + # This command is meant to be used for manual debugging. For + # example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} can be + # used to retry a failed task after a fix has been made or to manually force + # a task to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the [status][Task.status] after the task is dispatched but + # before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be + # reset to the time that + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} was called plus + # the retry delay specified in the queue's + # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}. + # + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + # + # @overload run_task(request, options = nil) + # Pass arguments to `run_task` via a request object, either of type + # {::Google::Cloud::Tasks::V2beta3::RunTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tasks::V2beta3::RunTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_task(name: nil, response_view: nil) + # Pass arguments to `run_task` via keyword arguments. Note that at + # least one keyword argument is 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 task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/tasks/v2beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new + # + # # Call the run_task method. + # result = client.run_task request + # + # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + # p result + # + def run_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::RunTaskRequest + + # Converts hash 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.run_task.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::Tasks::V2beta3::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.run_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_tasks_stub.run_task request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the CloudTasks REST API. + # + # This class represents the configuration for CloudTasks 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::Tasks::V2beta3::CloudTasks::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_queues to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_queues.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 CloudTasks 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_queues` + # @return [::Gapic::Config::Method] + # + attr_reader :list_queues + ## + # RPC-specific configuration for `get_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :get_queue + ## + # RPC-specific configuration for `create_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :create_queue + ## + # RPC-specific configuration for `update_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :update_queue + ## + # RPC-specific configuration for `delete_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_queue + ## + # RPC-specific configuration for `purge_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_queue + ## + # RPC-specific configuration for `pause_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_queue + ## + # RPC-specific configuration for `resume_queue` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_queue + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `create_task` + # @return [::Gapic::Config::Method] + # + attr_reader :create_task + ## + # RPC-specific configuration for `delete_task` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_task + ## + # RPC-specific configuration for `run_task` + # @return [::Gapic::Config::Method] + # + attr_reader :run_task + + # @private + def initialize parent_rpcs = nil + list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues + @list_queues = ::Gapic::Config::Method.new list_queues_config + get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue + @get_queue = ::Gapic::Config::Method.new get_queue_config + create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue + @create_queue = ::Gapic::Config::Method.new create_queue_config + update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue + @update_queue = ::Gapic::Config::Method.new update_queue_config + delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue + @delete_queue = ::Gapic::Config::Method.new delete_queue_config + purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue + @purge_queue = ::Gapic::Config::Method.new purge_queue_config + pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue + @pause_queue = ::Gapic::Config::Method.new pause_queue_config + resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue + @resume_queue = ::Gapic::Config::Method.new resume_queue_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task + @create_task = ::Gapic::Config::Method.new create_task_config + delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task + @delete_task = ::Gapic::Config::Method.new delete_task_config + run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task + @run_task = ::Gapic::Config::Method.new run_task_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb new file mode 100644 index 000000000000..769a0336a270 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb @@ -0,0 +1,1067 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" + +module Google + module Cloud + module Tasks + module V2beta3 + module CloudTasks + module Rest + ## + # REST service stub for the CloudTasks service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_queues REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest] + # 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::Tasks::V2beta3::ListQueuesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::ListQueuesResponse] + # A result object deserialized from the server's reply + def list_queues request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_queues_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, + method_name: "list_queues", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetQueueRequest] + # 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::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # A result object deserialized from the server's reply + def get_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_queue_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, + method_name: "get_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest] + # 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::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # A result object deserialized from the server's reply + def create_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_queue_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, + method_name: "create_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest] + # 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::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # A result object deserialized from the server's reply + def update_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_queue_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, + method_name: "update_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest] + # 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_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_queue_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, + method_name: "delete_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the purge_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest] + # 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::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # A result object deserialized from the server's reply + def purge_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_queue_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, + method_name: "purge_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the pause_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest] + # 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::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # A result object deserialized from the server's reply + def pause_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_queue_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, + method_name: "pause_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the resume_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest] + # 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::Tasks::V2beta3::Queue] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # A result object deserialized from the server's reply + def resume_queue request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_queue_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, + method_name: "resume_queue", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_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, + method_name: "get_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_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, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # 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::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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, + method_name: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListTasksRequest] + # 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::Tasks::V2beta3::ListTasksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::ListTasksResponse] + # A result object deserialized from the server's reply + def list_tasks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_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, + method_name: "list_tasks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetTaskRequest] + # 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::Tasks::V2beta3::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # A result object deserialized from the server's reply + def get_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_task_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, + method_name: "get_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest] + # 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::Tasks::V2beta3::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # A result object deserialized from the server's reply + def create_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_task_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, + method_name: "create_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest] + # 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_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_task_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, + method_name: "delete_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the run_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::RunTaskRequest] + # 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::Tasks::V2beta3::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # A result object deserialized from the server's reply + def run_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_task_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, + method_name: "run_task", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_queues REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest] + # 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_queues_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta3/{parent}/queues", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{parent}/queues", + body: "queue", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2beta3/{queue.name}", + body: "queue", + matches: [ + ["queue.name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest] + # 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_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{name}:purge", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{name}:pause", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_queue REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_queue_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{name}:resume", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListTasksRequest] + # 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_tasks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta3/{parent}/tasks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{parent}/tasks", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest] + # 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_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2beta3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_task REST call + # + # @param request_pb [::Google::Cloud::Tasks::V2beta3::RunTaskRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2beta3/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb new file mode 100644 index 000000000000..0ee60de3f77c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta3/cloudtasks.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/tasks/v2beta3/queue_pb' +require 'google/cloud/tasks/v2beta3/task_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n+google/cloud/tasks/v2beta3/cloudtasks.proto\x12\x1agoogle.cloud.tasks.v2beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/tasks/v2beta3/queue.proto\x1a%google/cloud/tasks/v2beta3/task.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb7\x01\n\x11ListQueuesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"`\n\x12ListQueuesResponse\x12\x31\n\x06queues\x18\x01 \x03(\x0b\x32!.google.cloud.tasks.v2beta3.Queue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"|\n\x0fGetQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x32\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x84\x01\n\x12\x43reateQueueRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x35\n\x05queue\x18\x02 \x01(\x0b\x32!.google.cloud.tasks.v2beta3.QueueB\x03\xe0\x41\x02\"|\n\x12UpdateQueueRequest\x12\x35\n\x05queue\x18\x01 \x01(\x0b\x32!.google.cloud.tasks.v2beta3.QueueB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PurgeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PauseQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"K\n\x12ResumeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"\xaf\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"]\n\x11ListTasksResponse\x12/\n\x05tasks\x18\x01 \x03(\x0b\x32 .google.cloud.tasks.v2beta3.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x84\x01\n\x0eGetTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\"\xbe\x01\n\x11\x43reateTaskRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x33\n\x04task\x18\x02 \x01(\x0b\x32 .google.cloud.tasks.v2beta3.TaskB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x03 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\"I\n\x11\x44\x65leteTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\"\x84\x01\n\x0eRunTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View2\xa5\x16\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta3.ListQueuesRequest\x1a..google.cloud.tasks.v2beta3.ListQueuesResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{parent=projects/*/locations/*}/queues\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta3.GetQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{name=projects/*/locations/*/queues/*}\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta3.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"M\xda\x41\x0cparent,queue\x82\xd3\xe4\x93\x02\x38\"//v2beta3/{parent=projects/*/locations/*}/queues:\x05queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta3.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"X\xda\x41\x11queue,update_mask\x82\xd3\xe4\x93\x02>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:\x05queue\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta3.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2beta3/{name=projects/*/locations/*/queues/*}\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta3.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:purge:\x01*\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta3.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:pause:\x01*\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta3.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v2beta3/{name=projects/*/locations/*/queues/*}:resume:\x01*\x12\xa1\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"V\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02K\"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta3.ListTasksRequest\x1a-.google.cloud.tasks.v2beta3.ListTasksResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta3.GetTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta3.CreateTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"P\xda\x41\x0bparent,task\x82\xd3\xe4\x93\x02<\"7/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta3.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta3.RunTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\x1aM\xca\x41\x19\x63loudtasks.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x80\x01\n\x1e\x63om.google.cloud.tasks.v2beta3B\x0f\x43loudTasksProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb\xa2\x02\x05TASKSb\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.FieldMask", "google/protobuf/field_mask.proto"], + ["google.cloud.tasks.v2beta3.Queue", "google/cloud/tasks/v2beta3/queue.proto"], + ["google.cloud.tasks.v2beta3.Task", "google/cloud/tasks/v2beta3/task.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 Tasks + module V2beta3 + ListQueuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListQueuesRequest").msgclass + ListQueuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListQueuesResponse").msgclass + GetQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.GetQueueRequest").msgclass + CreateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.CreateQueueRequest").msgclass + UpdateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UpdateQueueRequest").msgclass + DeleteQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.DeleteQueueRequest").msgclass + PurgeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PurgeQueueRequest").msgclass + PauseQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PauseQueueRequest").msgclass + ResumeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ResumeQueueRequest").msgclass + ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListTasksRequest").msgclass + ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListTasksResponse").msgclass + GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.GetTaskRequest").msgclass + CreateTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.CreateTaskRequest").msgclass + DeleteTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.DeleteTaskRequest").msgclass + RunTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.RunTaskRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb new file mode 100644 index 000000000000..949716898bbb --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb @@ -0,0 +1,208 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/tasks/v2beta3/cloudtasks.proto for package 'google.cloud.tasks.v2beta3' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/tasks/v2beta3/cloudtasks_pb' + +module Google + module Cloud + module Tasks + module V2beta3 + module CloudTasks + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.tasks.v2beta3.CloudTasks' + + # Lists queues. + # + # Queues are returned in lexicographical order. + rpc :ListQueues, ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse + # Gets a queue. + rpc :GetQueue, ::Google::Cloud::Tasks::V2beta3::GetQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue + # Creates a queue. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :CreateQueue, ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue + # Updates a queue. + # + # This method creates the queue if it does not exist and updates + # the queue if it does exist. + # + # Queues created with this method allow tasks to live for a maximum of 31 + # days. After a task is 31 days old, the task will be deleted regardless of + # whether it was dispatched or not. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :UpdateQueue, ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue + # Deletes a queue. + # + # This command will delete the queue even if it has tasks in it. + # + # Note: If you delete a queue, a queue with the same name can't be created + # for 7 days. + # + # WARNING: Using this method may have unintended side effects if you are + # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + # Read + # [Overview of Queue Management and + # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using + # this method. + rpc :DeleteQueue, ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, ::Google::Protobuf::Empty + # Purges a queue by deleting all of its tasks. + # + # All tasks created before this method is called are permanently deleted. + # + # Purge operations can take up to one minute to take effect. Tasks + # might be dispatched before the purge takes effect. A purge is irreversible. + rpc :PurgeQueue, ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue + # Pauses the queue. + # + # If a queue is paused then the system will stop dispatching tasks + # until the queue is resumed via + # [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can + # still be added when the queue is paused. A queue is paused if its + # [state][google.cloud.tasks.v2beta3.Queue.state] is + # [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. + rpc :PauseQueue, ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue + # Resume a queue. + # + # This method resumes a queue after it has been + # [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or + # [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a + # queue is stored in the queue's + # [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method + # it will be set to + # [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING]. + # + # WARNING: Resuming many high-QPS queues at the same time can + # lead to target overloading. If you are resuming high-QPS + # queues, follow the 500/50/5 pattern described in + # [Managing Cloud Tasks Scaling + # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + rpc :ResumeQueue, ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue + # Gets the access control policy for a + # [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the + # resource exists and does not have a policy set. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.getIamPolicy` + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the access control policy for a + # [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy. + # + # Note: The Cloud Console does not check queue-level IAM permissions yet. + # Project-level permissions are required to use the Cloud Console. + # + # Authorization requires the following + # [Google IAM](https://cloud.google.com/iam) permission on the specified + # resource parent: + # + # * `cloudtasks.queues.setIamPolicy` + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on a + # [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, + # this will return an empty set of permissions, not a + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + # Lists the tasks in a queue. + # + # By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] + # view is retrieved due to performance considerations; + # [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] + # controls the subset of information which is returned. + # + # The tasks may be returned in any order. The ordering may change at any + # time. + rpc :ListTasks, ::Google::Cloud::Tasks::V2beta3::ListTasksRequest, ::Google::Cloud::Tasks::V2beta3::ListTasksResponse + # Gets a task. + rpc :GetTask, ::Google::Cloud::Tasks::V2beta3::GetTaskRequest, ::Google::Cloud::Tasks::V2beta3::Task + # Creates a task and adds it to a queue. + # + # Tasks cannot be updated after creation; there is no UpdateTask command. + # + # * The maximum task size is 100KB. + rpc :CreateTask, ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Google::Cloud::Tasks::V2beta3::Task + # Deletes a task. + # + # A task can be deleted if it is scheduled or dispatched. A task + # cannot be deleted if it has executed successfully or permanently + # failed. + rpc :DeleteTask, ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, ::Google::Protobuf::Empty + # Forces a task to run now. + # + # When this method is called, Cloud Tasks will dispatch the task, even if + # the task is already running, the queue has reached its + # [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is + # [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. + # + # This command is meant to be used for manual debugging. For + # example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be + # used to retry a failed task after a fix has been made or to manually force + # a task to be dispatched now. + # + # The dispatched task is returned. That is, the task that is returned + # contains the [status][Task.status] after the task is dispatched but + # before the task is received by its target. + # + # If Cloud Tasks receives a successful response from the task's + # target, then the task will be deleted; otherwise the task's + # [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be + # reset to the time that + # [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus + # the retry delay specified in the queue's + # [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. + # + # [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns + # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a + # task that has already succeeded or permanently failed. + rpc :RunTask, ::Google::Cloud::Tasks::V2beta3::RunTaskRequest, ::Google::Cloud::Tasks::V2beta3::Task + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb new file mode 100644 index 000000000000..991fb657a45c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta3/queue.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/tasks/v2beta3/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/tasks/v2beta3/queue.proto\x12\x1agoogle.cloud.tasks.v2beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta3/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9c\x07\n\x05Queue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12O\n\x15\x61pp_engine_http_queue\x18\x03 \x01(\x0b\x32..google.cloud.tasks.v2beta3.AppEngineHttpQueueH\x00\x12;\n\x0bhttp_target\x18\r \x01(\x0b\x32&.google.cloud.tasks.v2beta3.HttpTarget\x12;\n\x0brate_limits\x18\x04 \x01(\x0b\x32&.google.cloud.tasks.v2beta3.RateLimits\x12=\n\x0cretry_config\x18\x05 \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.RetryConfig\x12\x36\n\x05state\x18\x06 \x01(\x0e\x32\'.google.cloud.tasks.v2beta3.Queue.State\x12.\n\npurge_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x08task_ttl\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x30\n\rtombstone_ttl\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12X\n\x1astackdriver_logging_config\x18\n \x01(\x0b\x32\x34.google.cloud.tasks.v2beta3.StackdriverLoggingConfig\x12\x39\n\x04type\x18\x0b \x01(\x0e\x32&.google.cloud.tasks.v2beta3.Queue.TypeB\x03\xe0\x41\x05\x12:\n\x05stats\x18\x0c \x01(\x0b\x32&.google.cloud.tasks.v2beta3.QueueStatsB\x03\xe0\x41\x03\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\"0\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04PULL\x10\x01\x12\x08\n\x04PUSH\x10\x02:\\\xea\x41Y\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x36projects/{project}/locations/{location}/queues/{queue}B\x0c\n\nqueue_type\"j\n\nRateLimits\x12!\n\x19max_dispatches_per_second\x18\x01 \x01(\x01\x12\x16\n\x0emax_burst_size\x18\x02 \x01(\x05\x12!\n\x19max_concurrent_dispatches\x18\x03 \x01(\x05\"\xd1\x01\n\x0bRetryConfig\x12\x14\n\x0cmax_attempts\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmin_backoff\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmax_backoff\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\"2\n\x18StackdriverLoggingConfig\x12\x16\n\x0esampling_ratio\x18\x01 \x01(\x01\"\xe8\x01\n\nQueueStats\x12\x18\n\x0btasks_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x46\n\x1doldest_estimated_arrival_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\'\n\x1a\x65xecuted_last_minute_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12(\n\x1b\x63oncurrent_dispatches_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12%\n\x18\x65\x66\x66\x65\x63tive_execution_rate\x18\x05 \x01(\x01\x42\x03\xe0\x41\x03\x42s\n\x1e\x63om.google.cloud.tasks.v2beta3B\nQueueProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta3.AppEngineHttpQueue", "google/cloud/tasks/v2beta3/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.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 Tasks + module V2beta3 + Queue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Queue").msgclass + Queue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Queue.State").enummodule + Queue::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Queue.Type").enummodule + RateLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.RateLimits").msgclass + RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.RetryConfig").msgclass + StackdriverLoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.StackdriverLoggingConfig").msgclass + QueueStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.QueueStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb new file mode 100644 index 000000000000..46bbd3572870 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloud_tasks/rest" +require "google/cloud/tasks/v2beta3/bindings_override" +require "google/cloud/tasks/v2beta3/version" + +module Google + module Cloud + module Tasks + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/tasks/v2beta3/rest" + # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new + # + module V2beta3 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb new file mode 100644 index 000000000000..7dbf1f335f19 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta3/target.proto + +require 'google/protobuf' + + +descriptor_data = "\n\'google/cloud/tasks/v2beta3/target.proto\x12\x1agoogle.cloud.tasks.v2beta3\"+\n\x0bPullMessage\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x0b\n\x03tag\x18\x02 \x01(\t\"\x1c\n\x0cPathOverride\x12\x0c\n\x04path\x18\x01 \x01(\t\"%\n\rQueryOverride\x12\x14\n\x0cquery_params\x18\x01 \x01(\t\"\x97\x04\n\x0bUriOverride\x12\x43\n\x06scheme\x18\x01 \x01(\x0e\x32..google.cloud.tasks.v2beta3.UriOverride.SchemeH\x00\x88\x01\x01\x12\x11\n\x04host\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\x03H\x02\x88\x01\x01\x12?\n\rpath_override\x18\x04 \x01(\x0b\x32(.google.cloud.tasks.v2beta3.PathOverride\x12\x41\n\x0equery_override\x18\x05 \x01(\x0b\x32).google.cloud.tasks.v2beta3.QueryOverride\x12\x61\n\x19uri_override_enforce_mode\x18\x06 \x01(\x0e\x32>.google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode\"5\n\x06Scheme\x12\x16\n\x12SCHEME_UNSPECIFIED\x10\x00\x12\x08\n\x04HTTP\x10\x01\x12\t\n\x05HTTPS\x10\x02\"b\n\x16UriOverrideEnforceMode\x12)\n%URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED\x10\x00\x12\x11\n\rIF_NOT_EXISTS\x10\x01\x12\n\n\x06\x41LWAYS\x10\x02\x42\t\n\x07_schemeB\x07\n\x05_hostB\x07\n\x05_port\"\xe4\x03\n\nHttpTarget\x12=\n\x0curi_override\x18\x01 \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.UriOverride\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta3.HttpMethod\x12O\n\x10header_overrides\x18\x03 \x03(\x0b\x32\x35.google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta3.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta3.OidcTokenH\x00\x1a$\n\x06Header\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x1aO\n\x0eHeaderOverride\x12=\n\x06header\x18\x01 \x01(\x0b\x32-.google.cloud.tasks.v2beta3.HttpTarget.HeaderB\x16\n\x14\x61uthorization_header\"\xf0\x02\n\x0bHttpRequest\x12\x0b\n\x03url\x18\x01 \x01(\t\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta3.HttpMethod\x12\x45\n\x07headers\x18\x03 \x03(\x0b\x32\x34.google.cloud.tasks.v2beta3.HttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta3.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta3.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"g\n\x12\x41ppEngineHttpQueue\x12Q\n\x1b\x61pp_engine_routing_override\x18\x01 \x01(\x0b\x32,.google.cloud.tasks.v2beta3.AppEngineRouting\"\xc1\x02\n\x14\x41ppEngineHttpRequest\x12;\n\x0bhttp_method\x18\x01 \x01(\x0e\x32&.google.cloud.tasks.v2beta3.HttpMethod\x12H\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32,.google.cloud.tasks.v2beta3.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12N\n\x07headers\x18\x04 \x03(\x0b\x32=.google.cloud.tasks.v2beta3.AppEngineHttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42t\n\x1e\x63om.google.cloud.tasks.v2beta3B\x0bTargetProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspbb\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 = [ + ] + 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 Tasks + module V2beta3 + PullMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PullMessage").msgclass + PathOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PathOverride").msgclass + QueryOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.QueryOverride").msgclass + UriOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UriOverride").msgclass + UriOverride::Scheme = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UriOverride.Scheme").enummodule + UriOverride::UriOverrideEnforceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode").enummodule + HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpTarget").msgclass + HttpTarget::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpTarget.Header").msgclass + HttpTarget::HeaderOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride").msgclass + HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpRequest").msgclass + AppEngineHttpQueue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.AppEngineHttpQueue").msgclass + AppEngineHttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.AppEngineHttpRequest").msgclass + AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.AppEngineRouting").msgclass + OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.OAuthToken").msgclass + OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.OidcToken").msgclass + HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpMethod").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb new file mode 100644 index 000000000000..a62f7cf7f916 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tasks/v2beta3/task.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/tasks/v2beta3/target_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n%google/cloud/tasks/v2beta3/task.proto\x12\x1agoogle.cloud.tasks.v2beta3\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta3/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x8e\x06\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12S\n\x17\x61pp_engine_http_request\x18\x03 \x01(\x0b\x32\x30.google.cloud.tasks.v2beta3.AppEngineHttpRequestH\x00\x12?\n\x0chttp_request\x18\x0b \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.HttpRequestH\x00\x12?\n\x0cpull_message\x18\r \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.PullMessageH\x00\x12\x31\n\rschedule_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x11\x64ispatch_deadline\x18\x0c \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x16\n\x0e\x64ispatch_count\x18\x06 \x01(\x05\x12\x16\n\x0eresponse_count\x18\x07 \x01(\x05\x12:\n\rfirst_attempt\x18\x08 \x01(\x0b\x32#.google.cloud.tasks.v2beta3.Attempt\x12\x39\n\x0clast_attempt\x18\t \x01(\x0b\x32#.google.cloud.tasks.v2beta3.Attempt\x12\x33\n\x04view\x18\n \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\"1\n\x04View\x12\x14\n\x10VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02:h\xea\x41\x65\n\x1e\x63loudtasks.googleapis.com/Task\x12\x43projects/{project}/locations/{location}/queues/{queue}/tasks/{task}B\x0e\n\x0cpayload_type\"\xcf\x01\n\x07\x41ttempt\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rdispatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rresponse_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x0fresponse_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusBr\n\x1e\x63om.google.cloud.tasks.v2beta3B\tTaskProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta3.AppEngineHttpRequest", "google/cloud/tasks/v2beta3/target.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.rpc.Status", "google/rpc/status.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 Tasks + module V2beta3 + Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Task").msgclass + Task::View = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Task.View").enummodule + Attempt = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Attempt").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb new file mode 100644 index 000000000000..4734a344c8be --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta3 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md new file mode 100644 index 000000000000..1125683d6825 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Tasks V2beta3 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-tasks-v2beta3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb new file mode 100644 index 000000000000..00fcdde8c8b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb @@ -0,0 +1,396 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta3 + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # @!attribute [rw] filter + # @return [::String] + # `filter` can be used to specify a subset of queues. Any + # {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and + # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The + # filter syntax is the same as described in [Stackdriver's Advanced Logs + # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + # + # Sample filter "state: PAUSED". + # + # Note that using filters might cause fewer queues than the + # requested page_size to be returned. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. + # + # The maximum page size is 9800. If unspecified, the page size will + # be the maximum. Fewer queues than requested might be returned, + # even if more queues exist; use the + # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} + # in the response to determine if more queues exist. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} method. It + # is an error to switch the value of the + # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while + # iterating through pages. + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + class ListQueuesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues}. + # @!attribute [rw] queues + # @return [::Array<::Google::Cloud::Tasks::V2beta3::Queue>] + # The list of queues. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # + # To return the next page of results, call + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} with this + # value as the + # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#page_token page_token}. + # + # If the next_page_token is empty, there are no more results. + # + # The page token is valid for only 2 hours. + class ListQueuesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue GetQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the queue. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @!attribute [rw] read_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Read mask is used for a more granular control over what the API + # returns. If the mask is not present all fields will be returned except + # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly + # specified in the mask. + class GetQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue CreateQueue}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location name in which the queue will be created. + # For example: `projects/PROJECT_ID/locations/LOCATION_ID` + # + # The list of allowed locations can be obtained by calling Cloud + # Tasks' implementation of + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # @!attribute [rw] queue + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # Required. The queue to create. + # + # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as + # an existing queue. + class CreateQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue}. + # @!attribute [rw] queue + # @return [::Google::Cloud::Tasks::V2beta3::Queue] + # Required. The queue to create or update. + # + # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be + # specified. + # + # Output only fields cannot be modified using UpdateQueue. + # Any value specified for an output only field will be ignored. + # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be + # changed. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # A mask used to specify which fields of the queue are being updated. + # + # If empty, then all fields will be updated. + class UpdateQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue DeleteQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + class DeleteQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue PurgeQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class PurgeQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue PauseQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class PauseQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. + # @!attribute [rw] name + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + class ResumeQueueRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing tasks using + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks}. + # @!attribute [rw] parent + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum page size. + # + # Fewer tasks than requested might be returned, even if more tasks exist; use + # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} + # in the response to determine if more tasks exist. + # + # The maximum page size is 1000. If unspecified, the page size will be the + # maximum. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying the page of results to return. + # + # To request the first page results, page_token must be empty. To + # request the next page of results, page_token must be the value of + # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} + # returned from the previous call to + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} method. + # + # The page token is valid for only 2 hours. + class ListTasksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing tasks using + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks}. + # @!attribute [rw] tasks + # @return [::Array<::Google::Cloud::Tasks::V2beta3::Task>] + # The list of tasks. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # + # To return the next page of results, call + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} with this + # value as the + # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#page_token page_token}. + # + # If the next_page_token is empty, there are no more results. + class ListTasksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a task using + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task GetTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + class GetTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}. + # @!attribute [rw] parent + # @return [::String] + # Required. The queue name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # The queue must already exist. + # @!attribute [rw] task + # @return [::Google::Cloud::Tasks::V2beta3::Task] + # Required. The task to add. + # + # Task names have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + # The user can optionally specify a task + # {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified + # then the system will generate a random unique task id, which will be set in + # the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}. + # + # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not + # set or is in the past then Cloud Tasks will set it to the current time. + # + # Task De-duplication: + # + # Explicitly specifying a task ID enables task de-duplication. If + # a task's ID is identical to that of an existing task or a task + # that was deleted or executed recently then the call will fail + # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. + # If the task's queue was created using Cloud Tasks, then another task with + # the same name can't be created for ~1 hour after the original task was + # deleted or executed. If the task's queue was created using queue.yaml or + # queue.xml, then another task with the same name can't be created + # for ~9 days after the original task was deleted or executed. + # + # Because there is an extra lookup cost to identify duplicate task + # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} + # calls have significantly increased latency. Using hashed strings for the + # task id or for the prefix of the task id is recommended. Choosing task ids + # that are sequential or have sequential prefixes, for example using a + # timestamp, causes an increase in latency and error rates in all + # task commands. The infrastructure relies on an approximately + # uniform distribution of task ids to store and serve tasks + # efficiently. + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + class CreateTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a task using + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task DeleteTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + class DeleteTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for forcing a task to run now using + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask}. + # @!attribute [rw] name + # @return [::String] + # Required. The task name. For example: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # @!attribute [rw] response_view + # @return [::Google::Cloud::Tasks::V2beta3::Task::View] + # The response_view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. + # + # By default response_view is + # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is + # retrieved by default because some data, such as payloads, might be + # desirable to return only when needed because of its large size or because + # of the sensitivity of data that it contains. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. + class RunTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb new file mode 100644 index 000000000000..210bc3f6fa93 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb @@ -0,0 +1,462 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta3 + # A queue is a container of related tasks. Queues are configured to manage + # how those tasks are dispatched. Configurable properties include rate limits, + # retry options, queue types, and others. + # @!attribute [rw] name + # @return [::String] + # Caller-specified and required in + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue CreateQueue}, after + # which it becomes output only. + # + # The queue name. + # + # The queue name must have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the queue's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + # hyphens (-). The maximum length is 100 characters. + # @!attribute [rw] app_engine_http_queue + # @return [::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue] + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} + # settings apply only to [App Engine + # tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. + # {::Google::Cloud::Tasks::V2beta3::HttpRequest Http tasks} are not affected by + # this proto. + # @!attribute [rw] http_target + # @return [::Google::Cloud::Tasks::V2beta3::HttpTarget] + # Modifies HTTP target for HTTP tasks. + # @!attribute [rw] rate_limits + # @return [::Google::Cloud::Tasks::V2beta3::RateLimits] + # Rate limits for task dispatches. + # + # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits} and + # {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} are related + # because they both control task attempts. However they control task attempts + # in different ways: + # + # * {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits} controls the + # total rate of + # dispatches from a queue (i.e. all traffic dispatched from the + # queue, regardless of whether the dispatch is from a first + # attempt or a retry). + # * {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} controls + # what happens to + # particular a task after its first attempt fails. That is, + # {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} controls + # task retries (the second attempt, third attempt, etc). + # + # The queue's actual dispatch rate is the result of: + # + # * Number of tasks in the queue + # * User-specified throttling: + # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits}, + # {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config}, and the + # [queue's state][google.cloud.tasks.v2beta3.Queue.state]. + # * System throttling due to `429` (Too Many Requests) or `503` (Service + # Unavailable) responses from the worker, high error rates, or to smooth + # sudden large traffic spikes. + # @!attribute [rw] retry_config + # @return [::Google::Cloud::Tasks::V2beta3::RetryConfig] + # Settings that determine the retry behavior. + # + # * For tasks created using Cloud Tasks: the queue-level retry settings + # apply to all tasks in the queue that were created using Cloud Tasks. + # Retry settings cannot be set on individual tasks. + # * For tasks created using the App Engine SDK: the queue-level retry + # settings apply to all tasks in the queue which do not have retry settings + # explicitly set on the task and were created by the App Engine SDK. See + # [App Engine + # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + # @!attribute [rw] state + # @return [::Google::Cloud::Tasks::V2beta3::Queue::State] + # Output only. The state of the queue. + # + # `state` can only be changed by called + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue PauseQueue}, + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}, or + # uploading + # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue} cannot be + # used to change `state`. + # @!attribute [rw] purge_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time this queue was purged. + # + # All tasks that were {::Google::Cloud::Tasks::V2beta3::Task#create_time created} + # before this time were purged. + # + # A queue can be purged using + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue PurgeQueue}, the [App + # Engine Task Queue SDK, or the Cloud + # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + # + # Purge time will be truncated to the nearest microsecond. Purge + # time will be unset if the queue has never been purged. + # @!attribute [rw] task_ttl + # @return [::Google::Protobuf::Duration] + # The maximum amount of time that a task will be retained in + # this queue. + # + # Queues created by Cloud Tasks have a default `task_ttl` of 31 days. + # After a task has lived for `task_ttl`, the task will be deleted + # regardless of whether it was dispatched or not. + # + # The `task_ttl` for queues created via queue.yaml/xml is equal to the + # maximum duration because there is a + # [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for + # these queues. To view the maximum valid duration, see the documentation for + # {::Google::Protobuf::Duration Duration}. + # @!attribute [rw] tombstone_ttl + # @return [::Google::Protobuf::Duration] + # The task tombstone time to live (TTL). + # + # After a task is deleted or executed, the task's tombstone is + # retained for the length of time specified by `tombstone_ttl`. + # The tombstone is used by task de-duplication; another task with the same + # name can't be created until the tombstone has expired. For more information + # about task de-duplication, see the documentation for + # {::Google::Cloud::Tasks::V2beta3::CreateTaskRequest#task CreateTaskRequest}. + # + # Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. + # @!attribute [rw] stackdriver_logging_config + # @return [::Google::Cloud::Tasks::V2beta3::StackdriverLoggingConfig] + # Configuration options for writing logs to + # [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this + # field is unset, then no logs are written. + # @!attribute [rw] type + # @return [::Google::Cloud::Tasks::V2beta3::Queue::Type] + # Immutable. The type of a queue (push or pull). + # + # `Queue.type` is an immutable property of the queue that is set at the queue + # creation time. When left unspecified, the default value of `PUSH` is + # selected. + # @!attribute [r] stats + # @return [::Google::Cloud::Tasks::V2beta3::QueueStats] + # Output only. The realtime, informational statistics for a queue. In order + # to receive the statistics the caller should include this field in the + # FieldMask. + class Queue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the queue. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # The queue is running. Tasks can be dispatched. + # + # If the queue was created using Cloud Tasks and the queue has + # had no activity (method calls or task dispatches) for 30 days, + # the queue may take a few minutes to re-activate. Some method + # calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and + # tasks may not be dispatched for a few minutes until the queue + # has been re-activated. + RUNNING = 1 + + # Tasks are paused by the user. If the queue is paused then Cloud + # Tasks will stop delivering tasks from it, but more tasks can + # still be added to it by the user. + PAUSED = 2 + + # The queue is disabled. + # + # A queue becomes `DISABLED` when + # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) + # or + # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) + # is uploaded which does not contain the queue. You cannot directly disable + # a queue. + # + # When a queue is disabled, tasks can still be added to a queue + # but the tasks are not dispatched. + # + # To permanently delete this queue and all of its tasks, call + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue DeleteQueue}. + DISABLED = 3 + end + + # The type of the queue. + module Type + # Default value. + TYPE_UNSPECIFIED = 0 + + # A pull queue. + PULL = 1 + + # A push queue. + PUSH = 2 + end + end + + # Rate limits. + # + # This message determines the maximum rate that tasks can be dispatched by a + # queue, regardless of whether the dispatch is a first task attempt or a retry. + # + # Note: The debugging command, + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask}, will run a task + # even if the queue has reached its + # {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits}. + # @!attribute [rw] max_dispatches_per_second + # @return [::Float] + # The maximum rate at which tasks are dispatched from this queue. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # * For {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue App Engine queues}, + # the maximum allowed value + # is 500. + # + # + # This field has the same meaning as + # [rate in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). + # @!attribute [rw] max_burst_size + # @return [::Integer] + # The max burst size. + # + # Max burst size limits how fast tasks in queue are processed when + # many tasks are in the queue and the rate is high. This field + # allows the queue to have a high rate so processing starts shortly + # after a task is enqueued, but still limits resource usage when + # many tasks are enqueued in a short period of time. + # + # The [token bucket](https://wikipedia.org/wiki/Token_Bucket) + # algorithm is used to control the rate of task dispatches. Each + # queue has a token bucket that holds tokens, up to the maximum + # specified by `max_burst_size`. Each time a task is dispatched, a + # token is removed from the bucket. Tasks will be dispatched until + # the queue's bucket runs out of tokens. The bucket will be + # continuously refilled with new tokens based on + # {::Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}. + # + # The default value of `max_burst_size` is picked by Cloud Tasks + # based on the value of + # {::Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}. + # + # The maximum value of `max_burst_size` is 500. + # + # For App Engine queues that were created or updated using + # `queue.yaml/xml`, `max_burst_size` is equal to + # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). + # If + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue} is called + # on a queue without explicitly setting a value for `max_burst_size`, + # `max_burst_size` value will get updated if + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue} is + # updating + # {::Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}. + # @!attribute [rw] max_concurrent_dispatches + # @return [::Integer] + # The maximum number of concurrent tasks that Cloud Tasks allows + # to be dispatched for this queue. After this threshold has been + # reached, Cloud Tasks stops dispatching tasks until the number of + # concurrent requests decreases. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # The maximum allowed value is 5,000. + # + # + # This field has the same meaning as + # [max_concurrent_requests in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + class RateLimits + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retry config. + # + # These settings determine when a failed task attempt is retried. + # @!attribute [rw] max_attempts + # @return [::Integer] + # Number of attempts per task. + # + # Cloud Tasks will attempt the task `max_attempts` times (that is, if the + # first attempt fails, then there will be `max_attempts - 1` retries). Must + # be >= -1. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # -1 indicates unlimited attempts. + # + # This field has the same meaning as + # [task_retry_limit in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_retry_duration + # @return [::Google::Protobuf::Duration] + # If positive, `max_retry_duration` specifies the time limit for + # retrying a failed task, measured from when the task was first + # attempted. Once `max_retry_duration` time has passed *and* the + # task has been attempted + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts} times, + # no further attempts will be made and the task will be deleted. + # + # If zero, then the task age is unlimited. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # `max_retry_duration` will be truncated to the nearest second. + # + # This field has the same meaning as + # [task_age_limit in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] min_backoff + # @return [::Google::Protobuf::Duration] + # A task will be {::Google::Cloud::Tasks::V2beta3::Task#schedule_time scheduled} + # for retry between + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} and + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} duration + # after it fails, if the queue's + # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig} specifies that the + # task should be retried. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # `min_backoff` will be truncated to the nearest second. + # + # This field has the same meaning as + # [min_backoff_seconds in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_backoff + # @return [::Google::Protobuf::Duration] + # A task will be {::Google::Cloud::Tasks::V2beta3::Task#schedule_time scheduled} + # for retry between + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} and + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} duration + # after it fails, if the queue's + # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig} specifies that the + # task should be retried. + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # `max_backoff` will be truncated to the nearest second. + # + # This field has the same meaning as + # [max_backoff_seconds in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + # @!attribute [rw] max_doublings + # @return [::Integer] + # The time between retries will double `max_doublings` times. + # + # A task's retry interval starts at + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff}, then + # doubles `max_doublings` times, then increases linearly, and finally retries + # at intervals of + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} up to + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts} times. + # + # For example, if + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} is 10s, + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} is 300s, + # and `max_doublings` is 3, then the a task will first be retried in 10s. The + # retry interval will double three times, and then increase linearly by 2^3 * + # 10s. Finally, the task will retry at intervals of + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} until the + # task has been attempted + # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts} times. + # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, + # 300s, .... + # + # If unspecified when the queue is created, Cloud Tasks will pick the + # default. + # + # + # This field has the same meaning as + # [max_doublings in + # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). + class RetryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration options for writing logs to + # [Stackdriver Logging](https://cloud.google.com/logging/docs/). + # @!attribute [rw] sampling_ratio + # @return [::Float] + # Specifies the fraction of operations to write to + # [Stackdriver Logging](https://cloud.google.com/logging/docs/). + # This field may contain any value between 0.0 and 1.0, inclusive. + # 0.0 is the default and means that no operations are logged. + class StackdriverLoggingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Statistics for a queue. + # @!attribute [r] tasks_count + # @return [::Integer] + # Output only. An estimation of the number of tasks in the queue, that is, + # the tasks in the queue that haven't been executed, the tasks in the queue + # which the queue has dispatched but has not yet received a reply for, and + # the failed tasks that the queue is retrying. + # @!attribute [r] oldest_estimated_arrival_time + # @return [::Google::Protobuf::Timestamp] + # Output only. An estimation of the nearest time in the future where a task + # in the queue is scheduled to be executed. + # @!attribute [r] executed_last_minute_count + # @return [::Integer] + # Output only. The number of tasks that the queue has dispatched and received + # a reply for during the last minute. This variable counts both successful + # and non-successful executions. + # @!attribute [r] concurrent_dispatches_count + # @return [::Integer] + # Output only. The number of requests that the queue has dispatched but has + # not received a reply for yet. + # @!attribute [r] effective_execution_rate + # @return [::Float] + # Output only. The current maximum number of tasks per second executed by the + # queue. The maximum value of this variable is controlled by the RateLimits + # of the Queue. However, this value could be less to avoid overloading the + # endpoints tasks in the queue are targeting. + class QueueStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb new file mode 100644 index 000000000000..0e27cb1fe1f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb @@ -0,0 +1,728 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta3 + # Pull Message. + # + # This proto can only be used for tasks in a queue which has + # {::Google::Cloud::Tasks::V2beta3::Queue#type PULL} type. It currently exists for + # backwards compatibility with the App Engine Task Queue SDK. This message type + # maybe returned with methods + # [list][google.cloud.tasks.v2beta3.CloudTask.ListTasks] and + # [get][google.cloud.tasks.v2beta3.CloudTask.ListTasks], when the response view + # is [FULL][google.cloud.tasks.v2beta3.Task.View.Full]. + # @!attribute [rw] payload + # @return [::String] + # A data payload consumed by the worker to execute the task. + # @!attribute [rw] tag + # @return [::String] + # The tasks's tag. + # + # The tag is less than 500 characters. + # + # SDK compatibility: Although the SDK allows tags to be either + # string or + # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 + # encoded, the tag will be empty when the task is returned by Cloud Tasks. + class PullMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PathOverride. + # + # Path message defines path override for HTTP targets. + # @!attribute [rw] path + # @return [::String] + # The URI path (e.g., /users/1234). Default is an empty string. + class PathOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # QueryOverride. + # + # Query message defines query override for HTTP targets. + # @!attribute [rw] query_params + # @return [::String] + # The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty + # string. + class QueryOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # URI Override. + # + # When specified, all the HTTP tasks inside the queue will be partially or + # fully overridden depending on the configured values. + # @!attribute [rw] scheme + # @return [::Google::Cloud::Tasks::V2beta3::UriOverride::Scheme] + # Scheme override. + # + # When specified, the task URI scheme is replaced by the provided value (HTTP + # or HTTPS). + # @!attribute [rw] host + # @return [::String] + # Host override. + # + # When specified, replaces the host part of the task URL. For example, + # if the task URL is "https://www.google.com," and host value is set to + # "example.net", the overridden URI will be changed to "https://example.net." + # Host value cannot be an empty string (INVALID_ARGUMENT). + # @!attribute [rw] port + # @return [::Integer] + # Port override. + # + # When specified, replaces the port part of the task URI. For instance, + # for a URI http://www.google.com/foo and port=123, the overridden URI + # becomes http://www.google.com:123/foo. Note that the port value must be a + # positive integer. Setting the port to 0 (Zero) clears the URI port. + # @!attribute [rw] path_override + # @return [::Google::Cloud::Tasks::V2beta3::PathOverride] + # URI path. + # + # When specified, replaces the existing path of the task URL. Setting the + # path value to an empty string clears the URI path segment. + # @!attribute [rw] query_override + # @return [::Google::Cloud::Tasks::V2beta3::QueryOverride] + # URI Query. + # + # When specified, replaces the query part of the task URI. Setting the + # query value to an empty string clears the URI query segment. + # @!attribute [rw] uri_override_enforce_mode + # @return [::Google::Cloud::Tasks::V2beta3::UriOverride::UriOverrideEnforceMode] + # URI Override Enforce Mode + # + # When specified, determines the Target UriOverride mode. If not specified, + # it defaults to ALWAYS. + class UriOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The Scheme for an HTTP request. By default, it is HTTPS. + module Scheme + # Scheme unspecified. Defaults to HTTPS. + SCHEME_UNSPECIFIED = 0 + + # Convert the scheme to HTTP, e.g., https://www.google.ca will change to + # http://www.google.ca. + HTTP = 1 + + # Convert the scheme to HTTPS, e.g., http://www.google.ca will change to + # https://www.google.ca. + HTTPS = 2 + end + + # UriOverrideEnforceMode mode is to define enforcing mode for the override + # modes. + module UriOverrideEnforceMode + # OverrideMode Unspecified. Defaults to ALWAYS. + URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0 + + # In the IF_NOT_EXISTS mode, queue-level configuration is only + # applied where task-level configuration does not exist. + IF_NOT_EXISTS = 1 + + # In the ALWAYS mode, queue-level configuration overrides all + # task-level configuration + ALWAYS = 2 + end + end + + # HTTP target. + # + # When specified as a [Queue][target_type], all the tasks with [HttpRequest] + # will be overridden according to the target. + # @!attribute [rw] uri_override + # @return [::Google::Cloud::Tasks::V2beta3::UriOverride] + # URI override. + # + # When specified, overrides the execution URI for all the tasks in the queue. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2beta3::HttpMethod] + # The HTTP method to use for the request. + # + # When specified, it overrides + # {::Google::Cloud::Tasks::V2beta3::HttpTarget#http_method HttpRequest} for the + # task. Note that if the value is set to [HttpMethod][GET] the + # [HttpRequest][body] of the task will be ignored at execution time. + # @!attribute [rw] header_overrides + # @return [::Array<::Google::Cloud::Tasks::V2beta3::HttpTarget::HeaderOverride>] + # HTTP target headers. + # + # This map contains the header field names and values. + # Headers will be set when running the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} and/or + # [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. + # + # These headers represent a subset of the headers that will be configured for + # the task's HTTP request. Some HTTP request headers will be ignored or + # replaced. + # + # A partial list of headers that will be ignored or replaced is: + # * Several predefined headers, prefixed with "X-CloudTasks-", can + # be used to define properties of the task. + # * Host: This will be computed by Cloud Tasks and derived from + # [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. + # * Content-Length: This will be computed by Cloud Tasks. + # + # `Content-Type` won't be set by Cloud Tasks. You can explicitly set + # `Content-Type` to a media type when the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. + # For example,`Content-Type` can be set to `"application/octet-stream"` or + # `"application/json"`. The default value is set to `"application/json"`. + # + # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + # + # Headers which can have multiple values (according to RFC2616) can be + # specified using comma-separated values. + # + # The size of the headers must be less than 80KB. + # Queue-level headers to override headers of all the tasks in the queue. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Tasks::V2beta3::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as the `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # + # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Tasks::V2beta3::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # + # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HttpTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines a header message. A header can have a key and a value. + # @!attribute [rw] key + # @return [::String] + # The Key of the header. + # @!attribute [rw] value + # @return [::String] + # The Value of the header. + class Header + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wraps the Header object. + # @!attribute [rw] header + # @return [::Google::Cloud::Tasks::V2beta3::HttpTarget::Header] + # header embodying a key and a value. + class HeaderOverride + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # HTTP request. + # + # The task will be pushed to the worker as an HTTP request. If the worker + # or the redirected worker acknowledges the task by returning a successful HTTP + # response code ([`200` - `299`]), the task will be removed from the queue. If + # any other HTTP response code is returned or no response is received, the + # task will be retried according to the following: + # + # * User-specified throttling: [retry + # configuration][google.cloud.tasks.v2beta3.Queue.retry_config], + # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate limits}, and the + # [queue's state][google.cloud.tasks.v2beta3.Queue.state]. + # + # * System throttling: To prevent the worker from overloading, Cloud Tasks may + # temporarily reduce the queue's effective rate. User-specified settings + # will not be changed. + # + # System throttling happens because: + # + # * Cloud Tasks backs off on all errors. Normally the backoff specified in + # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate limits} will be used. + # But if the worker returns `429` (Too Many Requests), `503` (Service + # Unavailable), or the rate of errors is high, Cloud Tasks will use a + # higher backoff rate. The retry specified in the `Retry-After` HTTP + # response header is considered. + # + # * To prevent traffic spikes and to smooth sudden increases in traffic, + # dispatches ramp up slowly when the queue is newly created or idle and + # if large numbers of tasks suddenly become available to dispatch (due to + # spikes in create task rates, the queue being unpaused, or many tasks + # that are scheduled at the same time). + # @!attribute [rw] url + # @return [::String] + # Required. The full url path that the request will be sent to. + # + # This string must begin with either "http://" or "https://". Some examples + # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will + # encode some characters for safety and compatibility. The maximum allowed + # URL length is 2083 characters after encoding. + # + # The `Location` header response from a redirect response [`300` - `399`] + # may be followed. The redirect is not counted as a separate attempt. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2beta3::HttpMethod] + # The HTTP method to use for the request. The default is POST. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. + # Headers can be set when the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. + # + # These headers represent a subset of the headers that will accompany the + # task's HTTP request. Some HTTP request headers will be ignored or replaced. + # + # A partial list of headers that will be ignored or replaced is: + # + # * Any header that is prefixed with "X-CloudTasks-" will be treated + # as service header. Service headers define properties of the task and are + # predefined in CloudTask. + # * Host: This will be computed by Cloud Tasks and derived from + # {::Google::Cloud::Tasks::V2beta3::HttpRequest#url HttpRequest.url}. + # * Content-Length: This will be computed by Cloud Tasks. + # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. + # * `X-Google-*`: Google use only. + # * `X-AppEngine-*`: Google use only. + # + # `Content-Type` won't be set by Cloud Tasks. You can explicitly set + # `Content-Type` to a media type when the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. + # For example, `Content-Type` can be set to `"application/octet-stream"` or + # `"application/json"`. + # + # Headers which can have multiple values (according to RFC2616) can be + # specified using comma-separated values. + # + # The size of the headers must be less than 80KB. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. + # + # A request body is allowed only if the + # {::Google::Cloud::Tasks::V2beta3::HttpRequest#http_method HTTP method} is POST, + # PUT, or PATCH. It is an error to set body on a task with an incompatible + # {::Google::Cloud::Tasks::V2beta3::HttpMethod HttpMethod}. + # @!attribute [rw] oauth_token + # @return [::Google::Cloud::Tasks::V2beta3::OAuthToken] + # If specified, an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) + # will be generated and attached as an `Authorization` header in the HTTP + # request. + # + # This type of authorization should generally only be used when calling + # Google APIs hosted on *.googleapis.com. + # + # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc_token + # @return [::Google::Cloud::Tasks::V2beta3::OidcToken] + # If specified, an + # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) + # token will be generated and attached as an `Authorization` header in the + # HTTP request. + # + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # + # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HttpRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine HTTP queue. + # + # The task will be delivered to the App Engine application hostname + # specified by its + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} and + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest}. The + # documentation for + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} + # explains how the task's host URL is constructed. + # + # Using {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} + # requires + # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) + # Google IAM permission for the project + # and the following scope: + # + # `https://www.googleapis.com/auth/cloud-platform` + # @!attribute [rw] app_engine_routing_override + # @return [::Google::Cloud::Tasks::V2beta3::AppEngineRouting] + # Overrides for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + # + # If set, `app_engine_routing_override` is used for all tasks in + # the queue, no matter what the setting is for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + class AppEngineHttpQueue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # App Engine HTTP request. + # + # The message defines the HTTP request that is sent to an App Engine app when + # the task is dispatched. + # + # Using {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} + # requires + # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) + # Google IAM permission for the project + # and the following scope: + # + # `https://www.googleapis.com/auth/cloud-platform` + # + # The task will be delivered to the App Engine app which belongs to the same + # project as the queue. For more information, see + # [How Requests are + # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and how routing is affected by + # [dispatch + # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). + # Traffic is encrypted during transport and never leaves Google datacenters. + # Because this traffic is carried over a communication mechanism internal to + # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). + # The request to the handler, however, will appear to have used the HTTP + # protocol. + # + # The {::Google::Cloud::Tasks::V2beta3::AppEngineRouting AppEngineRouting} used to + # construct the URL that the task is delivered to can be set at the queue-level + # or task-level: + # + # * If set, + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue#app_engine_routing_override app_engine_routing_override} + # is used for all tasks in the queue, no matter what the setting + # is for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + # + # + # The `url` that the task will be sent to is: + # + # * `url =` {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} `+` + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#relative_uri relative_uri} + # + # Tasks can be dispatched to secure app handlers, unsecure app handlers, and + # URIs restricted with + # [`login: + # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). + # Because tasks are not run as any user, they cannot be dispatched to URIs + # restricted with + # [`login: + # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) + # Task dispatches also do not follow redirects. + # + # The task attempt has succeeded if the app's request handler returns an HTTP + # response code in the range [`200` - `299`]. The task attempt has failed if + # the app's handler returns a non-2xx response code or Cloud Tasks does + # not receive response before the + # {::Google::Cloud::Tasks::V2beta3::Task#dispatch_deadline deadline}. Failed tasks + # will be retried according to the [retry + # configuration][google.cloud.tasks.v2beta3.Queue.retry_config]. `503` (Service + # Unavailable) is considered an App Engine system error instead of an + # application error and will cause Cloud Tasks' traffic congestion control to + # temporarily throttle the queue's dispatches. Unlike other types of task + # targets, a `429` (Too Many Requests) response from an app handler does not + # cause traffic congestion control to throttle the queue. + # @!attribute [rw] http_method + # @return [::Google::Cloud::Tasks::V2beta3::HttpMethod] + # The HTTP method to use for the request. The default is POST. + # + # The app's request handler for the task's target URL must be able to handle + # HTTP requests with this http_method, otherwise the task attempt fails with + # error code 405 (Method Not Allowed). See [Writing a push task request + # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + # and the App Engine documentation for your runtime on [How Requests are + # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). + # @!attribute [rw] app_engine_routing + # @return [::Google::Cloud::Tasks::V2beta3::AppEngineRouting] + # Task-level setting for App Engine routing. + # + # If set, + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue#app_engine_routing_override app_engine_routing_override} + # is used for all tasks in the queue, no matter what the setting is for the + # [task-level + # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. + # @!attribute [rw] relative_uri + # @return [::String] + # The relative URI. + # + # The relative URI must begin with "/" and must be a valid HTTP relative URI. + # It can contain a path and query string arguments. + # If the relative URI is empty, then the root path "/" will be used. + # No spaces are allowed, and the maximum length allowed is 2083 characters. + # @!attribute [rw] headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # HTTP request headers. + # + # This map contains the header field names and values. + # Headers can be set when the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. + # Repeated headers are not supported but a header value can contain commas. + # + # Cloud Tasks sets some headers to default values: + # + # * `User-Agent`: By default, this header is + # `"AppEngine-Google; (+http://code.google.com/appengine)"`. + # This header can be modified, but Cloud Tasks will append + # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + # modified `User-Agent`. + # + # If the task has a + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#body body}, Cloud Tasks + # sets the following headers: + # + # * `Content-Type`: By default, the `Content-Type` header is set to + # `"application/octet-stream"`. The default can be overridden by explicitly + # setting `Content-Type` to a particular media type when the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. + # For example, `Content-Type` can be set to `"application/json"`. + # * `Content-Length`: This is computed by Cloud Tasks. This value is + # output only. It cannot be changed. + # + # The headers below cannot be set or overridden: + # + # * `Host` + # * `X-Google-*` + # * `X-AppEngine-*` + # + # In addition, Cloud Tasks sets some headers when the task is dispatched, + # such as headers containing information about the task; see + # [request + # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). + # These headers are set only when the task is dispatched, so they are not + # visible when the task is returned in a Cloud Tasks response. + # + # Although there is no specific limit for the maximum number of headers or + # the size, there is a limit on the maximum size of the + # {::Google::Cloud::Tasks::V2beta3::Task Task}. For more information, see the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} + # documentation. + # @!attribute [rw] body + # @return [::String] + # HTTP request body. + # + # A request body is allowed only if the HTTP method is POST or PUT. It is + # an error to set a body on a task with an incompatible + # {::Google::Cloud::Tasks::V2beta3::HttpMethod HttpMethod}. + class AppEngineHttpRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # App Engine Routing. + # + # Defines routing characteristics specific to App Engine - service, version, + # and instance. + # + # For more information about services, versions, and instances see + # [An Overview of App + # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), + # [Microservices Architecture on Google App + # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] service + # @return [::String] + # App service. + # + # By default, the task is sent to the service which is the default + # service when the task is attempted. + # + # For some queues or tasks which were created using the App Engine + # Task Queue API, {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is + # not parsable into + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. For + # example, some tasks which were created using the App Engine SDK use a + # custom domain name; custom domains are not parsed by Cloud Tasks. If + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable, + # then {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance} are the + # empty string. + # @!attribute [rw] version + # @return [::String] + # App version. + # + # By default, the task is sent to the version which is the default + # version when the task is attempted. + # + # For some queues or tasks which were created using the App Engine + # Task Queue API, {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is + # not parsable into + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. For + # example, some tasks which were created using the App Engine SDK use a + # custom domain name; custom domains are not parsed by Cloud Tasks. If + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable, + # then {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance} are the + # empty string. + # @!attribute [rw] instance + # @return [::String] + # App instance. + # + # By default, the task is sent to an instance which is available when + # the task is attempted. + # + # Requests can only be sent to a specific instance if + # [manual scaling is used in App Engine + # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + # App Engine Flex does not support instances. For more information, see + # [App Engine Standard request + # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) + # and [App Engine Flex request + # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). + # @!attribute [rw] host + # @return [::String] + # Output only. The host that the task is sent to. + # + # The host is constructed from the domain name of the app associated with + # the queue's project ID (for example .appspot.com), and the + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and + # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. Tasks + # which were created using the App Engine SDK might have a custom domain + # name. + # + # For more information, see + # [How Requests are + # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). + class AppEngineRouting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). + # This type of authorization should generally only be used when calling Google + # APIs hosted on *.googleapis.com. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OAuth token. + # The service account must be within the same project as the queue. The + # caller must have iam.serviceAccounts.actAs permission for the service + # account. + # @!attribute [rw] scope + # @return [::String] + # OAuth scope to be used for generating OAuth access token. + # If not specified, "https://www.googleapis.com/auth/cloud-platform" + # will be used. + class OAuthToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information needed for generating an + # [OpenID Connect + # token](https://developers.google.com/identity/protocols/OpenIDConnect). + # This type of authorization can be used for many scenarios, including + # calling Cloud Run, or endpoints where you intend to validate the token + # yourself. + # @!attribute [rw] service_account_email + # @return [::String] + # [Service account email](https://cloud.google.com/iam/docs/service-accounts) + # to be used for generating OIDC token. + # The service account must be within the same project as the queue. The + # caller must have iam.serviceAccounts.actAs permission for the service + # account. + # @!attribute [rw] audience + # @return [::String] + # Audience to be used when generating OIDC token. If not specified, the URI + # specified in target will be used. + class OidcToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The HTTP method used to execute the task. + module HttpMethod + # HTTP method unspecified + HTTP_METHOD_UNSPECIFIED = 0 + + # HTTP POST + POST = 1 + + # HTTP GET + GET = 2 + + # HTTP HEAD + HEAD = 3 + + # HTTP PUT + PUT = 4 + + # HTTP DELETE + DELETE = 5 + + # HTTP PATCH + PATCH = 6 + + # HTTP OPTIONS + OPTIONS = 7 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb new file mode 100644 index 000000000000..b412727c1c81 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb @@ -0,0 +1,213 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + module V2beta3 + # A unit of scheduled work. + # @!attribute [rw] name + # @return [::String] + # Optionally caller-specified in + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}. + # + # The task name. + # + # The task name must have the following format: + # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + # + # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), colons (:), or periods (.). + # For more information, see + # [Identifying + # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) + # * `LOCATION_ID` is the canonical ID for the task's location. + # The list of available locations can be obtained by calling + # [ListLocations][google.cloud.location.Locations.ListLocations]. + # For more information, see https://cloud.google.com/about/locations/. + # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or + # hyphens (-). The maximum length is 100 characters. + # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), + # hyphens (-), or underscores (_). The maximum length is 500 characters. + # @!attribute [rw] app_engine_http_request + # @return [::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest] + # HTTP request that is sent to the App Engine app handler. + # + # An App Engine task is a task that has + # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} + # set. + # + # Note: The following fields are mutually exclusive: `app_engine_http_request`, `http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] http_request + # @return [::Google::Cloud::Tasks::V2beta3::HttpRequest] + # HTTP request that is sent to the task's target. + # + # An HTTP task is a task that has + # {::Google::Cloud::Tasks::V2beta3::HttpRequest HttpRequest} set. + # + # Note: The following fields are mutually exclusive: `http_request`, `app_engine_http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] pull_message + # @return [::Google::Cloud::Tasks::V2beta3::PullMessage] + # Pull Message contained in a task in a + # {::Google::Cloud::Tasks::V2beta3::Queue#type PULL} queue type. This payload + # type cannot be explicitly set through Cloud Tasks API. Its purpose, + # currently is to provide backward compatibility with App Engine Task Queue + # [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) + # queues to provide a way to inspect contents of pull tasks through the + # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task CloudTasks.GetTask}. + # + # Note: The following fields are mutually exclusive: `pull_message`, `app_engine_http_request`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # The time when the task is scheduled to be attempted. + # + # For App Engine queues, this is when the task will be attempted or retried. + # + # `schedule_time` will be truncated to the nearest microsecond. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that the task was created. + # + # `create_time` will be truncated to the nearest second. + # @!attribute [rw] dispatch_deadline + # @return [::Google::Protobuf::Duration] + # The deadline for requests sent to the worker. If the worker does not + # respond by this deadline then the request is cancelled and the attempt + # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the + # task according to the + # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}. + # + # Note that when the request is cancelled, Cloud Tasks will stop listening + # for the response, but whether the worker stops processing depends on the + # worker. For example, if the worker is stuck, it may not react to cancelled + # requests. + # + # The default and maximum values depend on the type of request: + # + # * For {::Google::Cloud::Tasks::V2beta3::HttpRequest HTTP tasks}, the default is + # 10 minutes. The deadline + # must be in the interval [15 seconds, 30 minutes]. + # + # * For {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest App Engine tasks}, + # 0 indicates that the + # request has the default deadline. The default deadline depends on the + # [scaling + # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) + # of the service: 10 minutes for standard apps with automatic scaling, 24 + # hours for standard apps with manual and basic scaling, and 60 minutes for + # flex apps. If the request deadline is set, it must be in the interval [15 + # seconds, 24 hours 15 seconds]. Regardless of the task's + # `dispatch_deadline`, the app handler will not run for longer than than + # the service's timeout. We recommend setting the `dispatch_deadline` to + # at most a few seconds more than the app handler's timeout. For more + # information see + # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). + # + # `dispatch_deadline` will be truncated to the nearest millisecond. The + # deadline is an approximate deadline. + # @!attribute [rw] dispatch_count + # @return [::Integer] + # Output only. The number of attempts dispatched. + # + # This count includes attempts which have been dispatched but haven't + # received a response. + # @!attribute [rw] response_count + # @return [::Integer] + # Output only. The number of attempts which have received a response. + # @!attribute [rw] first_attempt + # @return [::Google::Cloud::Tasks::V2beta3::Attempt] + # Output only. The status of the task's first attempt. + # + # Only {::Google::Cloud::Tasks::V2beta3::Attempt#dispatch_time dispatch_time} will + # be set. The other {::Google::Cloud::Tasks::V2beta3::Attempt Attempt} information + # is not retained by Cloud Tasks. + # @!attribute [rw] last_attempt + # @return [::Google::Cloud::Tasks::V2beta3::Attempt] + # Output only. The status of the task's last attempt. + # @!attribute [rw] view + # @return [::Google::Cloud::Tasks::V2beta3::Task::View] + # Output only. The view specifies which subset of the + # {::Google::Cloud::Tasks::V2beta3::Task Task} has been returned. + class Task + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The view specifies a subset of {::Google::Cloud::Tasks::V2beta3::Task Task} + # data. + # + # When a task is returned in a response, not all + # information is retrieved by default because some data, such as + # payloads, might be desirable to return only when needed because + # of its large size or because of the sensitivity of data that it + # contains. + module View + # Unspecified. Defaults to BASIC. + VIEW_UNSPECIFIED = 0 + + # The basic view omits fields which can be large or can contain + # sensitive data. + # + # This view does not include the + # [body in + # AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body]. + # Bodies are desirable to return only when needed, because they + # can be large and because of the sensitivity of the data that you + # choose to store in it. + BASIC = 1 + + # All information is returned. + # + # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} + # requires `cloudtasks.tasks.fullView` [Google + # IAM](https://cloud.google.com/iam/) permission on the + # {::Google::Cloud::Tasks::V2beta3::Queue Queue} resource. + FULL = 2 + end + end + + # The status of a task attempt. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt was scheduled. + # + # `schedule_time` will be truncated to the nearest microsecond. + # @!attribute [rw] dispatch_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt was dispatched. + # + # `dispatch_time` will be truncated to the nearest microsecond. + # @!attribute [rw] response_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time that this attempt response was received. + # + # `response_time` will be truncated to the nearest microsecond. + # @!attribute [rw] response_status + # @return [::Google::Rpc::Status] + # Output only. The response from the worker for this attempt. + # + # If `response_time` is unset, then the task has not been attempted or is + # currently running and the `response_status` field is meaningless. + class Attempt + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/snippets/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile new file mode 100644 index 000000000000..b6cbdf612a3b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3", path: "../" +else + gem "google-cloud-tasks-v2beta3" +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-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb new file mode 100644 index 000000000000..9d315fa5fb2a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the create_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#create_queue. +# +def create_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new + + # Call the create_queue method. + result = client.create_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb new file mode 100644 index 000000000000..1307bbaa425c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the create_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#create_task. +# +def create_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new + + # Call the create_task method. + result = client.create_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb new file mode 100644 index 000000000000..32780452f076 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the delete_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#delete_queue. +# +def delete_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new + + # Call the delete_queue method. + result = client.delete_queue request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb new file mode 100644 index 000000000000..2e14ac7238d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the delete_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#delete_task. +# +def delete_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new + + # Call the delete_task method. + result = client.delete_task request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb new file mode 100644 index 000000000000..b67132daf33c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the get_iam_policy call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb new file mode 100644 index 000000000000..6a08e7775a37 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the get_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#get_queue. +# +def get_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new + + # Call the get_queue method. + result = client.get_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb new file mode 100644 index 000000000000..7601d4c33b48 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the get_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#get_task. +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new + + # Call the get_task method. + result = client.get_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb new file mode 100644 index 000000000000..221826aa161c --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the list_queues call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#list_queues. +# +def list_queues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new + + # Call the list_queues method. + result = client.list_queues 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::Tasks::V2beta3::Queue. + p item + end +end +# [END cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb new file mode 100644 index 000000000000..e3e486644e66 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the list_tasks call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#list_tasks. +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new + + # Call the list_tasks method. + result = client.list_tasks 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::Tasks::V2beta3::Task. + p item + end +end +# [END cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb new file mode 100644 index 000000000000..d2ece1b4633a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the pause_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#pause_queue. +# +def pause_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new + + # Call the pause_queue method. + result = client.pause_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb new file mode 100644 index 000000000000..0948654d23db --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the purge_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#purge_queue. +# +def purge_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new + + # Call the purge_queue method. + result = client.purge_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb new file mode 100644 index 000000000000..e22638c37139 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the resume_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#resume_queue. +# +def resume_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new + + # Call the resume_queue method. + result = client.resume_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb new file mode 100644 index 000000000000..dae7f35f5236 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the run_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#run_task. +# +def run_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new + + # Call the run_task method. + result = client.run_task request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb new file mode 100644 index 000000000000..f83897ede198 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the set_iam_policy call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb new file mode 100644 index 000000000000..ee6f4a9fcbc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the test_iam_permissions call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb new file mode 100644 index 000000000000..cc52805757c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] +require "google/cloud/tasks/v2beta3" + +## +# Snippet for the update_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#update_queue. +# +def update_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new + + # Call the update_queue method. + result = client.update_queue request + + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end +# [END cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json new file mode 100644 index 000000000000..7d11f956527e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json @@ -0,0 +1,655 @@ +{ + "client_library": { + "name": "google-cloud-tasks-v2beta3", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.tasks.v2beta3", + "version": "v2beta3" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync", + "title": "Snippet for the list_queues call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues.", + "file": "cloud_tasks/list_queues.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_queues", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::ListQueuesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::ListQueuesResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "ListQueues", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.ListQueues", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync", + "title": "Snippet for the get_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue.", + "file": "cloud_tasks/get_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_queue", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::GetQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "GetQueue", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.GetQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync", + "title": "Snippet for the create_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue.", + "file": "cloud_tasks/create_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_queue", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::CreateQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "CreateQueue", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.CreateQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync", + "title": "Snippet for the update_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue.", + "file": "cloud_tasks/update_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_queue", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "UpdateQueue", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync", + "title": "Snippet for the delete_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue.", + "file": "cloud_tasks/delete_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_queue", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "DeleteQueue", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync", + "title": "Snippet for the purge_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue.", + "file": "cloud_tasks/purge_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_queue", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "PurgeQueue", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync", + "title": "Snippet for the pause_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue.", + "file": "cloud_tasks/pause_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_queue", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::PauseQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "PauseQueue", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.PauseQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync", + "title": "Snippet for the resume_queue call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue.", + "file": "cloud_tasks/resume_queue.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_queue", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "ResumeQueue", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_iam_policy.", + "file": "cloud_tasks/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicy", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#set_iam_policy.", + "file": "cloud_tasks/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicy", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#test_iam_permissions.", + "file": "cloud_tasks/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissions", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync", + "title": "Snippet for the list_tasks call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks.", + "file": "cloud_tasks/list_tasks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tasks", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::ListTasksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::ListTasksResponse", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "ListTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.ListTasks", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync", + "title": "Snippet for the get_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task.", + "file": "cloud_tasks/get_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_task", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::GetTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "GetTask", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.GetTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync", + "title": "Snippet for the create_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task.", + "file": "cloud_tasks/create_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_task", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::CreateTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "CreateTask", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.CreateTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync", + "title": "Snippet for the delete_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task.", + "file": "cloud_tasks/delete_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_task", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "DeleteTask", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.DeleteTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync", + "title": "Snippet for the run_task call in the CloudTasks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task.", + "file": "cloud_tasks/run_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_task", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tasks::V2beta3::RunTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tasks::V2beta3::Task", + "client": { + "short_name": "CloudTasks::Client", + "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" + }, + "method": { + "short_name": "RunTask", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks.RunTask", + "service": { + "short_name": "CloudTasks", + "full_name": "google.cloud.tasks.v2beta3.CloudTasks" + } + } + }, + "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-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb new file mode 100644 index 000000000000..664ebc6b1b18 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloud_tasks" + +class ::Google::Cloud::Tasks::V2beta3::CloudTasks::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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::Tasks::V2beta3::CloudTasks::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_queue_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.queue_path project: "value0", location: "value1", queue: "value2" + assert_equal "projects/value0/locations/value1/queues/value2", path + end + end + + def test_task_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.task_path project: "value0", location: "value1", queue: "value2", task: "value3" + assert_equal "projects/value0/locations/value1/queues/value2/tasks/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb new file mode 100644 index 000000000000..34a301c32a3d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb @@ -0,0 +1,981 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" +require "google/cloud/tasks/v2beta3/cloud_tasks/rest" + + +class ::Google::Cloud::Tasks::V2beta3::CloudTasks::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_queues + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + read_mask = {} + + list_queues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_list_queues_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_queues_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_queues ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_queues(::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_queues_client_stub.call_count + end + end + end + + def test_get_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + read_mask = {} + + get_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_get_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_queue({ name: name, read_mask: read_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_queue name: name, read_mask: read_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_queue ::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_queue({ name: name, read_mask: read_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_queue(::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_queue_client_stub.call_count + end + end + end + + def test_create_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + queue = {} + + create_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_create_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_queue({ parent: parent, queue: queue }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_queue parent: parent, queue: queue do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_queue ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_queue({ parent: parent, queue: queue }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_queue(::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_queue_client_stub.call_count + end + end + end + + def test_update_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + queue = {} + update_mask = {} + + update_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_update_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_queue({ queue: queue, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_queue queue: queue, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_queue ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_queue({ queue: queue, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_queue(::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_queue_client_stub.call_count + end + end + end + + def test_delete_queue + # 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_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_delete_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_queue ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_queue(::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_queue_client_stub.call_count + end + end + end + + def test_purge_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + purge_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_purge_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_queue ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_queue(::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_queue_client_stub.call_count + end + end + end + + def test_pause_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + pause_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_pause_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_queue ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_queue(::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_queue_client_stub.call_count + end + end + end + + def test_resume_queue + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + resume_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_resume_queue_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_queue({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_queue name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_queue ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_queue({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_queue(::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_queue_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_list_tasks + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + response_view = :VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tasks({ parent: parent, response_view: response_view, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tasks parent: parent, response_view: response_view, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tasks ::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_count + end + end + end + + def test_get_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + response_view = :VIEW_UNSPECIFIED + + get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_task({ name: name, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_task name: name, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_task ::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_task({ name: name, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_count + end + end + end + + def test_create_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + task = {} + response_view = :VIEW_UNSPECIFIED + + create_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_create_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_task({ parent: parent, task: task, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_task parent: parent, task: task, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_task ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_task({ parent: parent, task: task, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_task(::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_task_client_stub.call_count + end + end + end + + def test_delete_task + # 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_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_delete_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_task({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_task name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_task ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_task({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_task(::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_task_client_stub.call_count + end + end + end + + def test_run_task + # Create test objects. + client_result = ::Google::Cloud::Tasks::V2beta3::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + response_view = :VIEW_UNSPECIFIED + + run_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_run_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_task({ name: name, response_view: response_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_task name: name, response_view: response_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_task ::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_task({ name: name, response_view: response_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_task(::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_task_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::Tasks::V2beta3::CloudTasks::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::Tasks::V2beta3::CloudTasks::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb new file mode 100644 index 000000000000..f2365c3dd2eb --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb @@ -0,0 +1,1078 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" +require "google/cloud/tasks/v2beta3/cloud_tasks" + +class ::Google::Cloud::Tasks::V2beta3::CloudTasks::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_queues + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + read_mask = {} + + list_queues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_queues, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_queues_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) 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_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask 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_queues ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) 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_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, 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_queues(::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), 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_queues_client_stub.call_rpc_count + end + end + + def test_get_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" + read_mask = {} + + get_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::GetQueueRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_queue({ name: name, read_mask: read_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_queue name: name, read_mask: read_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_queue ::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_queue({ name: name, read_mask: read_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_queue(::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_queue_client_stub.call_rpc_count + end + end + + def test_create_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" + queue = {} + + create_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta3::Queue), request["queue"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_queue({ parent: parent, queue: queue }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_queue parent: parent, queue: queue do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_queue ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_queue({ parent: parent, queue: queue }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_queue(::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_queue_client_stub.call_rpc_count + end + end + + def test_update_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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. + queue = {} + update_mask = {} + + update_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta3::Queue), request["queue"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_queue({ queue: queue, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_queue queue: queue, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_queue ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, 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_queue({ queue: queue, 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_queue(::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, 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_queue_client_stub.call_rpc_count + end + end + + def test_delete_queue + # 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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_queue ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_queue({ 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_queue(::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.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_queue_client_stub.call_rpc_count + end + end + + def test_purge_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" + + purge_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.purge_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.purge_queue ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.purge_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.purge_queue(::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.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, purge_queue_client_stub.call_rpc_count + end + end + + def test_pause_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" + + pause_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_queue ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.pause_queue(::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.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, pause_queue_client_stub.call_rpc_count + end + end + + def test_resume_queue + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" + + resume_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_queue, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_queue_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_queue({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_queue name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_queue ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_queue({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resume_queue(::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.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, resume_queue_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_list_tasks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.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" + response_view = :VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tasks, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::ListTasksRequest, request + assert_equal "hello world", request["parent"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tasks({ parent: parent, response_view: response_view, 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_tasks parent: parent, response_view: response_view, 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_tasks ::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_rpc_count + end + end + + def test_get_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Task.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" + response_view = :VIEW_UNSPECIFIED + + get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::GetTaskRequest, request + assert_equal "hello world", request["name"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_task({ name: name, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_task name: name, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_task ::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_rpc_count + end + end + + def test_create_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Task.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" + task = {} + response_view = :VIEW_UNSPECIFIED + + create_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta3::Task), request["task"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_task({ parent: parent, task: task, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_task parent: parent, task: task, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_task ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_task({ parent: parent, task: task, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_task(::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_task_client_stub.call_rpc_count + end + end + + def test_delete_task + # 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_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_task({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_task name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_task ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_task({ 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_task(::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.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_task_client_stub.call_rpc_count + end + end + + def test_run_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tasks::V2beta3::Task.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" + response_view = :VIEW_UNSPECIFIED + + run_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_task, name + assert_kind_of ::Google::Cloud::Tasks::V2beta3::RunTaskRequest, request + assert_equal "hello world", request["name"] + assert_equal :VIEW_UNSPECIFIED, request["response_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_task_client_stub do + # Create client + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_task({ name: name, response_view: response_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_task name: name, response_view: response_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_task ::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_task(::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_task_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::Tasks::V2beta3::CloudTasks::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::Tasks::V2beta3::CloudTasks::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks/.gitignore b/owl-bot-staging/google-cloud-tasks/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/.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-tasks/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks/.repo-metadata.json new file mode 100644 index 000000000000..4e9d979cb67d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudtasks.googleapis.com", + "api_shortname": "cloudtasks", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks/latest", + "distribution_name": "google-cloud-tasks", + "is_cloud": true, + "language": "ruby", + "name": "cloudtasks", + "name_pretty": "Cloud Tasks API", + "product_documentation": "https://cloud.google.com/tasks", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint.", + "ruby-cloud-env-prefix": "TASKS", + "ruby-cloud-product-url": "https://cloud.google.com/tasks", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-tasks/.rubocop.yml b/owl-bot-staging/google-cloud-tasks/.rubocop.yml new file mode 100644 index 000000000000..c07b01625905 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-tasks.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-tasks.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-tasks/.toys.rb b/owl-bot-staging/google-cloud-tasks/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks/.yardopts b/owl-bot-staging/google-cloud-tasks/.yardopts new file mode 100644 index 000000000000..2b302fd18f8d --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Cloud Tasks API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md new file mode 100644 index 000000000000..5f0d0f4d1e7e --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-tasks 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-tasks 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/tasks" + +client = Google::Cloud::Tasks.cloud_tasks do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/tasks" + +Google::Cloud::Tasks.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Tasks.cloud_tasks +``` + +### 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-tasks +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/tasks" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Tasks.cloud_tasks +``` + +### 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-tasks/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-tasks/Gemfile b/owl-bot-staging/google-cloud-tasks/Gemfile new file mode 100644 index 000000000000..e00b46b52de6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-tasks-v2"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-tasks.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.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-tasks/LICENSE.md b/owl-bot-staging/google-cloud-tasks/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/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-tasks/README.md b/owl-bot-staging/google-cloud-tasks/README.md new file mode 100644 index 000000000000..8934af5f1638 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Cloud Tasks API + +API Client library for the Cloud Tasks API + +Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-tasks-v*`. +The gem `google-cloud-tasks` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks/latest) +for this library, google-cloud-tasks, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-tasks-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest). + +See also the [Product Documentation](https://cloud.google.com/tasks) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-tasks +``` + +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/cloudtasks.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/tasks" + +client = Google::Cloud::Tasks.cloud_tasks +request = ::Google::Cloud::Tasks::V2::ListQueuesRequest.new # (request fields as keyword arguments...) +response = client.list_queues request +``` + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-tasks-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +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-tasks`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-tasks-v2`. +_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-tasks`. +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-tasks-v2`. + +### 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-tasks/Rakefile b/owl-bot-staging/google-cloud-tasks/Rakefile new file mode 100644 index 000000000000..e99b19a2d841 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true +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-tasks acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TASKS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TASKS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/tasks/v2/cloud_tasks/credentials" + ::Google::Cloud::Tasks::V2::CloudTasks::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TASKS_PROJECT"] = project + ENV["TASKS_TEST_PROJECT"] = project + ENV["TASKS_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-tasks 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-tasks 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-tasks 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-tasks gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-tasks" + header "google-cloud-tasks rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-tasks yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-tasks 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-tasks 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-tasks 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-tasks/google-cloud-tasks.gemspec b/owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec new file mode 100644 index 000000000000..253fbf39f050 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/tasks/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-tasks" + gem.version = Google::Cloud::Tasks::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint." + gem.summary = "API Client library for the Cloud Tasks API" + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-tasks-v2", "~> 1.2" +end diff --git a/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb b/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb new file mode 100644 index 000000000000..df59ff14f098 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks" unless defined? Google::Cloud::Tasks::VERSION diff --git a/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb new file mode 100644 index 000000000000..592f1b9b9a67 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/tasks/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :tasks do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Tasks + ## + # Create a new client object for CloudTasks. + # + # By default, this returns an instance of + # [Google::Cloud::Tasks::V2::CloudTasks::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest/Google-Cloud-Tasks-V2-CloudTasks-Client) + # for a gRPC client for version V2 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the CloudTasks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the CloudTasks service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Tasks.cloud_tasks_available?}. + # + # ## About CloudTasks + # + # Cloud Tasks allows developers to manage the execution of background + # work in their applications. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.cloud_tasks version: :v2, transport: :grpc, &block + require "google/cloud/tasks/#{version.to_s.downcase}" + + package_name = Google::Cloud::Tasks + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Tasks.const_get(package_name).const_get(:CloudTasks) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the CloudTasks service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Tasks.cloud_tasks}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the CloudTasks service, + # or if the versioned client gem needs an update to support the CloudTasks service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.cloud_tasks_available? version: :v2, transport: :grpc + require "google/cloud/tasks/#{version.to_s.downcase}" + package_name = Google::Cloud::Tasks + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Tasks.const_get package_name + return false unless service_module.const_defined? :CloudTasks + service_module = service_module.const_get :CloudTasks + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-tasks library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.tasks if block_given? + + ::Google::Cloud.configure.tasks + end + end + end +end + +helper_path = ::File.join __dir__, "tasks", "helpers.rb" +require "google/cloud/tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb new file mode 100644 index 000000000000..118a7f73c05a --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb b/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb new file mode 100644 index 000000000000..2ecc1556262b --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tasks" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Tasks::ClientConstructionMinitest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_cloud_tasks_grpc + skip unless Google::Cloud::Tasks.cloud_tasks_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Tasks.cloud_tasks transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Tasks::V2::CloudTasks::Client, client + end + end + + def test_cloud_tasks_rest + skip unless Google::Cloud::Tasks.cloud_tasks_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Tasks.cloud_tasks transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Tasks::V2::CloudTasks::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb b/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb new file mode 100644 index 000000000000..c09f853a2397 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tasks/version" + +class Google::Cloud::Tasks::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Tasks::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-tasks/test/helper.rb b/owl-bot-staging/google-cloud-tasks/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tasks/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/.gitignore b/owl-bot-staging/google-cloud-telco_automation-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-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-telco_automation-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-telco_automation-v1/.repo-metadata.json new file mode 100644 index 000000000000..6fa8f0fd2fc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "telcoautomation.googleapis.com", + "api_shortname": "telcoautomation", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest", + "distribution_name": "google-cloud-telco_automation-v1", + "is_cloud": true, + "language": "ruby", + "name": "telcoautomation", + "name_pretty": "Telco Automation V1 API", + "product_documentation": "https://cloud.google.com/telecom-network-automation", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "APIs to automate management of cloud infrastructure for network functions. Note that google-cloud-telco_automation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-telco_automation instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/telecom-network-automation", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml b/owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml new file mode 100644 index 000000000000..d6fc34a05a64 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-telco_automation-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-telco_automation-v1.rb" diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb b/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/.yardopts b/owl-bot-staging/google-cloud-telco_automation-v1/.yardopts new file mode 100644 index 000000000000..74eef8dd924a --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Telco Automation 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-telco_automation-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-telco_automation-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..15c5b59bafcf --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-telco_automation-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-telco_automation-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/telco_automation/v1" + +client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/telco_automation/v1" + +::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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-telco_automation-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/telco_automation/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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-telco_automation-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-telco_automation-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile b/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-telco_automation-v1/LICENSE.md b/owl-bot-staging/google-cloud-telco_automation-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-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-telco_automation-v1/README.md b/owl-bot-staging/google-cloud-telco_automation-v1/README.md new file mode 100644 index 000000000000..f64067ee0d10 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Telco Automation V1 API + +APIs to automate management of cloud infrastructure for network functions. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Telco Automation V1 API. Most users should consider using +the main client gem, +[google-cloud-telco_automation](https://rubygems.org/gems/google-cloud-telco_automation). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-telco_automation-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/telcoautomation.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/telco_automation/v1" + +client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new +request = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new # (request fields as keyword arguments...) +response = client.list_orchestration_clusters request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/telecom-network-automation) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/telco_automation/v1" +require "logger" + +client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-telco_automation`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-telco_automation-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-telco_automation`. +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-telco_automation-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-telco_automation-v1/Rakefile b/owl-bot-staging/google-cloud-telco_automation-v1/Rakefile new file mode 100644 index 000000000000..2264fb9ae7a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/telco_automation/v1/telco_automation/credentials" + ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-telco_automation-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-telco_automation-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-telco_automation-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-telco_automation-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-telco_automation-v1" + header "google-cloud-telco_automation-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-telco_automation-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-telco_automation-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-telco_automation-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-telco_automation-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-telco_automation-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-telco_automation-v1/gapic_metadata.json new file mode 100644 index 000000000000..f7243c38771e --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/gapic_metadata.json @@ -0,0 +1,198 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.telcoautomation.v1", + "libraryPackage": "::Google::Cloud::TelcoAutomation::V1", + "services": { + "TelcoAutomation": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client", + "rpcs": { + "ListOrchestrationClusters": { + "methods": [ + "list_orchestration_clusters" + ] + }, + "GetOrchestrationCluster": { + "methods": [ + "get_orchestration_cluster" + ] + }, + "CreateOrchestrationCluster": { + "methods": [ + "create_orchestration_cluster" + ] + }, + "DeleteOrchestrationCluster": { + "methods": [ + "delete_orchestration_cluster" + ] + }, + "ListEdgeSlms": { + "methods": [ + "list_edge_slms" + ] + }, + "GetEdgeSlm": { + "methods": [ + "get_edge_slm" + ] + }, + "CreateEdgeSlm": { + "methods": [ + "create_edge_slm" + ] + }, + "DeleteEdgeSlm": { + "methods": [ + "delete_edge_slm" + ] + }, + "CreateBlueprint": { + "methods": [ + "create_blueprint" + ] + }, + "UpdateBlueprint": { + "methods": [ + "update_blueprint" + ] + }, + "GetBlueprint": { + "methods": [ + "get_blueprint" + ] + }, + "DeleteBlueprint": { + "methods": [ + "delete_blueprint" + ] + }, + "ListBlueprints": { + "methods": [ + "list_blueprints" + ] + }, + "ApproveBlueprint": { + "methods": [ + "approve_blueprint" + ] + }, + "ProposeBlueprint": { + "methods": [ + "propose_blueprint" + ] + }, + "RejectBlueprint": { + "methods": [ + "reject_blueprint" + ] + }, + "ListBlueprintRevisions": { + "methods": [ + "list_blueprint_revisions" + ] + }, + "SearchBlueprintRevisions": { + "methods": [ + "search_blueprint_revisions" + ] + }, + "SearchDeploymentRevisions": { + "methods": [ + "search_deployment_revisions" + ] + }, + "DiscardBlueprintChanges": { + "methods": [ + "discard_blueprint_changes" + ] + }, + "ListPublicBlueprints": { + "methods": [ + "list_public_blueprints" + ] + }, + "GetPublicBlueprint": { + "methods": [ + "get_public_blueprint" + ] + }, + "CreateDeployment": { + "methods": [ + "create_deployment" + ] + }, + "UpdateDeployment": { + "methods": [ + "update_deployment" + ] + }, + "GetDeployment": { + "methods": [ + "get_deployment" + ] + }, + "RemoveDeployment": { + "methods": [ + "remove_deployment" + ] + }, + "ListDeployments": { + "methods": [ + "list_deployments" + ] + }, + "ListDeploymentRevisions": { + "methods": [ + "list_deployment_revisions" + ] + }, + "DiscardDeploymentChanges": { + "methods": [ + "discard_deployment_changes" + ] + }, + "ApplyDeployment": { + "methods": [ + "apply_deployment" + ] + }, + "ComputeDeploymentStatus": { + "methods": [ + "compute_deployment_status" + ] + }, + "RollbackDeployment": { + "methods": [ + "rollback_deployment" + ] + }, + "GetHydratedDeployment": { + "methods": [ + "get_hydrated_deployment" + ] + }, + "ListHydratedDeployments": { + "methods": [ + "list_hydrated_deployments" + ] + }, + "UpdateHydratedDeployment": { + "methods": [ + "update_hydrated_deployment" + ] + }, + "ApplyHydratedDeployment": { + "methods": [ + "apply_hydrated_deployment" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec b/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec new file mode 100644 index 000000000000..430444fcf8a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/telco_automation/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-telco_automation-v1" + gem.version = Google::Cloud::TelcoAutomation::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "APIs to automate management of cloud infrastructure for network functions. Note that google-cloud-telco_automation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-telco_automation instead. See the readme for more details." + gem.summary = "APIs to automate management of cloud infrastructure for network functions." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb new file mode 100644 index 000000000000..259caf3da82e --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1" diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb new file mode 100644 index 000000000000..8ead8612208c --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/telco_automation" +require "google/cloud/telco_automation/v1/version" + +module Google + module Cloud + module TelcoAutomation + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/telco_automation/v1" + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/telco_automation/v1" + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/telco_automation/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb new file mode 100644 index 000000000000..df522790e2b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" + +module Google + module Cloud + module TelcoAutomation + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/telco_automation/v1/rest" + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "TelcoAutomation"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb new file mode 100644 index 000000000000..51f472690194 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/telco_automation/rest" +require "google/cloud/telco_automation/v1/bindings_override" +require "google/cloud/telco_automation/v1/version" + +module Google + module Cloud + module TelcoAutomation + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/telco_automation/v1/rest" + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb new file mode 100644 index 000000000000..2fe22c8a42e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/version" + +require "google/cloud/telco_automation/v1/telco_automation/credentials" +require "google/cloud/telco_automation/v1/telco_automation/paths" +require "google/cloud/telco_automation/v1/telco_automation/operations" +require "google/cloud/telco_automation/v1/telco_automation/client" +require "google/cloud/telco_automation/v1/telco_automation/rest" + +module Google + module Cloud + module TelcoAutomation + module V1 + ## + # TelcoAutomation Service manages the control plane cluster a.k.a. + # Orchestration Cluster (GKE cluster with config controller) of TNA. It also + # exposes blueprint APIs which manages the lifecycle of blueprints that control + # the infrastructure setup (e.g GDCE clusters) and deployment of network + # functions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/telco_automation/v1/telco_automation" + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/telco_automation/v1/telco_automation/rest" + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + module TelcoAutomation + end + end + end + end +end + +helper_path = ::File.join __dir__, "telco_automation", "helpers.rb" +require "google/cloud/telco_automation/v1/telco_automation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb new file mode 100644 index 000000000000..47ef08d71fa1 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb @@ -0,0 +1,4039 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" +require "google/cloud/location" + +module Google + module Cloud + module TelcoAutomation + module V1 + module TelcoAutomation + ## + # Client for the TelcoAutomation service. + # + # TelcoAutomation Service manages the control plane cluster a.k.a. + # Orchestration Cluster (GKE cluster with config controller) of TNA. It also + # exposes blueprint APIs which manages the lifecycle of blueprints that control + # the infrastructure setup (e.g GDCE clusters) and deployment of network + # functions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :telco_automation_stub + + ## + # Configure the TelcoAutomation Client class. + # + # See {::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TelcoAutomation clients + # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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", "TelcoAutomation", "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 TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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 + @telco_automation_stub.universe_domain + end + + ## + # Create a new TelcoAutomation client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TelcoAutomation 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/telcoautomation/v1/telcoautomation_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 + + @telco_automation_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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, + logger: @config.logger + ) + + @telco_automation_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @telco_automation_stub.endpoint + config.universe_domain = @telco_automation_stub.universe_domain + config.logger = @telco_automation_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @telco_automation_stub.logger + end + + # Service calls + + ## + # Lists OrchestrationClusters in a given project and location. + # + # @overload list_orchestration_clusters(request, options = nil) + # Pass arguments to `list_orchestration_clusters` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_orchestration_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 parent [::String] + # Required. Parent value for ListOrchestrationClustersRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new + # + # # Call the list_orchestration_clusters method. + # result = client.list_orchestration_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::TelcoAutomation::V1::OrchestrationCluster. + # p item + # end + # + def list_orchestration_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_orchestration_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_orchestration_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_orchestration_clusters, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single OrchestrationCluster. + # + # @overload get_orchestration_cluster(request, options = nil) + # Pass arguments to `get_orchestration_cluster` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil) + # Pass arguments to `get_orchestration_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 name [::String] + # Required. Name of the resource + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new + # + # # Call the get_orchestration_cluster method. + # result = client.get_orchestration_cluster request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::OrchestrationCluster. + # p result + # + def get_orchestration_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_orchestration_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :get_orchestration_cluster, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new OrchestrationCluster in a given project and location. + # + # @overload create_orchestration_cluster(request, options = nil) + # Pass arguments to `create_orchestration_cluster` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_cluster(parent: nil, orchestration_cluster_id: nil, orchestration_cluster: nil, request_id: nil) + # Pass arguments to `create_orchestration_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 parent [::String] + # Required. Value for parent. + # @param orchestration_cluster_id [::String] + # Required. Id of the requesting object + # If auto-generating Id server-side, remove this field and + # orchestration_cluster_id from the method_signature of Create RPC + # @param orchestration_cluster [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new + # + # # Call the create_orchestration_cluster method. + # result = client.create_orchestration_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_orchestration_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_orchestration_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :create_orchestration_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single OrchestrationCluster. + # + # @overload delete_orchestration_cluster(request, options = nil) + # Pass arguments to `delete_orchestration_cluster` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_orchestration_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 name [::String] + # Required. Name of the resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.new + # + # # Call the delete_orchestration_cluster method. + # result = client.delete_orchestration_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_orchestration_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_orchestration_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :delete_orchestration_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists EdgeSlms in a given project and location. + # + # @overload list_edge_slms(request, options = nil) + # Pass arguments to `list_edge_slms` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_edge_slms` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListEdgeSlmsRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.new + # + # # Call the list_edge_slms method. + # result = client.list_edge_slms 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::TelcoAutomation::V1::EdgeSlm. + # p item + # end + # + def list_edge_slms request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest + + # Converts hash 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_edge_slms.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::TelcoAutomation::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_edge_slms.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_edge_slms.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_edge_slms, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_edge_slms, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single EdgeSlm. + # + # @overload get_edge_slm(request, options = nil) + # Pass arguments to `get_edge_slm` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slm(name: nil) + # Pass arguments to `get_edge_slm` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new + # + # # Call the get_edge_slm method. + # result = client.get_edge_slm request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::EdgeSlm. + # p result + # + def get_edge_slm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest + + # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_edge_slm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :get_edge_slm, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new EdgeSlm in a given project and location. + # + # @overload create_edge_slm(request, options = nil) + # Pass arguments to `create_edge_slm` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slm(parent: nil, edge_slm_id: nil, edge_slm: nil, request_id: nil) + # Pass arguments to `create_edge_slm` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param edge_slm_id [::String] + # Required. Id of the requesting object + # If auto-generating Id server-side, remove this field and + # edge_slm_id from the method_signature of Create RPC + # @param edge_slm [::Google::Cloud::TelcoAutomation::V1::EdgeSlm, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new + # + # # Call the create_edge_slm method. + # result = client.create_edge_slm 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_edge_slm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest + + # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_edge_slm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :create_edge_slm, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single EdgeSlm. + # + # @overload delete_edge_slm(request, options = nil) + # Pass arguments to `delete_edge_slm` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slm(name: nil, request_id: nil) + # Pass arguments to `delete_edge_slm` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.new + # + # # Call the delete_edge_slm method. + # result = client.delete_edge_slm 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_edge_slm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest + + # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_edge_slm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :delete_edge_slm, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a blueprint. + # + # @overload create_blueprint(request, options = nil) + # Pass arguments to `create_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(parent: nil, blueprint_id: nil, blueprint: nil) + # Pass arguments to `create_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param blueprint_id [::String] + # Optional. The name of the blueprint. + # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] + # Required. The `Blueprint` to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new + # + # # Call the create_blueprint method. + # result = client.create_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def create_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :create_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a blueprint. + # + # @overload update_blueprint(request, options = nil) + # Pass arguments to `update_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(blueprint: nil, update_mask: nil) + # Pass arguments to `update_blueprint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] + # Required. The `blueprint` to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Update mask is used to specify the fields to be overwritten in + # the `blueprint` resource by the update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new + # + # # Call the update_blueprint method. + # result = client.update_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def update_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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.blueprint&.name + header_params["blueprint.name"] = request.blueprint.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_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :update_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested blueprint. + # + # @overload get_blueprint(request, options = nil) + # Pass arguments to `get_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(name: nil, view: nil) + # Pass arguments to `get_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint. + # Case 1: If the name provided in the request is + # \\{blueprint_id}@\\{revision_id}, then the revision with revision_id will be + # returned. Case 2: If the name provided in the request is \\{blueprint}, then + # the current state of the blueprint is returned. + # @param view [::Google::Cloud::TelcoAutomation::V1::BlueprintView] + # Optional. Defines the type of view of the blueprint. + # When field is not present BLUEPRINT_VIEW_BASIC is considered as default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new + # + # # Call the get_blueprint method. + # result = client.get_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def get_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :get_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a blueprint and all its revisions. + # + # @overload delete_blueprint(request, options = nil) + # Pass arguments to `delete_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(name: nil) + # Pass arguments to `delete_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint to delete. + # Blueprint name should be in the format \\{blueprint_id}, if + # \\{blueprint_id}@\\{revision_id} is passed then the API throws invalid + # argument. + # + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new + # + # # Call the delete_blueprint method. + # result = client.delete_blueprint request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :delete_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all blueprints. + # + # @overload list_blueprints(request, options = nil) + # Pass arguments to `list_blueprints` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprints(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_blueprints` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param filter [::String] + # Optional. Filtering only supports equality on blueprint state. + # It should be in the form: "state = DRAFT". `OR` operator can be used to + # get response for multiple states. e.g. "state = DRAFT OR state = PROPOSED". + # @param page_size [::Integer] + # Optional. The maximum number of blueprints to return per page. + # @param page_token [::String] + # Optional. The page token, received from a previous ListBlueprints call. + # It can be provided to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new + # + # # Call the list_blueprints method. + # result = client.list_blueprints 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::TelcoAutomation::V1::Blueprint. + # p item + # end + # + def list_blueprints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest + + # Converts hash 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_blueprints.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::TelcoAutomation::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_blueprints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_blueprints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_blueprints, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_blueprints, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Approves a blueprint and commits a new revision. + # + # @overload approve_blueprint(request, options = nil) + # Pass arguments to `approve_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload approve_blueprint(name: nil) + # Pass arguments to `approve_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint to approve. The blueprint must be in + # Proposed state. A new revision is committed on approval. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new + # + # # Call the approve_blueprint method. + # result = client.approve_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def approve_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest + + # Converts hash 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.approve_blueprint.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::TelcoAutomation::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.approve_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.approve_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :approve_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Proposes a blueprint for approval of changes. + # + # @overload propose_blueprint(request, options = nil) + # Pass arguments to `propose_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload propose_blueprint(name: nil) + # Pass arguments to `propose_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint being proposed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new + # + # # Call the propose_blueprint method. + # result = client.propose_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def propose_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest + + # Converts hash 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.propose_blueprint.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::TelcoAutomation::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.propose_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.propose_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :propose_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rejects a blueprint revision proposal and flips it back to Draft state. + # + # @overload reject_blueprint(request, options = nil) + # Pass arguments to `reject_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reject_blueprint(name: nil) + # Pass arguments to `reject_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint being rejected. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new + # + # # Call the reject_blueprint method. + # result = client.reject_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def reject_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest + + # Converts hash 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.reject_blueprint.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::TelcoAutomation::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.reject_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reject_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :reject_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List blueprint revisions of a given blueprint. + # + # @overload list_blueprint_revisions(request, options = nil) + # Pass arguments to `list_blueprint_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint_revisions(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_blueprint_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint to list revisions for. + # @param page_size [::Integer] + # The maximum number of revisions to return per page. + # @param page_token [::String] + # The page token, received from a previous ListBlueprintRevisions call + # It can be provided to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new + # + # # Call the list_blueprint_revisions method. + # result = client.list_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. + # p item + # end + # + def list_blueprint_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest + + # Converts hash 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_blueprint_revisions.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::TelcoAutomation::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_blueprint_revisions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_blueprint_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_blueprint_revisions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_blueprint_revisions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches across blueprint revisions. + # + # @overload search_blueprint_revisions(request, options = nil) + # Pass arguments to `search_blueprint_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_blueprint_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_blueprint_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param query [::String] + # Required. Supported queries: + # 1. "" : Lists all revisions across all blueprints. + # 2. "latest=true" : Lists latest revisions across all blueprints. + # 3. "name=\\{name}" : Lists all revisions of blueprint with name + # \\{name}. + # 4. "name=\\{name} latest=true": Lists latest revision of blueprint with name + # \\{name} + # @param page_size [::Integer] + # Optional. The maximum number of blueprints revisions to return per page. + # max page size = 100, default page size = 20. + # @param page_token [::String] + # Optional. The page token, received from a previous search call. + # It can be provided to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new + # + # # Call the search_blueprint_revisions method. + # result = client.search_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. + # p item + # end + # + def search_blueprint_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest + + # Converts hash 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.search_blueprint_revisions.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::TelcoAutomation::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.search_blueprint_revisions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_blueprint_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :search_blueprint_revisions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :search_blueprint_revisions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches across deployment revisions. + # + # @overload search_deployment_revisions(request, options = nil) + # Pass arguments to `search_deployment_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_deployment_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_deployment_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param query [::String] + # Required. Supported queries: + # 1. "" : Lists all revisions across all deployments. + # 2. "latest=true" : Lists latest revisions across all + # deployments. + # 3. "name=\\{name}" : Lists all revisions of deployment with name + # \\{name}. + # 4. "name=\\{name} latest=true": Lists latest revision of deployment with name + # \\{name} + # @param page_size [::Integer] + # Optional. The maximum number of deployment revisions to return per page. + # max page size = 100, default page size = 20. + # @param page_token [::String] + # Optional. The page token, received from a previous search call. + # It can be provided to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new + # + # # Call the search_deployment_revisions method. + # result = client.search_deployment_revisions 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::TelcoAutomation::V1::Deployment. + # p item + # end + # + def search_deployment_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest + + # Converts hash 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.search_deployment_revisions.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::TelcoAutomation::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.search_deployment_revisions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_deployment_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :search_deployment_revisions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :search_deployment_revisions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Discards the changes in a blueprint and reverts the blueprint to the last + # approved blueprint revision. No changes take place if a blueprint does not + # have revisions. + # + # @overload discard_blueprint_changes(request, options = nil) + # Pass arguments to `discard_blueprint_changes` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload discard_blueprint_changes(name: nil) + # Pass arguments to `discard_blueprint_changes` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint of which changes are being discarded. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new + # + # # Call the discard_blueprint_changes method. + # result = client.discard_blueprint_changes request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse. + # p result + # + def discard_blueprint_changes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest + + # Converts hash 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.discard_blueprint_changes.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::TelcoAutomation::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.discard_blueprint_changes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.discard_blueprint_changes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :discard_blueprint_changes, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the blueprints in TNA's public catalog. Default page size = 20, + # Max Page Size = 100. + # + # @overload list_public_blueprints(request, options = nil) + # Pass arguments to `list_public_blueprints` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_blueprints(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_public_blueprints` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value of public blueprint. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}". + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.new + # + # # Call the list_public_blueprints method. + # result = client.list_public_blueprints 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::TelcoAutomation::V1::PublicBlueprint. + # p item + # end + # + def list_public_blueprints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest + + # Converts hash 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_public_blueprints.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::TelcoAutomation::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_public_blueprints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_public_blueprints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_public_blueprints, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_public_blueprints, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested public blueprint. + # + # @overload get_public_blueprint(request, options = nil) + # Pass arguments to `get_public_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_blueprint(name: nil) + # Pass arguments to `get_public_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 public blueprint. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new + # + # # Call the get_public_blueprint method. + # result = client.get_public_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::PublicBlueprint. + # p result + # + def get_public_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest + + # Converts hash 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_public_blueprint.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::TelcoAutomation::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_public_blueprint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_public_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :get_public_blueprint, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a deployment. + # + # @overload create_deployment(request, options = nil) + # Pass arguments to `create_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(parent: nil, deployment_id: nil, deployment: nil) + # Pass arguments to `create_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param deployment_id [::String] + # Optional. The name of the deployment. + # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] + # Required. The `Deployment` to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new + # + # # Call the create_deployment method. + # result = client.create_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def create_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest + + # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :create_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a deployment. + # + # @overload update_deployment(request, options = nil) + # Pass arguments to `update_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(deployment: nil, update_mask: nil) + # Pass arguments to `update_deployment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] + # Required. The `deployment` to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Update mask is used to specify the fields to be overwritten in + # the `deployment` resource by the update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new + # + # # Call the update_deployment method. + # result = client.update_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def update_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest + + # Converts hash 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_deployment.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::TelcoAutomation::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.deployment&.name + header_params["deployment.name"] = request.deployment.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_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :update_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested deployment. + # + # @overload get_deployment(request, options = nil) + # Pass arguments to `get_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(name: nil, view: nil) + # Pass arguments to `get_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 deployment. + # Case 1: If the name provided in the request is + # \\{deployment_id}@\\{revision_id}, then the revision with revision_id will be + # returned. + # Case 2: If the name provided in the request is \\{deployment}, then + # the current state of the deployment is returned. + # @param view [::Google::Cloud::TelcoAutomation::V1::DeploymentView] + # Optional. Defines the type of view of the deployment. + # When field is not present VIEW_BASIC is considered as default. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new + # + # # Call the get_deployment method. + # result = client.get_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def get_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest + + # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :get_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Removes the deployment by marking it as DELETING. Post which deployment and + # it's revisions gets deleted. + # + # @overload remove_deployment(request, options = nil) + # Pass arguments to `remove_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_deployment(name: nil) + # Pass arguments to `remove_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 deployment to initiate 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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new + # + # # Call the remove_deployment method. + # result = client.remove_deployment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def remove_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest + + # Converts hash 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.remove_deployment.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::TelcoAutomation::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.remove_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :remove_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all deployments. + # + # @overload list_deployments(request, options = nil) + # Pass arguments to `list_deployments` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployments(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployments` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param filter [::String] + # Optional. Filtering only supports equality on deployment state. + # It should be in the form: "state = DRAFT". `OR` operator can be used to + # get response for multiple states. e.g. "state = DRAFT OR state = APPLIED". + # @param page_size [::Integer] + # Optional. The maximum number of deployments to return per page. + # @param page_token [::String] + # Optional. The page token, received from a previous ListDeployments call. + # It can be provided to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new + # + # # Call the list_deployments method. + # result = client.list_deployments 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::TelcoAutomation::V1::Deployment. + # p item + # end + # + def list_deployments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest + + # Converts hash 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_deployments.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::TelcoAutomation::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_deployments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_deployments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_deployments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_deployments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List deployment revisions of a given deployment. + # + # @overload list_deployment_revisions(request, options = nil) + # Pass arguments to `list_deployment_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment_revisions(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployment_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 deployment to list revisions for. + # @param page_size [::Integer] + # Optional. The maximum number of revisions to return per page. + # @param page_token [::String] + # Optional. The page token, received from a previous ListDeploymentRevisions + # call Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new + # + # # Call the list_deployment_revisions method. + # result = client.list_deployment_revisions 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::TelcoAutomation::V1::Deployment. + # p item + # end + # + def list_deployment_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest + + # Converts hash 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_deployment_revisions.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::TelcoAutomation::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_deployment_revisions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_deployment_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_deployment_revisions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_deployment_revisions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Discards the changes in a deployment and reverts the deployment to the last + # approved deployment revision. No changes take place if a deployment does + # not have revisions. + # + # @overload discard_deployment_changes(request, options = nil) + # Pass arguments to `discard_deployment_changes` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload discard_deployment_changes(name: nil) + # Pass arguments to `discard_deployment_changes` via keyword arguments. Note that at + # least one keyword argument is 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 deployment of which changes are being discarded. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new + # + # # Call the discard_deployment_changes method. + # result = client.discard_deployment_changes request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse. + # p result + # + def discard_deployment_changes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest + + # Converts hash 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.discard_deployment_changes.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::TelcoAutomation::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.discard_deployment_changes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.discard_deployment_changes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :discard_deployment_changes, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Applies the deployment's YAML files to the parent orchestration cluster. + # + # @overload apply_deployment(request, options = nil) + # Pass arguments to `apply_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload apply_deployment(name: nil) + # Pass arguments to `apply_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 deployment to apply to orchestration cluster. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new + # + # # Call the apply_deployment method. + # result = client.apply_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def apply_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest + + # Converts hash 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.apply_deployment.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::TelcoAutomation::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.apply_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.apply_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :apply_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested deployment status. + # + # @overload compute_deployment_status(request, options = nil) + # Pass arguments to `compute_deployment_status` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload compute_deployment_status(name: nil) + # Pass arguments to `compute_deployment_status` via keyword arguments. Note that at + # least one keyword argument is 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 deployment without revisionID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new + # + # # Call the compute_deployment_status method. + # result = client.compute_deployment_status request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse. + # p result + # + def compute_deployment_status request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest + + # Converts hash 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.compute_deployment_status.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::TelcoAutomation::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.compute_deployment_status.timeout, + metadata: metadata, + retry_policy: @config.rpcs.compute_deployment_status.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :compute_deployment_status, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rollback the active deployment to the given past approved deployment + # revision. + # + # @overload rollback_deployment(request, options = nil) + # Pass arguments to `rollback_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload rollback_deployment(name: nil, revision_id: nil) + # Pass arguments to `rollback_deployment` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the deployment. + # @param revision_id [::String] + # Required. The revision id of deployment to roll back to. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new + # + # # Call the rollback_deployment method. + # result = client.rollback_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def rollback_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest + + # Converts hash 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.rollback_deployment.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::TelcoAutomation::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.rollback_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rollback_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :rollback_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested hydrated deployment. + # + # @overload get_hydrated_deployment(request, options = nil) + # Pass arguments to `get_hydrated_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hydrated_deployment(name: nil) + # Pass arguments to `get_hydrated_deployment` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the hydrated deployment. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new + # + # # Call the get_hydrated_deployment method. + # result = client.get_hydrated_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + # p result + # + def get_hydrated_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest + + # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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_hydrated_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_hydrated_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :get_hydrated_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all hydrated deployments present under a deployment. + # + # @overload list_hydrated_deployments(request, options = nil) + # Pass arguments to `list_hydrated_deployments` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hydrated_deployments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_hydrated_deployments` via keyword arguments. Note that at + # least one keyword argument is 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 deployment managing the hydrated deployments. + # @param page_size [::Integer] + # Optional. The maximum number of hydrated deployments to return. The service + # may return fewer than this value. If unspecified, at most 50 hydrated + # deployments will be returned. The maximum value is 1000. Values above 1000 + # will be set to 1000. + # @param page_token [::String] + # Optional. The page token, received from a previous ListHydratedDeployments + # call. Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.new + # + # # Call the list_hydrated_deployments method. + # result = client.list_hydrated_deployments 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::TelcoAutomation::V1::HydratedDeployment. + # p item + # end + # + def list_hydrated_deployments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest + + # Converts hash 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_hydrated_deployments.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::TelcoAutomation::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_hydrated_deployments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_hydrated_deployments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :list_hydrated_deployments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_hydrated_deployments, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a hydrated deployment. + # + # @overload update_hydrated_deployment(request, options = nil) + # Pass arguments to `update_hydrated_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hydrated_deployment(hydrated_deployment: nil, update_mask: nil) + # Pass arguments to `update_hydrated_deployment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param hydrated_deployment [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment, ::Hash] + # Required. The hydrated deployment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. Update mask supports a special + # value `*` which fully replaces (equivalent to PUT) the resource provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new + # + # # Call the update_hydrated_deployment method. + # result = client.update_hydrated_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + # p result + # + def update_hydrated_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest + + # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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.hydrated_deployment&.name + header_params["hydrated_deployment.name"] = request.hydrated_deployment.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_hydrated_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_hydrated_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :update_hydrated_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Applies a hydrated deployment to a workload cluster. + # + # @overload apply_hydrated_deployment(request, options = nil) + # Pass arguments to `apply_hydrated_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload apply_hydrated_deployment(name: nil) + # Pass arguments to `apply_hydrated_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 hydrated deployment to apply. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new + # + # # Call the apply_hydrated_deployment method. + # result = client.apply_hydrated_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + # p result + # + def apply_hydrated_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest + + # Converts hash 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.apply_hydrated_deployment.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::TelcoAutomation::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.apply_hydrated_deployment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.apply_hydrated_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.call_rpc :apply_hydrated_deployment, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TelcoAutomation API. + # + # This class represents the configuration for TelcoAutomation, + # 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::TelcoAutomation::V1::TelcoAutomation::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_orchestration_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_orchestration_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_orchestration_clusters.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TelcoAutomation 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_orchestration_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_orchestration_clusters + ## + # RPC-specific configuration for `get_orchestration_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_orchestration_cluster + ## + # RPC-specific configuration for `create_orchestration_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_orchestration_cluster + ## + # RPC-specific configuration for `delete_orchestration_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_orchestration_cluster + ## + # RPC-specific configuration for `list_edge_slms` + # @return [::Gapic::Config::Method] + # + attr_reader :list_edge_slms + ## + # RPC-specific configuration for `get_edge_slm` + # @return [::Gapic::Config::Method] + # + attr_reader :get_edge_slm + ## + # RPC-specific configuration for `create_edge_slm` + # @return [::Gapic::Config::Method] + # + attr_reader :create_edge_slm + ## + # RPC-specific configuration for `delete_edge_slm` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_edge_slm + ## + # RPC-specific configuration for `create_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_blueprint + ## + # RPC-specific configuration for `update_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_blueprint + ## + # RPC-specific configuration for `get_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_blueprint + ## + # RPC-specific configuration for `delete_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_blueprint + ## + # RPC-specific configuration for `list_blueprints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_blueprints + ## + # RPC-specific configuration for `approve_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :approve_blueprint + ## + # RPC-specific configuration for `propose_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :propose_blueprint + ## + # RPC-specific configuration for `reject_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :reject_blueprint + ## + # RPC-specific configuration for `list_blueprint_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_blueprint_revisions + ## + # RPC-specific configuration for `search_blueprint_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :search_blueprint_revisions + ## + # RPC-specific configuration for `search_deployment_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :search_deployment_revisions + ## + # RPC-specific configuration for `discard_blueprint_changes` + # @return [::Gapic::Config::Method] + # + attr_reader :discard_blueprint_changes + ## + # RPC-specific configuration for `list_public_blueprints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_public_blueprints + ## + # RPC-specific configuration for `get_public_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_public_blueprint + ## + # RPC-specific configuration for `create_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_deployment + ## + # RPC-specific configuration for `update_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_deployment + ## + # RPC-specific configuration for `get_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_deployment + ## + # RPC-specific configuration for `remove_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_deployment + ## + # RPC-specific configuration for `list_deployments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployments + ## + # RPC-specific configuration for `list_deployment_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployment_revisions + ## + # RPC-specific configuration for `discard_deployment_changes` + # @return [::Gapic::Config::Method] + # + attr_reader :discard_deployment_changes + ## + # RPC-specific configuration for `apply_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :apply_deployment + ## + # RPC-specific configuration for `compute_deployment_status` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_deployment_status + ## + # RPC-specific configuration for `rollback_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :rollback_deployment + ## + # RPC-specific configuration for `get_hydrated_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hydrated_deployment + ## + # RPC-specific configuration for `list_hydrated_deployments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hydrated_deployments + ## + # RPC-specific configuration for `update_hydrated_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_hydrated_deployment + ## + # RPC-specific configuration for `apply_hydrated_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :apply_hydrated_deployment + + # @private + def initialize parent_rpcs = nil + list_orchestration_clusters_config = parent_rpcs.list_orchestration_clusters if parent_rpcs.respond_to? :list_orchestration_clusters + @list_orchestration_clusters = ::Gapic::Config::Method.new list_orchestration_clusters_config + get_orchestration_cluster_config = parent_rpcs.get_orchestration_cluster if parent_rpcs.respond_to? :get_orchestration_cluster + @get_orchestration_cluster = ::Gapic::Config::Method.new get_orchestration_cluster_config + create_orchestration_cluster_config = parent_rpcs.create_orchestration_cluster if parent_rpcs.respond_to? :create_orchestration_cluster + @create_orchestration_cluster = ::Gapic::Config::Method.new create_orchestration_cluster_config + delete_orchestration_cluster_config = parent_rpcs.delete_orchestration_cluster if parent_rpcs.respond_to? :delete_orchestration_cluster + @delete_orchestration_cluster = ::Gapic::Config::Method.new delete_orchestration_cluster_config + list_edge_slms_config = parent_rpcs.list_edge_slms if parent_rpcs.respond_to? :list_edge_slms + @list_edge_slms = ::Gapic::Config::Method.new list_edge_slms_config + get_edge_slm_config = parent_rpcs.get_edge_slm if parent_rpcs.respond_to? :get_edge_slm + @get_edge_slm = ::Gapic::Config::Method.new get_edge_slm_config + create_edge_slm_config = parent_rpcs.create_edge_slm if parent_rpcs.respond_to? :create_edge_slm + @create_edge_slm = ::Gapic::Config::Method.new create_edge_slm_config + delete_edge_slm_config = parent_rpcs.delete_edge_slm if parent_rpcs.respond_to? :delete_edge_slm + @delete_edge_slm = ::Gapic::Config::Method.new delete_edge_slm_config + create_blueprint_config = parent_rpcs.create_blueprint if parent_rpcs.respond_to? :create_blueprint + @create_blueprint = ::Gapic::Config::Method.new create_blueprint_config + update_blueprint_config = parent_rpcs.update_blueprint if parent_rpcs.respond_to? :update_blueprint + @update_blueprint = ::Gapic::Config::Method.new update_blueprint_config + get_blueprint_config = parent_rpcs.get_blueprint if parent_rpcs.respond_to? :get_blueprint + @get_blueprint = ::Gapic::Config::Method.new get_blueprint_config + delete_blueprint_config = parent_rpcs.delete_blueprint if parent_rpcs.respond_to? :delete_blueprint + @delete_blueprint = ::Gapic::Config::Method.new delete_blueprint_config + list_blueprints_config = parent_rpcs.list_blueprints if parent_rpcs.respond_to? :list_blueprints + @list_blueprints = ::Gapic::Config::Method.new list_blueprints_config + approve_blueprint_config = parent_rpcs.approve_blueprint if parent_rpcs.respond_to? :approve_blueprint + @approve_blueprint = ::Gapic::Config::Method.new approve_blueprint_config + propose_blueprint_config = parent_rpcs.propose_blueprint if parent_rpcs.respond_to? :propose_blueprint + @propose_blueprint = ::Gapic::Config::Method.new propose_blueprint_config + reject_blueprint_config = parent_rpcs.reject_blueprint if parent_rpcs.respond_to? :reject_blueprint + @reject_blueprint = ::Gapic::Config::Method.new reject_blueprint_config + list_blueprint_revisions_config = parent_rpcs.list_blueprint_revisions if parent_rpcs.respond_to? :list_blueprint_revisions + @list_blueprint_revisions = ::Gapic::Config::Method.new list_blueprint_revisions_config + search_blueprint_revisions_config = parent_rpcs.search_blueprint_revisions if parent_rpcs.respond_to? :search_blueprint_revisions + @search_blueprint_revisions = ::Gapic::Config::Method.new search_blueprint_revisions_config + search_deployment_revisions_config = parent_rpcs.search_deployment_revisions if parent_rpcs.respond_to? :search_deployment_revisions + @search_deployment_revisions = ::Gapic::Config::Method.new search_deployment_revisions_config + discard_blueprint_changes_config = parent_rpcs.discard_blueprint_changes if parent_rpcs.respond_to? :discard_blueprint_changes + @discard_blueprint_changes = ::Gapic::Config::Method.new discard_blueprint_changes_config + list_public_blueprints_config = parent_rpcs.list_public_blueprints if parent_rpcs.respond_to? :list_public_blueprints + @list_public_blueprints = ::Gapic::Config::Method.new list_public_blueprints_config + get_public_blueprint_config = parent_rpcs.get_public_blueprint if parent_rpcs.respond_to? :get_public_blueprint + @get_public_blueprint = ::Gapic::Config::Method.new get_public_blueprint_config + create_deployment_config = parent_rpcs.create_deployment if parent_rpcs.respond_to? :create_deployment + @create_deployment = ::Gapic::Config::Method.new create_deployment_config + update_deployment_config = parent_rpcs.update_deployment if parent_rpcs.respond_to? :update_deployment + @update_deployment = ::Gapic::Config::Method.new update_deployment_config + get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment + @get_deployment = ::Gapic::Config::Method.new get_deployment_config + remove_deployment_config = parent_rpcs.remove_deployment if parent_rpcs.respond_to? :remove_deployment + @remove_deployment = ::Gapic::Config::Method.new remove_deployment_config + list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments + @list_deployments = ::Gapic::Config::Method.new list_deployments_config + list_deployment_revisions_config = parent_rpcs.list_deployment_revisions if parent_rpcs.respond_to? :list_deployment_revisions + @list_deployment_revisions = ::Gapic::Config::Method.new list_deployment_revisions_config + discard_deployment_changes_config = parent_rpcs.discard_deployment_changes if parent_rpcs.respond_to? :discard_deployment_changes + @discard_deployment_changes = ::Gapic::Config::Method.new discard_deployment_changes_config + apply_deployment_config = parent_rpcs.apply_deployment if parent_rpcs.respond_to? :apply_deployment + @apply_deployment = ::Gapic::Config::Method.new apply_deployment_config + compute_deployment_status_config = parent_rpcs.compute_deployment_status if parent_rpcs.respond_to? :compute_deployment_status + @compute_deployment_status = ::Gapic::Config::Method.new compute_deployment_status_config + rollback_deployment_config = parent_rpcs.rollback_deployment if parent_rpcs.respond_to? :rollback_deployment + @rollback_deployment = ::Gapic::Config::Method.new rollback_deployment_config + get_hydrated_deployment_config = parent_rpcs.get_hydrated_deployment if parent_rpcs.respond_to? :get_hydrated_deployment + @get_hydrated_deployment = ::Gapic::Config::Method.new get_hydrated_deployment_config + list_hydrated_deployments_config = parent_rpcs.list_hydrated_deployments if parent_rpcs.respond_to? :list_hydrated_deployments + @list_hydrated_deployments = ::Gapic::Config::Method.new list_hydrated_deployments_config + update_hydrated_deployment_config = parent_rpcs.update_hydrated_deployment if parent_rpcs.respond_to? :update_hydrated_deployment + @update_hydrated_deployment = ::Gapic::Config::Method.new update_hydrated_deployment_config + apply_hydrated_deployment_config = parent_rpcs.apply_hydrated_deployment if parent_rpcs.respond_to? :apply_hydrated_deployment + @apply_hydrated_deployment = ::Gapic::Config::Method.new apply_hydrated_deployment_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb new file mode 100644 index 000000000000..95f1611e1573 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation + module V1 + module TelcoAutomation + # Credentials for the TelcoAutomation API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb new file mode 100644 index 000000000000..050b914fa8e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation + module V1 + module TelcoAutomation + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TelcoAutomation 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 TelcoAutomation 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::TelcoAutomation::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? + throw :response, 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::TelcoAutomation::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? + throw :response, 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::TelcoAutomation::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? + 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::TelcoAutomation::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? + 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::TelcoAutomation::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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb new file mode 100644 index 000000000000..7a62a825c5f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation + module V1 + module TelcoAutomation + # Path helper methods for the TelcoAutomation API. + module Paths + ## + # Create a fully-qualified Blueprint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/blueprints/{blueprint}` + # + # @param project [String] + # @param location [String] + # @param orchestration_cluster [String] + # @param blueprint [String] + # + # @return [::String] + def blueprint_path project:, location:, orchestration_cluster:, blueprint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "orchestration_cluster cannot contain /" if orchestration_cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/orchestrationClusters/#{orchestration_cluster}/blueprints/#{blueprint}" + end + + ## + # Create a fully-qualified Deployment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}` + # + # @param project [String] + # @param location [String] + # @param orchestration_cluster [String] + # @param deployment [String] + # + # @return [::String] + def deployment_path project:, location:, orchestration_cluster:, deployment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "orchestration_cluster cannot contain /" if orchestration_cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/orchestrationClusters/#{orchestration_cluster}/deployments/#{deployment}" + end + + ## + # Create a fully-qualified EdgeSlm resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/edgeSlms/{edge_slm}` + # + # @param project [String] + # @param location [String] + # @param edge_slm [String] + # + # @return [::String] + def edge_slm_path project:, location:, edge_slm: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/edgeSlms/#{edge_slm}" + end + + ## + # Create a fully-qualified HydratedDeployment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}/hydratedDeployments/{hydrated_deployment}` + # + # @param project [String] + # @param location [String] + # @param orchestration_cluster [String] + # @param deployment [String] + # @param hydrated_deployment [String] + # + # @return [::String] + def hydrated_deployment_path project:, location:, orchestration_cluster:, deployment:, hydrated_deployment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "orchestration_cluster cannot contain /" if orchestration_cluster.to_s.include? "/" + raise ::ArgumentError, "deployment cannot contain /" if deployment.to_s.include? "/" + + "projects/#{project}/locations/#{location}/orchestrationClusters/#{orchestration_cluster}/deployments/#{deployment}/hydratedDeployments/#{hydrated_deployment}" + 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 OrchestrationCluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}` + # + # @param project [String] + # @param location [String] + # @param orchestration_cluster [String] + # + # @return [::String] + def orchestration_cluster_path project:, location:, orchestration_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}/orchestrationClusters/#{orchestration_cluster}" + end + + ## + # Create a fully-qualified PublicBlueprint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/publicBlueprints/{public_lueprint}` + # + # @param project [String] + # @param location [String] + # @param public_lueprint [String] + # + # @return [::String] + def public_blueprint_path project:, location:, public_lueprint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/publicBlueprints/#{public_lueprint}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb new file mode 100644 index 000000000000..ecc60ae205c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/version" +require "google/cloud/telco_automation/v1/bindings_override" + +require "google/cloud/telco_automation/v1/telco_automation/credentials" +require "google/cloud/telco_automation/v1/telco_automation/paths" +require "google/cloud/telco_automation/v1/telco_automation/rest/operations" +require "google/cloud/telco_automation/v1/telco_automation/rest/client" + +module Google + module Cloud + module TelcoAutomation + module V1 + ## + # TelcoAutomation Service manages the control plane cluster a.k.a. + # Orchestration Cluster (GKE cluster with config controller) of TNA. It also + # exposes blueprint APIs which manages the lifecycle of blueprints that control + # the infrastructure setup (e.g GDCE clusters) and deployment of network + # functions. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/telco_automation/v1/telco_automation/rest" + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + module TelcoAutomation + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/telco_automation/v1/telco_automation/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb new file mode 100644 index 000000000000..24a2151fd203 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb @@ -0,0 +1,3752 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" +require "google/cloud/telco_automation/v1/telco_automation/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module TelcoAutomation + module V1 + module TelcoAutomation + module Rest + ## + # REST client for the TelcoAutomation service. + # + # TelcoAutomation Service manages the control plane cluster a.k.a. + # Orchestration Cluster (GKE cluster with config controller) of TNA. It also + # exposes blueprint APIs which manages the lifecycle of blueprints that control + # the infrastructure setup (e.g GDCE clusters) and deployment of network + # functions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :telco_automation_stub + + ## + # Configure the TelcoAutomation Client class. + # + # See {::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TelcoAutomation clients + # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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", "TelcoAutomation", "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 TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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 + @telco_automation_stub.universe_domain + end + + ## + # Create a new TelcoAutomation REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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 + + @telco_automation_stub = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @telco_automation_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @telco_automation_stub.endpoint + config.universe_domain = @telco_automation_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @telco_automation_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @telco_automation_stub.logger + end + + # Service calls + + ## + # Lists OrchestrationClusters in a given project and location. + # + # @overload list_orchestration_clusters(request, options = nil) + # Pass arguments to `list_orchestration_clusters` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_orchestration_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 parent [::String] + # Required. Parent value for ListOrchestrationClustersRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new + # + # # Call the list_orchestration_clusters method. + # result = client.list_orchestration_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::TelcoAutomation::V1::OrchestrationCluster. + # p item + # end + # + def list_orchestration_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_orchestration_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_orchestration_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_orchestration_clusters, "orchestration_clusters", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single OrchestrationCluster. + # + # @overload get_orchestration_cluster(request, options = nil) + # Pass arguments to `get_orchestration_cluster` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil) + # Pass arguments to `get_orchestration_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 name [::String] + # Required. Name of the resource + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new + # + # # Call the get_orchestration_cluster method. + # result = client.get_orchestration_cluster request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::OrchestrationCluster. + # p result + # + def get_orchestration_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_orchestration_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.get_orchestration_cluster request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new OrchestrationCluster in a given project and location. + # + # @overload create_orchestration_cluster(request, options = nil) + # Pass arguments to `create_orchestration_cluster` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_cluster(parent: nil, orchestration_cluster_id: nil, orchestration_cluster: nil, request_id: nil) + # Pass arguments to `create_orchestration_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 parent [::String] + # Required. Value for parent. + # @param orchestration_cluster_id [::String] + # Required. Id of the requesting object + # If auto-generating Id server-side, remove this field and + # orchestration_cluster_id from the method_signature of Create RPC + # @param orchestration_cluster [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new + # + # # Call the create_orchestration_cluster method. + # result = client.create_orchestration_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_orchestration_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_orchestration_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.create_orchestration_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single OrchestrationCluster. + # + # @overload delete_orchestration_cluster(request, options = nil) + # Pass arguments to `delete_orchestration_cluster` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_orchestration_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 name [::String] + # Required. Name of the resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.new + # + # # Call the delete_orchestration_cluster method. + # result = client.delete_orchestration_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_orchestration_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest + + # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_orchestration_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.delete_orchestration_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists EdgeSlms in a given project and location. + # + # @overload list_edge_slms(request, options = nil) + # Pass arguments to `list_edge_slms` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_edge_slms` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListEdgeSlmsRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.new + # + # # Call the list_edge_slms method. + # result = client.list_edge_slms 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::TelcoAutomation::V1::EdgeSlm. + # p item + # end + # + def list_edge_slms request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest + + # Converts hash 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_edge_slms.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::TelcoAutomation::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_edge_slms.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_edge_slms.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_edge_slms request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_edge_slms, "edge_slms", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single EdgeSlm. + # + # @overload get_edge_slm(request, options = nil) + # Pass arguments to `get_edge_slm` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slm(name: nil) + # Pass arguments to `get_edge_slm` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new + # + # # Call the get_edge_slm method. + # result = client.get_edge_slm request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::EdgeSlm. + # p result + # + def get_edge_slm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest + + # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_edge_slm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.get_edge_slm request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new EdgeSlm in a given project and location. + # + # @overload create_edge_slm(request, options = nil) + # Pass arguments to `create_edge_slm` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slm(parent: nil, edge_slm_id: nil, edge_slm: nil, request_id: nil) + # Pass arguments to `create_edge_slm` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param edge_slm_id [::String] + # Required. Id of the requesting object + # If auto-generating Id server-side, remove this field and + # edge_slm_id from the method_signature of Create RPC + # @param edge_slm [::Google::Cloud::TelcoAutomation::V1::EdgeSlm, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new + # + # # Call the create_edge_slm method. + # result = client.create_edge_slm 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_edge_slm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest + + # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_edge_slm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.create_edge_slm request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single EdgeSlm. + # + # @overload delete_edge_slm(request, options = nil) + # Pass arguments to `delete_edge_slm` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_edge_slm(name: nil, request_id: nil) + # Pass arguments to `delete_edge_slm` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.new + # + # # Call the delete_edge_slm method. + # result = client.delete_edge_slm 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_edge_slm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest + + # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_edge_slm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.delete_edge_slm request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a blueprint. + # + # @overload create_blueprint(request, options = nil) + # Pass arguments to `create_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(parent: nil, blueprint_id: nil, blueprint: nil) + # Pass arguments to `create_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param blueprint_id [::String] + # Optional. The name of the blueprint. + # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] + # Required. The `Blueprint` to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new + # + # # Call the create_blueprint method. + # result = client.create_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def create_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.create_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a blueprint. + # + # @overload update_blueprint(request, options = nil) + # Pass arguments to `update_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(blueprint: nil, update_mask: nil) + # Pass arguments to `update_blueprint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] + # Required. The `blueprint` to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Update mask is used to specify the fields to be overwritten in + # the `blueprint` resource by the update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new + # + # # Call the update_blueprint method. + # result = client.update_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def update_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.update_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested blueprint. + # + # @overload get_blueprint(request, options = nil) + # Pass arguments to `get_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(name: nil, view: nil) + # Pass arguments to `get_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint. + # Case 1: If the name provided in the request is + # \\{blueprint_id}@\\{revision_id}, then the revision with revision_id will be + # returned. Case 2: If the name provided in the request is \\{blueprint}, then + # the current state of the blueprint is returned. + # @param view [::Google::Cloud::TelcoAutomation::V1::BlueprintView] + # Optional. Defines the type of view of the blueprint. + # When field is not present BLUEPRINT_VIEW_BASIC is considered as default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new + # + # # Call the get_blueprint method. + # result = client.get_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def get_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.get_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a blueprint and all its revisions. + # + # @overload delete_blueprint(request, options = nil) + # Pass arguments to `delete_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint(name: nil) + # Pass arguments to `delete_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint to delete. + # Blueprint name should be in the format \\{blueprint_id}, if + # \\{blueprint_id}@\\{revision_id} is passed then the API throws invalid + # argument. + # @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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new + # + # # Call the delete_blueprint method. + # result = client.delete_blueprint request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest + + # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.delete_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all blueprints. + # + # @overload list_blueprints(request, options = nil) + # Pass arguments to `list_blueprints` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprints(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_blueprints` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param filter [::String] + # Optional. Filtering only supports equality on blueprint state. + # It should be in the form: "state = DRAFT". `OR` operator can be used to + # get response for multiple states. e.g. "state = DRAFT OR state = PROPOSED". + # @param page_size [::Integer] + # Optional. The maximum number of blueprints to return per page. + # @param page_token [::String] + # Optional. The page token, received from a previous ListBlueprints call. + # It can be provided to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new + # + # # Call the list_blueprints method. + # result = client.list_blueprints 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::TelcoAutomation::V1::Blueprint. + # p item + # end + # + def list_blueprints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest + + # Converts hash 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_blueprints.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::TelcoAutomation::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_blueprints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_blueprints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_blueprints request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_blueprints, "blueprints", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Approves a blueprint and commits a new revision. + # + # @overload approve_blueprint(request, options = nil) + # Pass arguments to `approve_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload approve_blueprint(name: nil) + # Pass arguments to `approve_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint to approve. The blueprint must be in + # Proposed state. A new revision is committed on approval. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new + # + # # Call the approve_blueprint method. + # result = client.approve_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def approve_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest + + # Converts hash 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.approve_blueprint.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::TelcoAutomation::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.approve_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.approve_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.approve_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Proposes a blueprint for approval of changes. + # + # @overload propose_blueprint(request, options = nil) + # Pass arguments to `propose_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload propose_blueprint(name: nil) + # Pass arguments to `propose_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint being proposed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new + # + # # Call the propose_blueprint method. + # result = client.propose_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def propose_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest + + # Converts hash 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.propose_blueprint.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::TelcoAutomation::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.propose_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.propose_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.propose_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rejects a blueprint revision proposal and flips it back to Draft state. + # + # @overload reject_blueprint(request, options = nil) + # Pass arguments to `reject_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reject_blueprint(name: nil) + # Pass arguments to `reject_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint being rejected. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new + # + # # Call the reject_blueprint method. + # result = client.reject_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + # p result + # + def reject_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest + + # Converts hash 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.reject_blueprint.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::TelcoAutomation::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.reject_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reject_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.reject_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List blueprint revisions of a given blueprint. + # + # @overload list_blueprint_revisions(request, options = nil) + # Pass arguments to `list_blueprint_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_blueprint_revisions(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_blueprint_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint to list revisions for. + # @param page_size [::Integer] + # The maximum number of revisions to return per page. + # @param page_token [::String] + # The page token, received from a previous ListBlueprintRevisions call + # It can be provided to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new + # + # # Call the list_blueprint_revisions method. + # result = client.list_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. + # p item + # end + # + def list_blueprint_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest + + # Converts hash 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_blueprint_revisions.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::TelcoAutomation::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_blueprint_revisions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_blueprint_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_blueprint_revisions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_blueprint_revisions, "blueprints", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches across blueprint revisions. + # + # @overload search_blueprint_revisions(request, options = nil) + # Pass arguments to `search_blueprint_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_blueprint_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_blueprint_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param query [::String] + # Required. Supported queries: + # 1. "" : Lists all revisions across all blueprints. + # 2. "latest=true" : Lists latest revisions across all blueprints. + # 3. "name=\\{name}" : Lists all revisions of blueprint with name + # \\{name}. + # 4. "name=\\{name} latest=true": Lists latest revision of blueprint with name + # \\{name} + # @param page_size [::Integer] + # Optional. The maximum number of blueprints revisions to return per page. + # max page size = 100, default page size = 20. + # @param page_token [::String] + # Optional. The page token, received from a previous search call. + # It can be provided to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new + # + # # Call the search_blueprint_revisions method. + # result = client.search_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. + # p item + # end + # + def search_blueprint_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest + + # Converts hash 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.search_blueprint_revisions.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::TelcoAutomation::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.search_blueprint_revisions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_blueprint_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.search_blueprint_revisions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :search_blueprint_revisions, "blueprints", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Searches across deployment revisions. + # + # @overload search_deployment_revisions(request, options = nil) + # Pass arguments to `search_deployment_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_deployment_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_deployment_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param query [::String] + # Required. Supported queries: + # 1. "" : Lists all revisions across all deployments. + # 2. "latest=true" : Lists latest revisions across all + # deployments. + # 3. "name=\\{name}" : Lists all revisions of deployment with name + # \\{name}. + # 4. "name=\\{name} latest=true": Lists latest revision of deployment with name + # \\{name} + # @param page_size [::Integer] + # Optional. The maximum number of deployment revisions to return per page. + # max page size = 100, default page size = 20. + # @param page_token [::String] + # Optional. The page token, received from a previous search call. + # It can be provided to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new + # + # # Call the search_deployment_revisions method. + # result = client.search_deployment_revisions 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::TelcoAutomation::V1::Deployment. + # p item + # end + # + def search_deployment_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest + + # Converts hash 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.search_deployment_revisions.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::TelcoAutomation::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.search_deployment_revisions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_deployment_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.search_deployment_revisions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :search_deployment_revisions, "deployments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Discards the changes in a blueprint and reverts the blueprint to the last + # approved blueprint revision. No changes take place if a blueprint does not + # have revisions. + # + # @overload discard_blueprint_changes(request, options = nil) + # Pass arguments to `discard_blueprint_changes` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload discard_blueprint_changes(name: nil) + # Pass arguments to `discard_blueprint_changes` via keyword arguments. Note that at + # least one keyword argument is 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 blueprint of which changes are being discarded. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new + # + # # Call the discard_blueprint_changes method. + # result = client.discard_blueprint_changes request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse. + # p result + # + def discard_blueprint_changes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest + + # Converts hash 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.discard_blueprint_changes.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::TelcoAutomation::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.discard_blueprint_changes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.discard_blueprint_changes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.discard_blueprint_changes request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists the blueprints in TNA's public catalog. Default page size = 20, + # Max Page Size = 100. + # + # @overload list_public_blueprints(request, options = nil) + # Pass arguments to `list_public_blueprints` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_blueprints(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_public_blueprints` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value of public blueprint. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}". + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.new + # + # # Call the list_public_blueprints method. + # result = client.list_public_blueprints 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::TelcoAutomation::V1::PublicBlueprint. + # p item + # end + # + def list_public_blueprints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest + + # Converts hash 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_public_blueprints.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::TelcoAutomation::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_public_blueprints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_public_blueprints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_public_blueprints request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_public_blueprints, "public_blueprints", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested public blueprint. + # + # @overload get_public_blueprint(request, options = nil) + # Pass arguments to `get_public_blueprint` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_blueprint(name: nil) + # Pass arguments to `get_public_blueprint` via keyword arguments. Note that at + # least one keyword argument is 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 public blueprint. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new + # + # # Call the get_public_blueprint method. + # result = client.get_public_blueprint request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::PublicBlueprint. + # p result + # + def get_public_blueprint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest + + # Converts hash 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_public_blueprint.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::TelcoAutomation::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_public_blueprint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_public_blueprint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.get_public_blueprint request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a deployment. + # + # @overload create_deployment(request, options = nil) + # Pass arguments to `create_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(parent: nil, deployment_id: nil, deployment: nil) + # Pass arguments to `create_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param deployment_id [::String] + # Optional. The name of the deployment. + # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] + # Required. The `Deployment` to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new + # + # # Call the create_deployment method. + # result = client.create_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def create_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest + + # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.create_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a deployment. + # + # @overload update_deployment(request, options = nil) + # Pass arguments to `update_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(deployment: nil, update_mask: nil) + # Pass arguments to `update_deployment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] + # Required. The `deployment` to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Update mask is used to specify the fields to be overwritten in + # the `deployment` resource by the update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new + # + # # Call the update_deployment method. + # result = client.update_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def update_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest + + # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.update_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested deployment. + # + # @overload get_deployment(request, options = nil) + # Pass arguments to `get_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment(name: nil, view: nil) + # Pass arguments to `get_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 deployment. + # Case 1: If the name provided in the request is + # \\{deployment_id}@\\{revision_id}, then the revision with revision_id will be + # returned. + # Case 2: If the name provided in the request is \\{deployment}, then + # the current state of the deployment is returned. + # @param view [::Google::Cloud::TelcoAutomation::V1::DeploymentView] + # Optional. Defines the type of view of the deployment. + # When field is not present VIEW_BASIC is considered as default. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new + # + # # Call the get_deployment method. + # result = client.get_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def get_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest + + # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.get_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Removes the deployment by marking it as DELETING. Post which deployment and + # it's revisions gets deleted. + # + # @overload remove_deployment(request, options = nil) + # Pass arguments to `remove_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_deployment(name: nil) + # Pass arguments to `remove_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 deployment to initiate 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/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new + # + # # Call the remove_deployment method. + # result = client.remove_deployment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def remove_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest + + # Converts hash 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.remove_deployment.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::TelcoAutomation::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.remove_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.remove_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all deployments. + # + # @overload list_deployments(request, options = nil) + # Pass arguments to `list_deployments` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployments(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployments` via keyword arguments. Note that at + # least one keyword argument is 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 name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @param filter [::String] + # Optional. Filtering only supports equality on deployment state. + # It should be in the form: "state = DRAFT". `OR` operator can be used to + # get response for multiple states. e.g. "state = DRAFT OR state = APPLIED". + # @param page_size [::Integer] + # Optional. The maximum number of deployments to return per page. + # @param page_token [::String] + # Optional. The page token, received from a previous ListDeployments call. + # It can be provided to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new + # + # # Call the list_deployments method. + # result = client.list_deployments 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::TelcoAutomation::V1::Deployment. + # p item + # end + # + def list_deployments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest + + # Converts hash 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_deployments.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::TelcoAutomation::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_deployments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_deployments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_deployments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_deployments, "deployments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List deployment revisions of a given deployment. + # + # @overload list_deployment_revisions(request, options = nil) + # Pass arguments to `list_deployment_revisions` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_deployment_revisions(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_deployment_revisions` via keyword arguments. Note that at + # least one keyword argument is 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 deployment to list revisions for. + # @param page_size [::Integer] + # Optional. The maximum number of revisions to return per page. + # @param page_token [::String] + # Optional. The page token, received from a previous ListDeploymentRevisions + # call Provide this to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new + # + # # Call the list_deployment_revisions method. + # result = client.list_deployment_revisions 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::TelcoAutomation::V1::Deployment. + # p item + # end + # + def list_deployment_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest + + # Converts hash 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_deployment_revisions.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::TelcoAutomation::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_deployment_revisions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_deployment_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_deployment_revisions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_deployment_revisions, "deployments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Discards the changes in a deployment and reverts the deployment to the last + # approved deployment revision. No changes take place if a deployment does + # not have revisions. + # + # @overload discard_deployment_changes(request, options = nil) + # Pass arguments to `discard_deployment_changes` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload discard_deployment_changes(name: nil) + # Pass arguments to `discard_deployment_changes` via keyword arguments. Note that at + # least one keyword argument is 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 deployment of which changes are being discarded. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new + # + # # Call the discard_deployment_changes method. + # result = client.discard_deployment_changes request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse. + # p result + # + def discard_deployment_changes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest + + # Converts hash 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.discard_deployment_changes.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::TelcoAutomation::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.discard_deployment_changes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.discard_deployment_changes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.discard_deployment_changes request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Applies the deployment's YAML files to the parent orchestration cluster. + # + # @overload apply_deployment(request, options = nil) + # Pass arguments to `apply_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload apply_deployment(name: nil) + # Pass arguments to `apply_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 deployment to apply to orchestration cluster. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new + # + # # Call the apply_deployment method. + # result = client.apply_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def apply_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest + + # Converts hash 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.apply_deployment.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::TelcoAutomation::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.apply_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.apply_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.apply_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested deployment status. + # + # @overload compute_deployment_status(request, options = nil) + # Pass arguments to `compute_deployment_status` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload compute_deployment_status(name: nil) + # Pass arguments to `compute_deployment_status` via keyword arguments. Note that at + # least one keyword argument is 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 deployment without revisionID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new + # + # # Call the compute_deployment_status method. + # result = client.compute_deployment_status request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse. + # p result + # + def compute_deployment_status request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest + + # Converts hash 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.compute_deployment_status.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::TelcoAutomation::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.compute_deployment_status.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.compute_deployment_status.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.compute_deployment_status request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Rollback the active deployment to the given past approved deployment + # revision. + # + # @overload rollback_deployment(request, options = nil) + # Pass arguments to `rollback_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload rollback_deployment(name: nil, revision_id: nil) + # Pass arguments to `rollback_deployment` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the deployment. + # @param revision_id [::String] + # Required. The revision id of deployment to roll back to. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new + # + # # Call the rollback_deployment method. + # result = client.rollback_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + # p result + # + def rollback_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest + + # Converts hash 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.rollback_deployment.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::TelcoAutomation::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.rollback_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rollback_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.rollback_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the requested hydrated deployment. + # + # @overload get_hydrated_deployment(request, options = nil) + # Pass arguments to `get_hydrated_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hydrated_deployment(name: nil) + # Pass arguments to `get_hydrated_deployment` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the hydrated deployment. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new + # + # # Call the get_hydrated_deployment method. + # result = client.get_hydrated_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + # p result + # + def get_hydrated_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest + + # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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_hydrated_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_hydrated_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.get_hydrated_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all hydrated deployments present under a deployment. + # + # @overload list_hydrated_deployments(request, options = nil) + # Pass arguments to `list_hydrated_deployments` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hydrated_deployments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_hydrated_deployments` via keyword arguments. Note that at + # least one keyword argument is 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 deployment managing the hydrated deployments. + # @param page_size [::Integer] + # Optional. The maximum number of hydrated deployments to return. The service + # may return fewer than this value. If unspecified, at most 50 hydrated + # deployments will be returned. The maximum value is 1000. Values above 1000 + # will be set to 1000. + # @param page_token [::String] + # Optional. The page token, received from a previous ListHydratedDeployments + # call. Provide this to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.new + # + # # Call the list_hydrated_deployments method. + # result = client.list_hydrated_deployments 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::TelcoAutomation::V1::HydratedDeployment. + # p item + # end + # + def list_hydrated_deployments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest + + # Converts hash 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_hydrated_deployments.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::TelcoAutomation::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_hydrated_deployments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_hydrated_deployments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.list_hydrated_deployments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_hydrated_deployments, "hydrated_deployments", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a hydrated deployment. + # + # @overload update_hydrated_deployment(request, options = nil) + # Pass arguments to `update_hydrated_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hydrated_deployment(hydrated_deployment: nil, update_mask: nil) + # Pass arguments to `update_hydrated_deployment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param hydrated_deployment [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment, ::Hash] + # Required. The hydrated deployment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. Update mask supports a special + # value `*` which fully replaces (equivalent to PUT) the resource provided. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new + # + # # Call the update_hydrated_deployment method. + # result = client.update_hydrated_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + # p result + # + def update_hydrated_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest + + # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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_hydrated_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_hydrated_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.update_hydrated_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Applies a hydrated deployment to a workload cluster. + # + # @overload apply_hydrated_deployment(request, options = nil) + # Pass arguments to `apply_hydrated_deployment` via a request object, either of type + # {::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload apply_hydrated_deployment(name: nil) + # Pass arguments to `apply_hydrated_deployment` via keyword arguments. Note that at + # least one keyword argument is 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 hydrated deployment to apply. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/telco_automation/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new + # + # # Call the apply_hydrated_deployment method. + # result = client.apply_hydrated_deployment request + # + # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + # p result + # + def apply_hydrated_deployment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest + + # Converts hash 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.apply_hydrated_deployment.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::TelcoAutomation::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.apply_hydrated_deployment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.apply_hydrated_deployment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @telco_automation_stub.apply_hydrated_deployment request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TelcoAutomation REST API. + # + # This class represents the configuration for TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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_orchestration_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_orchestration_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_orchestration_clusters.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TelcoAutomation 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_orchestration_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_orchestration_clusters + ## + # RPC-specific configuration for `get_orchestration_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_orchestration_cluster + ## + # RPC-specific configuration for `create_orchestration_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_orchestration_cluster + ## + # RPC-specific configuration for `delete_orchestration_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_orchestration_cluster + ## + # RPC-specific configuration for `list_edge_slms` + # @return [::Gapic::Config::Method] + # + attr_reader :list_edge_slms + ## + # RPC-specific configuration for `get_edge_slm` + # @return [::Gapic::Config::Method] + # + attr_reader :get_edge_slm + ## + # RPC-specific configuration for `create_edge_slm` + # @return [::Gapic::Config::Method] + # + attr_reader :create_edge_slm + ## + # RPC-specific configuration for `delete_edge_slm` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_edge_slm + ## + # RPC-specific configuration for `create_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_blueprint + ## + # RPC-specific configuration for `update_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_blueprint + ## + # RPC-specific configuration for `get_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_blueprint + ## + # RPC-specific configuration for `delete_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_blueprint + ## + # RPC-specific configuration for `list_blueprints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_blueprints + ## + # RPC-specific configuration for `approve_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :approve_blueprint + ## + # RPC-specific configuration for `propose_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :propose_blueprint + ## + # RPC-specific configuration for `reject_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :reject_blueprint + ## + # RPC-specific configuration for `list_blueprint_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_blueprint_revisions + ## + # RPC-specific configuration for `search_blueprint_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :search_blueprint_revisions + ## + # RPC-specific configuration for `search_deployment_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :search_deployment_revisions + ## + # RPC-specific configuration for `discard_blueprint_changes` + # @return [::Gapic::Config::Method] + # + attr_reader :discard_blueprint_changes + ## + # RPC-specific configuration for `list_public_blueprints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_public_blueprints + ## + # RPC-specific configuration for `get_public_blueprint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_public_blueprint + ## + # RPC-specific configuration for `create_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_deployment + ## + # RPC-specific configuration for `update_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_deployment + ## + # RPC-specific configuration for `get_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_deployment + ## + # RPC-specific configuration for `remove_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_deployment + ## + # RPC-specific configuration for `list_deployments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployments + ## + # RPC-specific configuration for `list_deployment_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_deployment_revisions + ## + # RPC-specific configuration for `discard_deployment_changes` + # @return [::Gapic::Config::Method] + # + attr_reader :discard_deployment_changes + ## + # RPC-specific configuration for `apply_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :apply_deployment + ## + # RPC-specific configuration for `compute_deployment_status` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_deployment_status + ## + # RPC-specific configuration for `rollback_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :rollback_deployment + ## + # RPC-specific configuration for `get_hydrated_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hydrated_deployment + ## + # RPC-specific configuration for `list_hydrated_deployments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hydrated_deployments + ## + # RPC-specific configuration for `update_hydrated_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_hydrated_deployment + ## + # RPC-specific configuration for `apply_hydrated_deployment` + # @return [::Gapic::Config::Method] + # + attr_reader :apply_hydrated_deployment + + # @private + def initialize parent_rpcs = nil + list_orchestration_clusters_config = parent_rpcs.list_orchestration_clusters if parent_rpcs.respond_to? :list_orchestration_clusters + @list_orchestration_clusters = ::Gapic::Config::Method.new list_orchestration_clusters_config + get_orchestration_cluster_config = parent_rpcs.get_orchestration_cluster if parent_rpcs.respond_to? :get_orchestration_cluster + @get_orchestration_cluster = ::Gapic::Config::Method.new get_orchestration_cluster_config + create_orchestration_cluster_config = parent_rpcs.create_orchestration_cluster if parent_rpcs.respond_to? :create_orchestration_cluster + @create_orchestration_cluster = ::Gapic::Config::Method.new create_orchestration_cluster_config + delete_orchestration_cluster_config = parent_rpcs.delete_orchestration_cluster if parent_rpcs.respond_to? :delete_orchestration_cluster + @delete_orchestration_cluster = ::Gapic::Config::Method.new delete_orchestration_cluster_config + list_edge_slms_config = parent_rpcs.list_edge_slms if parent_rpcs.respond_to? :list_edge_slms + @list_edge_slms = ::Gapic::Config::Method.new list_edge_slms_config + get_edge_slm_config = parent_rpcs.get_edge_slm if parent_rpcs.respond_to? :get_edge_slm + @get_edge_slm = ::Gapic::Config::Method.new get_edge_slm_config + create_edge_slm_config = parent_rpcs.create_edge_slm if parent_rpcs.respond_to? :create_edge_slm + @create_edge_slm = ::Gapic::Config::Method.new create_edge_slm_config + delete_edge_slm_config = parent_rpcs.delete_edge_slm if parent_rpcs.respond_to? :delete_edge_slm + @delete_edge_slm = ::Gapic::Config::Method.new delete_edge_slm_config + create_blueprint_config = parent_rpcs.create_blueprint if parent_rpcs.respond_to? :create_blueprint + @create_blueprint = ::Gapic::Config::Method.new create_blueprint_config + update_blueprint_config = parent_rpcs.update_blueprint if parent_rpcs.respond_to? :update_blueprint + @update_blueprint = ::Gapic::Config::Method.new update_blueprint_config + get_blueprint_config = parent_rpcs.get_blueprint if parent_rpcs.respond_to? :get_blueprint + @get_blueprint = ::Gapic::Config::Method.new get_blueprint_config + delete_blueprint_config = parent_rpcs.delete_blueprint if parent_rpcs.respond_to? :delete_blueprint + @delete_blueprint = ::Gapic::Config::Method.new delete_blueprint_config + list_blueprints_config = parent_rpcs.list_blueprints if parent_rpcs.respond_to? :list_blueprints + @list_blueprints = ::Gapic::Config::Method.new list_blueprints_config + approve_blueprint_config = parent_rpcs.approve_blueprint if parent_rpcs.respond_to? :approve_blueprint + @approve_blueprint = ::Gapic::Config::Method.new approve_blueprint_config + propose_blueprint_config = parent_rpcs.propose_blueprint if parent_rpcs.respond_to? :propose_blueprint + @propose_blueprint = ::Gapic::Config::Method.new propose_blueprint_config + reject_blueprint_config = parent_rpcs.reject_blueprint if parent_rpcs.respond_to? :reject_blueprint + @reject_blueprint = ::Gapic::Config::Method.new reject_blueprint_config + list_blueprint_revisions_config = parent_rpcs.list_blueprint_revisions if parent_rpcs.respond_to? :list_blueprint_revisions + @list_blueprint_revisions = ::Gapic::Config::Method.new list_blueprint_revisions_config + search_blueprint_revisions_config = parent_rpcs.search_blueprint_revisions if parent_rpcs.respond_to? :search_blueprint_revisions + @search_blueprint_revisions = ::Gapic::Config::Method.new search_blueprint_revisions_config + search_deployment_revisions_config = parent_rpcs.search_deployment_revisions if parent_rpcs.respond_to? :search_deployment_revisions + @search_deployment_revisions = ::Gapic::Config::Method.new search_deployment_revisions_config + discard_blueprint_changes_config = parent_rpcs.discard_blueprint_changes if parent_rpcs.respond_to? :discard_blueprint_changes + @discard_blueprint_changes = ::Gapic::Config::Method.new discard_blueprint_changes_config + list_public_blueprints_config = parent_rpcs.list_public_blueprints if parent_rpcs.respond_to? :list_public_blueprints + @list_public_blueprints = ::Gapic::Config::Method.new list_public_blueprints_config + get_public_blueprint_config = parent_rpcs.get_public_blueprint if parent_rpcs.respond_to? :get_public_blueprint + @get_public_blueprint = ::Gapic::Config::Method.new get_public_blueprint_config + create_deployment_config = parent_rpcs.create_deployment if parent_rpcs.respond_to? :create_deployment + @create_deployment = ::Gapic::Config::Method.new create_deployment_config + update_deployment_config = parent_rpcs.update_deployment if parent_rpcs.respond_to? :update_deployment + @update_deployment = ::Gapic::Config::Method.new update_deployment_config + get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment + @get_deployment = ::Gapic::Config::Method.new get_deployment_config + remove_deployment_config = parent_rpcs.remove_deployment if parent_rpcs.respond_to? :remove_deployment + @remove_deployment = ::Gapic::Config::Method.new remove_deployment_config + list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments + @list_deployments = ::Gapic::Config::Method.new list_deployments_config + list_deployment_revisions_config = parent_rpcs.list_deployment_revisions if parent_rpcs.respond_to? :list_deployment_revisions + @list_deployment_revisions = ::Gapic::Config::Method.new list_deployment_revisions_config + discard_deployment_changes_config = parent_rpcs.discard_deployment_changes if parent_rpcs.respond_to? :discard_deployment_changes + @discard_deployment_changes = ::Gapic::Config::Method.new discard_deployment_changes_config + apply_deployment_config = parent_rpcs.apply_deployment if parent_rpcs.respond_to? :apply_deployment + @apply_deployment = ::Gapic::Config::Method.new apply_deployment_config + compute_deployment_status_config = parent_rpcs.compute_deployment_status if parent_rpcs.respond_to? :compute_deployment_status + @compute_deployment_status = ::Gapic::Config::Method.new compute_deployment_status_config + rollback_deployment_config = parent_rpcs.rollback_deployment if parent_rpcs.respond_to? :rollback_deployment + @rollback_deployment = ::Gapic::Config::Method.new rollback_deployment_config + get_hydrated_deployment_config = parent_rpcs.get_hydrated_deployment if parent_rpcs.respond_to? :get_hydrated_deployment + @get_hydrated_deployment = ::Gapic::Config::Method.new get_hydrated_deployment_config + list_hydrated_deployments_config = parent_rpcs.list_hydrated_deployments if parent_rpcs.respond_to? :list_hydrated_deployments + @list_hydrated_deployments = ::Gapic::Config::Method.new list_hydrated_deployments_config + update_hydrated_deployment_config = parent_rpcs.update_hydrated_deployment if parent_rpcs.respond_to? :update_hydrated_deployment + @update_hydrated_deployment = ::Gapic::Config::Method.new update_hydrated_deployment_config + apply_hydrated_deployment_config = parent_rpcs.apply_hydrated_deployment if parent_rpcs.respond_to? :apply_hydrated_deployment + @apply_hydrated_deployment = ::Gapic::Config::Method.new apply_hydrated_deployment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb new file mode 100644 index 000000000000..6d9d6798af44 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation + module V1 + module TelcoAutomation + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TelcoAutomation 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 TelcoAutomation 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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::TelcoAutomation::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? + throw :response, 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::TelcoAutomation::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? + throw :response, 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::TelcoAutomation::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? + 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::TelcoAutomation::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? + 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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/[^/]+/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/[^/]+/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/[^/]+/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", + body: "*", + 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-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb new file mode 100644 index 000000000000..a3585b11399f --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb @@ -0,0 +1,2293 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" + +module Google + module Cloud + module TelcoAutomation + module V1 + module TelcoAutomation + module Rest + ## + # REST service stub for the TelcoAutomation service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_orchestration_clusters REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest] + # 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::TelcoAutomation::V1::ListOrchestrationClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse] + # A result object deserialized from the server's reply + def list_orchestration_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_orchestration_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, + method_name: "list_orchestration_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_orchestration_cluster REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest] + # 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::TelcoAutomation::V1::OrchestrationCluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] + # A result object deserialized from the server's reply + def get_orchestration_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_orchestration_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, + method_name: "get_orchestration_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_orchestration_cluster REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest] + # 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_orchestration_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_orchestration_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, + method_name: "create_orchestration_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_orchestration_cluster REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest] + # 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_orchestration_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_orchestration_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, + method_name: "delete_orchestration_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_edge_slms REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest] + # 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::TelcoAutomation::V1::ListEdgeSlmsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse] + # A result object deserialized from the server's reply + def list_edge_slms request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_edge_slms_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, + method_name: "list_edge_slms", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_edge_slm REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest] + # 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::TelcoAutomation::V1::EdgeSlm] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] + # A result object deserialized from the server's reply + def get_edge_slm request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_edge_slm_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, + method_name: "get_edge_slm", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_edge_slm REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest] + # 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_edge_slm request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_edge_slm_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, + method_name: "create_edge_slm", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_edge_slm REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest] + # 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_edge_slm request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_edge_slm_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, + method_name: "delete_edge_slm", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest] + # 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::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # A result object deserialized from the server's reply + def create_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_blueprint_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, + method_name: "create_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest] + # 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::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # A result object deserialized from the server's reply + def update_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_blueprint_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, + method_name: "update_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest] + # 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::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # A result object deserialized from the server's reply + def get_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_blueprint_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, + method_name: "get_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest] + # 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_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_blueprint_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, + method_name: "delete_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_blueprints REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest] + # 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::TelcoAutomation::V1::ListBlueprintsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse] + # A result object deserialized from the server's reply + def list_blueprints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_blueprints_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, + method_name: "list_blueprints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the approve_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest] + # 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::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # A result object deserialized from the server's reply + def approve_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_approve_blueprint_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, + method_name: "approve_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the propose_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest] + # 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::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # A result object deserialized from the server's reply + def propose_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_propose_blueprint_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, + method_name: "propose_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the reject_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest] + # 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::TelcoAutomation::V1::Blueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # A result object deserialized from the server's reply + def reject_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reject_blueprint_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, + method_name: "reject_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_blueprint_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest] + # 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::TelcoAutomation::V1::ListBlueprintRevisionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse] + # A result object deserialized from the server's reply + def list_blueprint_revisions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_blueprint_revisions_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, + method_name: "list_blueprint_revisions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_blueprint_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest] + # 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::TelcoAutomation::V1::SearchBlueprintRevisionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse] + # A result object deserialized from the server's reply + def search_blueprint_revisions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_blueprint_revisions_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, + method_name: "search_blueprint_revisions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_deployment_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest] + # 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::TelcoAutomation::V1::SearchDeploymentRevisionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse] + # A result object deserialized from the server's reply + def search_deployment_revisions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_deployment_revisions_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, + method_name: "search_deployment_revisions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the discard_blueprint_changes REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest] + # 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::TelcoAutomation::V1::DiscardBlueprintChangesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] + # A result object deserialized from the server's reply + def discard_blueprint_changes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_discard_blueprint_changes_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, + method_name: "discard_blueprint_changes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_public_blueprints REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest] + # 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::TelcoAutomation::V1::ListPublicBlueprintsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse] + # A result object deserialized from the server's reply + def list_public_blueprints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_public_blueprints_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, + method_name: "list_public_blueprints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_public_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest] + # 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::TelcoAutomation::V1::PublicBlueprint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] + # A result object deserialized from the server's reply + def get_public_blueprint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_public_blueprint_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, + method_name: "get_public_blueprint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest] + # 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::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # A result object deserialized from the server's reply + def create_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_deployment_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, + method_name: "create_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest] + # 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::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # A result object deserialized from the server's reply + def update_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_deployment_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, + method_name: "update_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest] + # 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::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # A result object deserialized from the server's reply + def get_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_deployment_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, + method_name: "get_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest] + # 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 remove_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_deployment_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, + method_name: "remove_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_deployments REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest] + # 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::TelcoAutomation::V1::ListDeploymentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse] + # A result object deserialized from the server's reply + def list_deployments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_deployments_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, + method_name: "list_deployments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_deployment_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest] + # 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::TelcoAutomation::V1::ListDeploymentRevisionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse] + # A result object deserialized from the server's reply + def list_deployment_revisions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_deployment_revisions_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, + method_name: "list_deployment_revisions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the discard_deployment_changes REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest] + # 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::TelcoAutomation::V1::DiscardDeploymentChangesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] + # A result object deserialized from the server's reply + def discard_deployment_changes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_discard_deployment_changes_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, + method_name: "discard_deployment_changes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the apply_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest] + # 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::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # A result object deserialized from the server's reply + def apply_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_apply_deployment_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, + method_name: "apply_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the compute_deployment_status REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest] + # 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::TelcoAutomation::V1::ComputeDeploymentStatusResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] + # A result object deserialized from the server's reply + def compute_deployment_status request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_compute_deployment_status_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, + method_name: "compute_deployment_status", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the rollback_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest] + # 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::TelcoAutomation::V1::Deployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # A result object deserialized from the server's reply + def rollback_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rollback_deployment_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, + method_name: "rollback_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_hydrated_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest] + # 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::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # A result object deserialized from the server's reply + def get_hydrated_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_hydrated_deployment_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, + method_name: "get_hydrated_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_hydrated_deployments REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest] + # 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::TelcoAutomation::V1::ListHydratedDeploymentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse] + # A result object deserialized from the server's reply + def list_hydrated_deployments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_hydrated_deployments_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, + method_name: "list_hydrated_deployments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_hydrated_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest] + # 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::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # A result object deserialized from the server's reply + def update_hydrated_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_hydrated_deployment_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, + method_name: "update_hydrated_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the apply_hydrated_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest] + # 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::TelcoAutomation::V1::HydratedDeployment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # A result object deserialized from the server's reply + def apply_hydrated_deployment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_apply_hydrated_deployment_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, + method_name: "apply_hydrated_deployment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_orchestration_clusters REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest] + # 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_orchestration_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/orchestrationClusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_orchestration_cluster REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest] + # 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_orchestration_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_orchestration_cluster REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest] + # 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_orchestration_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/orchestrationClusters", + body: "orchestration_cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_orchestration_cluster REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest] + # 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_orchestration_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_edge_slms REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest] + # 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_edge_slms_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/edgeSlms", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_edge_slm REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest] + # 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_edge_slm_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeSlms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_edge_slm REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest] + # 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_edge_slm_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/edgeSlms", + body: "edge_slm", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_edge_slm REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest] + # 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_edge_slm_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/edgeSlms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest] + # 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_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/blueprints", + body: "blueprint", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest] + # 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_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{blueprint.name}", + body: "blueprint", + matches: [ + ["blueprint.name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest] + # 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_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest] + # 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_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_blueprints REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest] + # 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_blueprints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/blueprints", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the approve_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_approve_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:approve", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the propose_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_propose_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:propose", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reject_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reject_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:reject", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_blueprint_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest] + # 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_blueprint_revisions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:listRevisions", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_blueprint_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_blueprint_revisions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/blueprints:searchRevisions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_deployment_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_deployment_revisions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/deployments:searchRevisions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the discard_blueprint_changes REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_discard_blueprint_changes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:discard", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_public_blueprints REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest] + # 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_public_blueprints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/publicBlueprints", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_public_blueprint REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest] + # 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_public_blueprint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/publicBlueprints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest] + # 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_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/deployments", + body: "deployment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest] + # 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_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{deployment.name}", + body: "deployment", + matches: [ + ["deployment.name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest] + # 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_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:remove", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_deployments REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest] + # 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_deployments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/deployments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_deployment_revisions REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest] + # 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_deployment_revisions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:listRevisions", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the discard_deployment_changes REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_discard_deployment_changes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:discard", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the apply_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_apply_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:apply", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the compute_deployment_status REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_compute_deployment_status_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:computeDeploymentStatus", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rollback_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rollback_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:rollback", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_hydrated_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest] + # 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_hydrated_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/hydratedDeployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_hydrated_deployments REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest] + # 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_hydrated_deployments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/hydratedDeployments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_hydrated_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest] + # 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_hydrated_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{hydrated_deployment.name}", + body: "hydrated_deployment", + matches: [ + ["hydrated_deployment.name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/hydratedDeployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the apply_hydrated_deployment REST call + # + # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_apply_hydrated_deployment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:apply", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/hydratedDeployments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb new file mode 100644 index 000000000000..c881f2cf866a --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb new file mode 100644 index 000000000000..cba463efc248 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/telcoautomation/v1/telcoautomation.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/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/telcoautomation/v1/telcoautomation.proto\x12\x1fgoogle.cloud.telcoautomation.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb2\x05\n\x14OrchestrationCluster\x12\x0c\n\x04name\x18\x01 \x01(\t\x12L\n\x11management_config\x18\x05 \x01(\x0b\x32\x31.google.cloud.telcoautomation.v1.ManagementConfig\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x06labels\x18\x04 \x03(\x0b\x32\x41.google.cloud.telcoautomation.v1.OrchestrationCluster.LabelsEntry\x12\x18\n\x0btna_version\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12O\n\x05state\x18\x07 \x01(\x0e\x32;.google.cloud.telcoautomation.v1.OrchestrationCluster.StateB\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\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04:\x90\x01\xea\x41\x8c\x01\n3telcoautomation.googleapis.com/OrchestrationCluster\x12Uprojects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}\"\xbb\x06\n\x07\x45\x64geSlm\x12\x0c\n\x04name\x18\x01 \x01(\t\x12Z\n\x15orchestration_cluster\x18\x05 \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3telcoautomation.googleapis.com/OrchestrationCluster\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06labels\x18\x04 \x03(\x0b\x32\x34.google.cloud.telcoautomation.v1.EdgeSlm.LabelsEntryB\x03\xe0\x41\x01\x12\x18\n\x0btna_version\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x07 \x01(\x0e\x32..google.cloud.telcoautomation.v1.EdgeSlm.StateB\x03\xe0\x41\x03\x12`\n\x15workload_cluster_type\x18\x08 \x01(\x0e\x32<.google.cloud.telcoautomation.v1.EdgeSlm.WorkloadClusterTypeB\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\"R\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\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\"O\n\x13WorkloadClusterType\x12%\n!WORKLOAD_CLUSTER_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04GDCE\x10\x01\x12\x07\n\x03GKE\x10\x02:{\xea\x41x\n&telcoautomation.googleapis.com/EdgeSlm\x12;projects/{project}/locations/{location}/edgeSlms/{edge_slm}*\x08\x65\x64geSlms2\x07\x65\x64geSlm\"\xe1\x07\n\tBlueprint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1b\n\x0brevision_id\x18\x02 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12 \n\x10source_blueprint\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12=\n\x14revision_create_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0e\x61pproval_state\x18\x06 \x01(\x0e\x32\x38.google.cloud.telcoautomation.v1.Blueprint.ApprovalStateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrepository\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x05\x66iles\x18\t \x03(\x0b\x32%.google.cloud.telcoautomation.v1.FileB\x03\xe0\x41\x01\x12K\n\x06labels\x18\n \x03(\x0b\x32\x36.google.cloud.telcoautomation.v1.Blueprint.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0fsource_provider\x18\r \x01(\tB\x03\xe0\x41\x03\x12O\n\x10\x64\x65ployment_level\x18\x0e \x01(\x0e\x32\x30.google.cloud.telcoautomation.v1.DeploymentLevelB\x03\xe0\x41\x03\x12\x1d\n\x10rollback_support\x18\x0f \x01(\x08\x42\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\"V\n\rApprovalState\x12\x1e\n\x1a\x41PPROVAL_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0c\n\x08PROPOSED\x10\x02\x12\x0c\n\x08\x41PPROVED\x10\x03:\xb3\x01\xea\x41\xaf\x01\n(telcoautomation.googleapis.com/Blueprint\x12lprojects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/blueprints/{blueprint}*\nblueprints2\tblueprint\"\xf4\x02\n\x0fPublicBlueprint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12J\n\x10\x64\x65ployment_level\x18\x04 \x01(\x0e\x32\x30.google.cloud.telcoautomation.v1.DeploymentLevel\x12\x17\n\x0fsource_provider\x18\x05 \x01(\t\x12\x1d\n\x10rollback_support\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03:\xa3\x01\xea\x41\x9f\x01\n.telcoautomation.googleapis.com/PublicBlueprint\x12Jprojects/{project}/locations/{location}/publicBlueprints/{public_lueprint}*\x10publicBlueprints2\x0fpublicBlueprint\"\xee\x07\n\nDeployment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1b\n\x0brevision_id\x18\x02 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12&\n\x19source_blueprint_revision\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12=\n\x14revision_create_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x05 \x01(\x0e\x32\x31.google.cloud.telcoautomation.v1.Deployment.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrepository\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x05\x66iles\x18\x08 \x03(\x0b\x32%.google.cloud.telcoautomation.v1.FileB\x03\xe0\x41\x01\x12L\n\x06labels\x18\t \x03(\x0b\x32\x37.google.cloud.telcoautomation.v1.Deployment.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0fsource_provider\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12 \n\x10workload_cluster\x18\r \x01(\tB\x06\xe0\x41\x05\xe0\x41\x01\x12O\n\x10\x64\x65ployment_level\x18\x0e \x01(\x0e\x32\x30.google.cloud.telcoautomation.v1.DeploymentLevelB\x03\xe0\x41\x03\x12\x1d\n\x10rollback_support\x18\x0f \x01(\x08\x42\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\"D\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0b\n\x07\x41PPLIED\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03:\xb8\x01\xea\x41\xb4\x01\n)telcoautomation.googleapis.com/Deployment\x12nprojects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}*\x0b\x64\x65ployments2\ndeployment\"\x86\x04\n\x12HydratedDeployment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12M\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.telcoautomation.v1.HydratedDeployment.StateB\x03\xe0\x41\x03\x12\x39\n\x05\x66iles\x18\x03 \x03(\x0b\x32%.google.cloud.telcoautomation.v1.FileB\x03\xe0\x41\x01\x12\x1d\n\x10workload_cluster\x18\x04 \x01(\tB\x03\xe0\x41\x03\"6\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0b\n\x07\x41PPLIED\x10\x02:\xfb\x01\xea\x41\xf7\x01\n1telcoautomation.googleapis.com/HydratedDeployment\x12\x98\x01projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}/hydratedDeployments/{hydrated_deployment}*\x13hydratedDeployments2\x12hydratedDeployment\"\xb8\x01\n ListOrchestrationClustersRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33telcoautomation.googleapis.com/OrchestrationCluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xa8\x01\n!ListOrchestrationClustersResponse\x12U\n\x16orchestration_clusters\x18\x01 \x03(\x0b\x32\x35.google.cloud.telcoautomation.v1.OrchestrationCluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"k\n\x1eGetOrchestrationClusterRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3telcoautomation.googleapis.com/OrchestrationCluster\"\x8b\x02\n!CreateOrchestrationClusterRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33telcoautomation.googleapis.com/OrchestrationCluster\x12%\n\x18orchestration_cluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Y\n\x15orchestration_cluster\x18\x03 \x01(\x0b\x32\x35.google.cloud.telcoautomation.v1.OrchestrationClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n!DeleteOrchestrationClusterRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3telcoautomation.googleapis.com/OrchestrationCluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x13ListEdgeSlmsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&telcoautomation.googleapis.com/EdgeSlm\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x81\x01\n\x14ListEdgeSlmsResponse\x12;\n\tedge_slms\x18\x01 \x03(\x0b\x32(.google.cloud.telcoautomation.v1.EdgeSlm\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Q\n\x11GetEdgeSlmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&telcoautomation.googleapis.com/EdgeSlm\"\xca\x01\n\x14\x43reateEdgeSlmRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&telcoautomation.googleapis.com/EdgeSlm\x12\x18\n\x0b\x65\x64ge_slm_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x08\x65\x64ge_slm\x18\x03 \x01(\x0b\x32(.google.cloud.telcoautomation.v1.EdgeSlmB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"m\n\x14\x44\x65leteEdgeSlmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&telcoautomation.googleapis.com/EdgeSlm\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb9\x01\n\x16\x43reateBlueprintRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x19\n\x0c\x62lueprint_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x42\n\tblueprint\x18\x03 \x01(\x0b\x32*.google.cloud.telcoautomation.v1.BlueprintB\x03\xe0\x41\x02\"\x92\x01\n\x16UpdateBlueprintRequest\x12\x42\n\tblueprint\x18\x01 \x01(\x0b\x32*.google.cloud.telcoautomation.v1.BlueprintB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x98\x01\n\x13GetBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\x12\x41\n\x04view\x18\x02 \x01(\x0e\x32..google.cloud.telcoautomation.v1.BlueprintViewB\x03\xe0\x41\x01\"X\n\x16\x44\x65leteBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"\x9f\x01\n\x15ListBlueprintsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x13\n\x06\x66ilter\x18\x04 \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\"q\n\x16ListBlueprintsResponse\x12>\n\nblueprints\x18\x01 \x03(\x0b\x32*.google.cloud.telcoautomation.v1.Blueprint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Y\n\x17\x41pproveBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"Y\n\x17ProposeBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"X\n\x16RejectBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"\x86\x01\n\x1dListBlueprintRevisionsRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"y\n\x1eListBlueprintRevisionsResponse\x12>\n\nblueprints\x18\x01 \x03(\x0b\x32*.google.cloud.telcoautomation.v1.Blueprint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x1fSearchBlueprintRevisionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"{\n SearchBlueprintRevisionsResponse\x12>\n\nblueprints\x18\x01 \x03(\x0b\x32*.google.cloud.telcoautomation.v1.Blueprint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x1e\x44iscardBlueprintChangesRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"!\n\x1f\x44iscardBlueprintChangesResponse\"\x96\x01\n\x1bListPublicBlueprintsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.telcoautomation.googleapis.com/PublicBlueprint\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\"\x89\x01\n\x1cListPublicBlueprintsResponse\x12K\n\x11public_blueprints\x18\x01 \x03(\x0b\x32\x30.google.cloud.telcoautomation.v1.PublicBlueprint\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"a\n\x19GetPublicBlueprintRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.telcoautomation.googleapis.com/PublicBlueprint\"\xbe\x01\n\x17\x43reateDeploymentRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)telcoautomation.googleapis.com/Deployment\x12\x1a\n\rdeployment_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\ndeployment\x18\x03 \x01(\x0b\x32+.google.cloud.telcoautomation.v1.DeploymentB\x03\xe0\x41\x02\"\x95\x01\n\x17UpdateDeploymentRequest\x12\x44\n\ndeployment\x18\x01 \x01(\x0b\x32+.google.cloud.telcoautomation.v1.DeploymentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x9b\x01\n\x14GetDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\x12\x42\n\x04view\x18\x02 \x01(\x0e\x32/.google.cloud.telcoautomation.v1.DeploymentViewB\x03\xe0\x41\x01\"Z\n\x17RemoveDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"\xa1\x01\n\x16ListDeploymentsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)telcoautomation.googleapis.com/Deployment\x12\x13\n\x06\x66ilter\x18\x04 \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\"t\n\x17ListDeploymentsResponse\x12@\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32+.google.cloud.telcoautomation.v1.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x92\x01\n\x1eListDeploymentRevisionsRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\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\x1fListDeploymentRevisionsResponse\x12@\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32+.google.cloud.telcoautomation.v1.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa9\x01\n SearchDeploymentRevisionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"~\n!SearchDeploymentRevisionsResponse\x12@\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32+.google.cloud.telcoautomation.v1.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"b\n\x1f\x44iscardDeploymentChangesRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"\"\n DiscardDeploymentChangesResponse\"Y\n\x16\x41pplyDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"a\n\x1e\x43omputeDeploymentStatusRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"\xc9\x01\n\x1f\x43omputeDeploymentStatusResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12G\n\x11\x61ggregated_status\x18\x02 \x01(\x0e\x32\'.google.cloud.telcoautomation.v1.StatusB\x03\xe0\x41\x03\x12O\n\x11resource_statuses\x18\x03 \x03(\x0b\x32/.google.cloud.telcoautomation.v1.ResourceStatusB\x03\xe0\x41\x03\"v\n\x19RollbackDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\x12\x18\n\x0brevision_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"g\n\x1cGetHydratedDeploymentRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1telcoautomation.googleapis.com/HydratedDeployment\"\x9c\x01\n\x1eListHydratedDeploymentsRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31telcoautomation.googleapis.com/HydratedDeployment\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\"\x8d\x01\n\x1fListHydratedDeploymentsResponse\x12Q\n\x14hydrated_deployments\x18\x01 \x03(\x0b\x32\x33.google.cloud.telcoautomation.v1.HydratedDeployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xae\x01\n\x1fUpdateHydratedDeploymentRequest\x12U\n\x13hydrated_deployment\x18\x01 \x01(\x0b\x32\x33.google.cloud.telcoautomation.v1.HydratedDeploymentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"i\n\x1e\x41pplyHydratedDeploymentRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1telcoautomation.googleapis.com/HydratedDeployment\"\xdc\x01\n\x10ManagementConfig\x12_\n\x1astandard_management_config\x18\x01 \x01(\x0b\x32\x39.google.cloud.telcoautomation.v1.StandardManagementConfigH\x00\x12W\n\x16\x66ull_management_config\x18\x02 \x01(\x0b\x32\x35.google.cloud.telcoautomation.v1.FullManagementConfigH\x00\x42\x0e\n\x0coneof_config\"\xe3\x02\n\x18StandardManagementConfig\x12\x14\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06subnet\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16master_ipv4_cidr_block\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x63luster_cidr_block\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13services_cidr_block\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x63luster_named_range\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14services_named_range\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12o\n!master_authorized_networks_config\x18\x08 \x01(\x0b\x32?.google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfigB\x03\xe0\x41\x01\"\xdf\x02\n\x14\x46ullManagementConfig\x12\x14\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06subnet\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16master_ipv4_cidr_block\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x63luster_cidr_block\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13services_cidr_block\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x63luster_named_range\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14services_named_range\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12o\n!master_authorized_networks_config\x18\x08 \x01(\x0b\x32?.google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfigB\x03\xe0\x41\x01\"\xc6\x01\n\x1eMasterAuthorizedNetworksConfig\x12\x63\n\x0b\x63idr_blocks\x18\x01 \x03(\x0b\x32I.google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfig.CidrBlockB\x03\xe0\x41\x01\x1a?\n\tCidrBlock\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ncidr_block\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\\\n\x04\x46ile\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x64\x65leted\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x15\n\x08\x65\x64itable\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xc1\x02\n\x0eResourceStatus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1a\n\x12resource_namespace\x18\x02 \x01(\t\x12\r\n\x05group\x18\x03 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12\x0c\n\x04kind\x18\x05 \x01(\t\x12I\n\rresource_type\x18\x06 \x01(\x0e\x32-.google.cloud.telcoautomation.v1.ResourceTypeB\x03\xe0\x41\x03\x12<\n\x06status\x18\x07 \x01(\x0e\x32\'.google.cloud.telcoautomation.v1.StatusB\x03\xe0\x41\x03\x12N\n\x10nf_deploy_status\x18\x08 \x01(\x0b\x32/.google.cloud.telcoautomation.v1.NFDeployStatusB\x03\xe0\x41\x03\"\x8c\x01\n\x0eNFDeployStatus\x12\x19\n\x0ctargeted_nfs\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tready_nfs\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12G\n\x05sites\x18\x03 \x03(\x0b\x32\x33.google.cloud.telcoautomation.v1.NFDeploySiteStatusB\x03\xe0\x41\x03\"\xd8\x01\n\x12NFDeploySiteStatus\x12\x11\n\x04site\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10pending_deletion\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12H\n\thydration\x18\x03 \x01(\x0b\x32\x30.google.cloud.telcoautomation.v1.HydrationStatusB\x03\xe0\x41\x03\x12\x46\n\x08workload\x18\x04 \x01(\x0b\x32/.google.cloud.telcoautomation.v1.WorkloadStatusB\x03\xe0\x41\x03\"o\n\x0fHydrationStatus\x12G\n\x0csite_version\x18\x01 \x01(\x0b\x32,.google.cloud.telcoautomation.v1.SiteVersionB\x03\xe0\x41\x03\x12\x13\n\x06status\x18\x02 \x01(\tB\x03\xe0\x41\x03\"T\n\x0bSiteVersion\x12\x16\n\tnf_vendor\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07nf_type\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nnf_version\x18\x03 \x01(\tB\x03\xe0\x41\x03\"n\n\x0eWorkloadStatus\x12G\n\x0csite_version\x18\x01 \x01(\x0b\x32,.google.cloud.telcoautomation.v1.SiteVersionB\x03\xe0\x41\x03\x12\x13\n\x06status\x18\x02 \x01(\tB\x03\xe0\x41\x03*b\n\rBlueprintView\x12\x1e\n\x1a\x42LUEPRINT_VIEW_UNSPECIFIED\x10\x00\x12\x18\n\x14\x42LUEPRINT_VIEW_BASIC\x10\x01\x12\x17\n\x13\x42LUEPRINT_VIEW_FULL\x10\x02*f\n\x0e\x44\x65ploymentView\x12\x1f\n\x1b\x44\x45PLOYMENT_VIEW_UNSPECIFIED\x10\x00\x12\x19\n\x15\x44\x45PLOYMENT_VIEW_BASIC\x10\x01\x12\x18\n\x14\x44\x45PLOYMENT_VIEW_FULL\x10\x02*^\n\x0cResourceType\x12\x1d\n\x19RESOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12NF_DEPLOY_RESOURCE\x10\x01\x12\x17\n\x13\x44\x45PLOYMENT_RESOURCE\x10\x02*\xb6\x01\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x16\n\x12STATUS_IN_PROGRESS\x10\x01\x12\x11\n\rSTATUS_ACTIVE\x10\x02\x12\x11\n\rSTATUS_FAILED\x10\x03\x12\x13\n\x0fSTATUS_DELETING\x10\x04\x12\x12\n\x0eSTATUS_DELETED\x10\x05\x12\x12\n\x0eSTATUS_PEERING\x10\n\x12\x19\n\x15STATUS_NOT_APPLICABLE\x10\x0b*\x90\x01\n\x0f\x44\x65ploymentLevel\x12 \n\x1c\x44\x45PLOYMENT_LEVEL_UNSPECIFIED\x10\x00\x12\r\n\tHYDRATION\x10\x01\x12\x15\n\x11SINGLE_DEPLOYMENT\x10\x02\x12\x14\n\x10MULTI_DEPLOYMENT\x10\x03\x12\x1f\n\x1bWORKLOAD_CLUSTER_DEPLOYMENT\x10\x04\x32\xec\x43\n\x0fTelcoAutomation\x12\xee\x01\n\x19ListOrchestrationClusters\x12\x41.google.cloud.telcoautomation.v1.ListOrchestrationClustersRequest\x1a\x42.google.cloud.telcoautomation.v1.ListOrchestrationClustersResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*}/orchestrationClusters\x12\xdb\x01\n\x17GetOrchestrationCluster\x12?.google.cloud.telcoautomation.v1.GetOrchestrationClusterRequest\x1a\x35.google.cloud.telcoautomation.v1.OrchestrationCluster\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/orchestrationClusters/*}\x12\xbe\x02\n\x1a\x43reateOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.CreateOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41)\n\x14OrchestrationCluster\x12\x11OperationMetadata\xda\x41\x35parent,orchestration_cluster,orchestration_cluster_id\x82\xd3\xe4\x93\x02R\"9/v1/{parent=projects/*/locations/*}/orchestrationClusters:\x15orchestration_cluster\x12\xf6\x01\n\x1a\x44\x65leteOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.DeleteOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/orchestrationClusters/*}\x12\xba\x01\n\x0cListEdgeSlms\x12\x34.google.cloud.telcoautomation.v1.ListEdgeSlmsRequest\x1a\x35.google.cloud.telcoautomation.v1.ListEdgeSlmsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/edgeSlms\x12\xa7\x01\n\nGetEdgeSlm\x12\x32.google.cloud.telcoautomation.v1.GetEdgeSlmRequest\x1a(.google.cloud.telcoautomation.v1.EdgeSlm\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/edgeSlms/*}\x12\xe2\x01\n\rCreateEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.CreateEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x1c\n\x07\x45\x64geSlm\x12\x11OperationMetadata\xda\x41\x1bparent,edge_slm,edge_slm_id\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/edgeSlms:\x08\x65\x64ge_slm\x12\xcf\x01\n\rDeleteEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.DeleteEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/edgeSlms/*}\x12\xf1\x01\n\x0f\x43reateBlueprint\x12\x37.google.cloud.telcoautomation.v1.CreateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"y\xda\x41\x1dparent,blueprint,blueprint_id\x82\xd3\xe4\x93\x02S\"F/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:\tblueprint\x12\xf3\x01\n\x0fUpdateBlueprint\x12\x37.google.cloud.telcoautomation.v1.UpdateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"{\xda\x41\x15\x62lueprint,update_mask\x82\xd3\xe4\x93\x02]2P/v1/{blueprint.name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:\tblueprint\x12\xc7\x01\n\x0cGetBlueprint\x12\x34.google.cloud.telcoautomation.v1.GetBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\x12\xb9\x01\n\x0f\x44\x65leteBlueprint\x12\x37.google.cloud.telcoautomation.v1.DeleteBlueprintRequest\x1a\x16.google.protobuf.Empty\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H*F/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\x12\xda\x01\n\x0eListBlueprints\x12\x36.google.cloud.telcoautomation.v1.ListBlueprintsRequest\x1a\x37.google.cloud.telcoautomation.v1.ListBlueprintsResponse\"W\xda\x41\x06parent\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints\x12\xda\x01\n\x10\x41pproveBlueprint\x12\x38.google.cloud.telcoautomation.v1.ApproveBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:approve:\x01*\x12\xda\x01\n\x10ProposeBlueprint\x12\x38.google.cloud.telcoautomation.v1.ProposeBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:propose:\x01*\x12\xd7\x01\n\x0fRejectBlueprint\x12\x37.google.cloud.telcoautomation.v1.RejectBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:reject:\x01*\x12\xfe\x01\n\x16ListBlueprintRevisions\x12>.google.cloud.telcoautomation.v1.ListBlueprintRevisionsRequest\x1a?.google.cloud.telcoautomation.v1.ListBlueprintRevisionsResponse\"c\xda\x41\x04name\x82\xd3\xe4\x93\x02V\x12T/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:listRevisions\x12\x8e\x02\n\x18SearchBlueprintRevisions\x12@.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsRequest\x1a\x41.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsResponse\"m\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02X\x12V/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:searchRevisions\x12\x92\x02\n\x19SearchDeploymentRevisions\x12\x41.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsRequest\x1a\x42.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsResponse\"n\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02Y\x12W/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:searchRevisions\x12\xfe\x01\n\x17\x44iscardBlueprintChanges\x12?.google.cloud.telcoautomation.v1.DiscardBlueprintChangesRequest\x1a@.google.cloud.telcoautomation.v1.DiscardBlueprintChangesResponse\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:discard:\x01*\x12\xda\x01\n\x14ListPublicBlueprints\x12<.google.cloud.telcoautomation.v1.ListPublicBlueprintsRequest\x1a=.google.cloud.telcoautomation.v1.ListPublicBlueprintsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/publicBlueprints\x12\xc7\x01\n\x12GetPublicBlueprint\x12:.google.cloud.telcoautomation.v1.GetPublicBlueprintRequest\x1a\x30.google.cloud.telcoautomation.v1.PublicBlueprint\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/publicBlueprints/*}\x12\xf8\x01\n\x10\x43reateDeployment\x12\x38.google.cloud.telcoautomation.v1.CreateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"}\xda\x41\x1fparent,deployment,deployment_id\x82\xd3\xe4\x93\x02U\"G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:\ndeployment\x12\xfa\x01\n\x10UpdateDeployment\x12\x38.google.cloud.telcoautomation.v1.UpdateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"\x7f\xda\x41\x16\x64\x65ployment,update_mask\x82\xd3\xe4\x93\x02`2R/v1/{deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:\ndeployment\x12\xcb\x01\n\rGetDeployment\x12\x35.google.cloud.telcoautomation.v1.GetDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I\x12G/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}\x12\xc6\x01\n\x10RemoveDeployment\x12\x38.google.cloud.telcoautomation.v1.RemoveDeploymentRequest\x1a\x16.google.protobuf.Empty\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:remove:\x01*\x12\xde\x01\n\x0fListDeployments\x12\x37.google.cloud.telcoautomation.v1.ListDeploymentsRequest\x1a\x38.google.cloud.telcoautomation.v1.ListDeploymentsResponse\"X\xda\x41\x06parent\x82\xd3\xe4\x93\x02I\x12G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments\x12\x82\x02\n\x17ListDeploymentRevisions\x12?.google.cloud.telcoautomation.v1.ListDeploymentRevisionsRequest\x1a@.google.cloud.telcoautomation.v1.ListDeploymentRevisionsResponse\"d\xda\x41\x04name\x82\xd3\xe4\x93\x02W\x12U/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:listRevisions\x12\x82\x02\n\x18\x44iscardDeploymentChanges\x12@.google.cloud.telcoautomation.v1.DiscardDeploymentChangesRequest\x1a\x41.google.cloud.telcoautomation.v1.DiscardDeploymentChangesResponse\"a\xda\x41\x04name\x82\xd3\xe4\x93\x02T\"O/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:discard:\x01*\x12\xd8\x01\n\x0f\x41pplyDeployment\x12\x37.google.cloud.telcoautomation.v1.ApplyDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:apply:\x01*\x12\x8c\x02\n\x17\x43omputeDeploymentStatus\x12?.google.cloud.telcoautomation.v1.ComputeDeploymentStatusRequest\x1a@.google.cloud.telcoautomation.v1.ComputeDeploymentStatusResponse\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61\x12_/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:computeDeploymentStatus\x12\xed\x01\n\x12RollbackDeployment\x12:.google.cloud.telcoautomation.v1.RollbackDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"n\xda\x41\x10name,revision_id\x82\xd3\xe4\x93\x02U\"P/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:rollback:\x01*\x12\xf9\x01\n\x15GetHydratedDeployment\x12=.google.cloud.telcoautomation.v1.GetHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"l\xda\x41\x04name\x82\xd3\xe4\x93\x02_\x12]/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}\x12\x8c\x02\n\x17ListHydratedDeployments\x12?.google.cloud.telcoautomation.v1.ListHydratedDeploymentsRequest\x1a@.google.cloud.telcoautomation.v1.ListHydratedDeploymentsResponse\"n\xda\x41\x06parent\x82\xd3\xe4\x93\x02_\x12]/v1/{parent=projects/*/locations/*/orchestrationClusters/*/deployments/*}/hydratedDeployments\x12\xc5\x02\n\x18UpdateHydratedDeployment\x12@.google.cloud.telcoautomation.v1.UpdateHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"\xb1\x01\xda\x41\x1fhydrated_deployment,update_mask\x82\xd3\xe4\x93\x02\x88\x01\x32q/v1/{hydrated_deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:\x13hydrated_deployment\x12\x86\x02\n\x17\x41pplyHydratedDeployment\x12?.google.cloud.telcoautomation.v1.ApplyHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"u\xda\x41\x04name\x82\xd3\xe4\x93\x02h\"c/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:apply:\x01*\x1aR\xca\x41\x1etelcoautomation.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf5\x01\n#com.google.cloud.telcoautomation.v1B\x14TelcoautomationProtoP\x01ZMcloud.google.com/go/telcoautomation/apiv1/telcoautomationpb;telcoautomationpb\xaa\x02\x1fGoogle.Cloud.TelcoAutomation.V1\xca\x02\x1fGoogle\\Cloud\\TelcoAutomation\\V1\xea\x02\"Google::Cloud::TelcoAutomation::V1b\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 TelcoAutomation + module V1 + OrchestrationCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.OrchestrationCluster").msgclass + OrchestrationCluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.OrchestrationCluster.State").enummodule + EdgeSlm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.EdgeSlm").msgclass + EdgeSlm::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.EdgeSlm.State").enummodule + EdgeSlm::WorkloadClusterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.EdgeSlm.WorkloadClusterType").enummodule + Blueprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Blueprint").msgclass + Blueprint::ApprovalState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Blueprint.ApprovalState").enummodule + PublicBlueprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.PublicBlueprint").msgclass + Deployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Deployment").msgclass + Deployment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Deployment.State").enummodule + HydratedDeployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.HydratedDeployment").msgclass + HydratedDeployment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.HydratedDeployment.State").enummodule + ListOrchestrationClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListOrchestrationClustersRequest").msgclass + ListOrchestrationClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListOrchestrationClustersResponse").msgclass + GetOrchestrationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetOrchestrationClusterRequest").msgclass + CreateOrchestrationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateOrchestrationClusterRequest").msgclass + DeleteOrchestrationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeleteOrchestrationClusterRequest").msgclass + ListEdgeSlmsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListEdgeSlmsRequest").msgclass + ListEdgeSlmsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListEdgeSlmsResponse").msgclass + GetEdgeSlmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetEdgeSlmRequest").msgclass + CreateEdgeSlmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateEdgeSlmRequest").msgclass + DeleteEdgeSlmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeleteEdgeSlmRequest").msgclass + CreateBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateBlueprintRequest").msgclass + UpdateBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.UpdateBlueprintRequest").msgclass + GetBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetBlueprintRequest").msgclass + DeleteBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeleteBlueprintRequest").msgclass + ListBlueprintsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintsRequest").msgclass + ListBlueprintsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintsResponse").msgclass + ApproveBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ApproveBlueprintRequest").msgclass + ProposeBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ProposeBlueprintRequest").msgclass + RejectBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.RejectBlueprintRequest").msgclass + ListBlueprintRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintRevisionsRequest").msgclass + ListBlueprintRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintRevisionsResponse").msgclass + SearchBlueprintRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchBlueprintRevisionsRequest").msgclass + SearchBlueprintRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchBlueprintRevisionsResponse").msgclass + DiscardBlueprintChangesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardBlueprintChangesRequest").msgclass + DiscardBlueprintChangesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardBlueprintChangesResponse").msgclass + ListPublicBlueprintsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListPublicBlueprintsRequest").msgclass + ListPublicBlueprintsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListPublicBlueprintsResponse").msgclass + GetPublicBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetPublicBlueprintRequest").msgclass + CreateDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateDeploymentRequest").msgclass + UpdateDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.UpdateDeploymentRequest").msgclass + GetDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetDeploymentRequest").msgclass + RemoveDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.RemoveDeploymentRequest").msgclass + ListDeploymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentsRequest").msgclass + ListDeploymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentsResponse").msgclass + ListDeploymentRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentRevisionsRequest").msgclass + ListDeploymentRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentRevisionsResponse").msgclass + SearchDeploymentRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchDeploymentRevisionsRequest").msgclass + SearchDeploymentRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchDeploymentRevisionsResponse").msgclass + DiscardDeploymentChangesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardDeploymentChangesRequest").msgclass + DiscardDeploymentChangesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardDeploymentChangesResponse").msgclass + ApplyDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ApplyDeploymentRequest").msgclass + ComputeDeploymentStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ComputeDeploymentStatusRequest").msgclass + ComputeDeploymentStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ComputeDeploymentStatusResponse").msgclass + RollbackDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.RollbackDeploymentRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.OperationMetadata").msgclass + GetHydratedDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetHydratedDeploymentRequest").msgclass + ListHydratedDeploymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListHydratedDeploymentsRequest").msgclass + ListHydratedDeploymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListHydratedDeploymentsResponse").msgclass + UpdateHydratedDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.UpdateHydratedDeploymentRequest").msgclass + ApplyHydratedDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ApplyHydratedDeploymentRequest").msgclass + ManagementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ManagementConfig").msgclass + StandardManagementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.StandardManagementConfig").msgclass + FullManagementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.FullManagementConfig").msgclass + MasterAuthorizedNetworksConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfig").msgclass + MasterAuthorizedNetworksConfig::CidrBlock = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfig.CidrBlock").msgclass + File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.File").msgclass + ResourceStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ResourceStatus").msgclass + NFDeployStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.NFDeployStatus").msgclass + NFDeploySiteStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.NFDeploySiteStatus").msgclass + HydrationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.HydrationStatus").msgclass + SiteVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SiteVersion").msgclass + WorkloadStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.WorkloadStatus").msgclass + BlueprintView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.BlueprintView").enummodule + DeploymentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeploymentView").enummodule + ResourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ResourceType").enummodule + Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Status").enummodule + DeploymentLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeploymentLevel").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb new file mode 100644 index 000000000000..bc4578b621de --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb @@ -0,0 +1,126 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/telcoautomation/v1/telcoautomation.proto for package 'Google.Cloud.TelcoAutomation.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/telcoautomation/v1/telcoautomation_pb' + +module Google + module Cloud + module TelcoAutomation + module V1 + module TelcoAutomation + # TelcoAutomation Service manages the control plane cluster a.k.a. + # Orchestration Cluster (GKE cluster with config controller) of TNA. It also + # exposes blueprint APIs which manages the lifecycle of blueprints that control + # the infrastructure setup (e.g GDCE clusters) and deployment of network + # functions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.telcoautomation.v1.TelcoAutomation' + + # Lists OrchestrationClusters in a given project and location. + rpc :ListOrchestrationClusters, ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse + # Gets details of a single OrchestrationCluster. + rpc :GetOrchestrationCluster, ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster + # Creates a new OrchestrationCluster in a given project and location. + rpc :CreateOrchestrationCluster, ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, ::Google::Longrunning::Operation + # Deletes a single OrchestrationCluster. + rpc :DeleteOrchestrationCluster, ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, ::Google::Longrunning::Operation + # Lists EdgeSlms in a given project and location. + rpc :ListEdgeSlms, ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse + # Gets details of a single EdgeSlm. + rpc :GetEdgeSlm, ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, ::Google::Cloud::TelcoAutomation::V1::EdgeSlm + # Creates a new EdgeSlm in a given project and location. + rpc :CreateEdgeSlm, ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, ::Google::Longrunning::Operation + # Deletes a single EdgeSlm. + rpc :DeleteEdgeSlm, ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, ::Google::Longrunning::Operation + # Creates a blueprint. + rpc :CreateBlueprint, ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint + # Updates a blueprint. + rpc :UpdateBlueprint, ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint + # Returns the requested blueprint. + rpc :GetBlueprint, ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint + # Deletes a blueprint and all its revisions. + rpc :DeleteBlueprint, ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, ::Google::Protobuf::Empty + # List all blueprints. + rpc :ListBlueprints, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse + # Approves a blueprint and commits a new revision. + rpc :ApproveBlueprint, ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint + # Proposes a blueprint for approval of changes. + rpc :ProposeBlueprint, ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint + # Rejects a blueprint revision proposal and flips it back to Draft state. + rpc :RejectBlueprint, ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint + # List blueprint revisions of a given blueprint. + rpc :ListBlueprintRevisions, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse + # Searches across blueprint revisions. + rpc :SearchBlueprintRevisions, ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse + # Searches across deployment revisions. + rpc :SearchDeploymentRevisions, ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse + # Discards the changes in a blueprint and reverts the blueprint to the last + # approved blueprint revision. No changes take place if a blueprint does not + # have revisions. + rpc :DiscardBlueprintChanges, ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse + # Lists the blueprints in TNA's public catalog. Default page size = 20, + # Max Page Size = 100. + rpc :ListPublicBlueprints, ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse + # Returns the requested public blueprint. + rpc :GetPublicBlueprint, ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint + # Creates a deployment. + rpc :CreateDeployment, ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment + # Updates a deployment. + rpc :UpdateDeployment, ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment + # Returns the requested deployment. + rpc :GetDeployment, ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment + # Removes the deployment by marking it as DELETING. Post which deployment and + # it's revisions gets deleted. + rpc :RemoveDeployment, ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, ::Google::Protobuf::Empty + # List all deployments. + rpc :ListDeployments, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse + # List deployment revisions of a given deployment. + rpc :ListDeploymentRevisions, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse + # Discards the changes in a deployment and reverts the deployment to the last + # approved deployment revision. No changes take place if a deployment does + # not have revisions. + rpc :DiscardDeploymentChanges, ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse + # Applies the deployment's YAML files to the parent orchestration cluster. + rpc :ApplyDeployment, ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment + # Returns the requested deployment status. + rpc :ComputeDeploymentStatus, ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse + # Rollback the active deployment to the given past approved deployment + # revision. + rpc :RollbackDeployment, ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment + # Returns the requested hydrated deployment. + rpc :GetHydratedDeployment, ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment + # List all hydrated deployments present under a deployment. + rpc :ListHydratedDeployments, ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse + # Updates a hydrated deployment. + rpc :UpdateHydratedDeployment, ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment + # Applies a hydrated deployment to a workload cluster. + rpc :ApplyHydratedDeployment, ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md new file mode 100644 index 000000000000..ad404433aa18 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Telco Automation V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-telco_automation-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb new file mode 100644 index 000000000000..2386f15aacc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb @@ -0,0 +1,1551 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation + module V1 + # Orchestration cluster represents a GKE cluster with config controller and + # TNA specific components installed on it. + # @!attribute [rw] name + # @return [::String] + # Name of the orchestration cluster. The name of orchestration cluster cannot + # be more than 24 characters. + # @!attribute [rw] management_config + # @return [::Google::Cloud::TelcoAutomation::V1::ManagementConfig] + # Management configuration of the underlying GKE cluster. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create time stamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Update time stamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [r] tna_version + # @return [::String] + # Output only. Provides the TNA version installed on the cluster. + # @!attribute [r] state + # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster::State] + # Output only. State of the Orchestration Cluster. + class OrchestrationCluster + 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 + + # Possible states that the Orchestration Cluster can be in. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # OrchestrationCluster is being created. + CREATING = 1 + + # OrchestrationCluster has been created and is ready for use. + ACTIVE = 2 + + # OrchestrationCluster is being deleted. + DELETING = 3 + + # OrchestrationCluster encountered an error and is in an indeterministic + # state. User can still initiate a delete operation on this state. + FAILED = 4 + end + end + + # EdgeSlm represents an SLM instance which manages the lifecycle of edge + # components installed on Workload clusters managed by an Orchestration + # Cluster. + # @!attribute [rw] name + # @return [::String] + # Name of the EdgeSlm resource. + # @!attribute [rw] orchestration_cluster + # @return [::String] + # Immutable. Reference to the orchestration cluster on which templates for + # this resources will be applied. This should be of format + # projects/\\{project}/locations/\\{location}/orchestrationClusters/\\{orchestration_cluster}. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create time stamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Update time stamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels as key value pairs. The key and value should contain + # characters which are UTF-8 compliant and less than 50 characters. + # @!attribute [r] tna_version + # @return [::String] + # Output only. Provides the active TNA version for this resource. + # @!attribute [r] state + # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm::State] + # Output only. State of the EdgeSlm resource. + # @!attribute [rw] workload_cluster_type + # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm::WorkloadClusterType] + # Optional. Type of workload cluster for which an EdgeSLM resource is + # created. + class EdgeSlm + 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 + + # Possible states of the resource. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # EdgeSlm is being created. + CREATING = 1 + + # EdgeSlm has been created and is ready for use. + ACTIVE = 2 + + # EdgeSlm is being deleted. + DELETING = 3 + + # EdgeSlm encountered an error and is in an indeterministic + # state. User can still initiate a delete operation on this state. + FAILED = 4 + end + + # Workload clusters supported by TNA. New values will be added to the enum + # list as TNA adds supports for new workload clusters in future. + module WorkloadClusterType + # Unspecified workload cluster. + WORKLOAD_CLUSTER_TYPE_UNSPECIFIED = 0 + + # Workload cluster is a GDCE cluster. + GDCE = 1 + + # Workload cluster is a GKE cluster. + GKE = 2 + end + end + + # A Blueprint contains a collection of kubernetes resources in the form of + # YAML files. The file contents of a blueprint are collectively known as + # package. A blueprint can be + # a) imported from TNA's public catalog + # b) modified as per a user's need + # c) proposed and approved. + # On approval, a revision of blueprint is created which can be used to + # create a deployment on Orchestration or Workload Cluster. + # @!attribute [rw] name + # @return [::String] + # The name of the blueprint. If unspecified, the name will be autogenerated + # from server side. Name of the blueprint must not contain `@` character. + # @!attribute [r] revision_id + # @return [::String] + # Output only. Immutable. The revision ID of the blueprint. + # A new revision is committed whenever a blueprint is approved. + # @!attribute [rw] source_blueprint + # @return [::String] + # Required. Immutable. The public blueprint ID from which this blueprint was + # created. + # @!attribute [r] revision_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp that the revision was created. + # @!attribute [r] approval_state + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint::ApprovalState] + # Output only. Approval state of the blueprint (DRAFT, PROPOSED, APPROVED) + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human readable name of a Blueprint. + # @!attribute [r] repository + # @return [::String] + # Output only. Name of the repository where the blueprint files are stored. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::File>] + # Optional. Files present in a blueprint. + # When invoking UpdateBlueprint API, only the modified files should be + # included in this. Files that are not included in the update of a blueprint + # will not be changed. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels are key-value attributes that can be set on a blueprint + # resource by the user. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Blueprint creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the blueprint was updated. + # @!attribute [r] source_provider + # @return [::String] + # Output only. Source provider is the author of a public blueprint, from + # which this blueprint is created. + # @!attribute [r] deployment_level + # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentLevel] + # Output only. DeploymentLevel of a blueprint signifies where the blueprint + # will be applied. e.g. [HYDRATION, SINGLE_DEPLOYMENT, MULTI_DEPLOYMENT] + # @!attribute [r] rollback_support + # @return [::Boolean] + # Output only. Indicates if the deployment created from this blueprint can be + # rolled back. + class Blueprint + 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 + + # Approval state indicates the state of a Blueprint in its approval + # lifecycle. + module ApprovalState + # Unspecified state. + APPROVAL_STATE_UNSPECIFIED = 0 + + # A blueprint starts in DRAFT state once it is created. All edits are made + # to the blueprint in DRAFT state. + DRAFT = 1 + + # When the edits are ready for review, blueprint can be proposed and moves + # to PROPOSED state. Edits cannot be made to a blueprint in PROPOSED state. + PROPOSED = 2 + + # When a proposed blueprint is approved, it moves to APPROVED state. A new + # revision is committed. The latest committed revision can be used to + # create a deployment on Orchestration or Workload Cluster. Edits to an + # APPROVED blueprint changes its state back to DRAFT. The last committed + # revision of a blueprint represents its latest APPROVED state. + APPROVED = 3 + end + end + + # A Blueprint contains a collection of kubernetes resources in the form of + # YAML files. The file contents of a blueprint are collectively known as + # package. + # Public blueprint is a TNA provided blueprint that in present in TNA's public + # catalog. A user can copy the public blueprint to their private catalog for + # further modifications. + # @!attribute [rw] name + # @return [::String] + # Name of the public blueprint. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the public blueprint. + # @!attribute [rw] description + # @return [::String] + # The description of the public blueprint. + # @!attribute [rw] deployment_level + # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentLevel] + # DeploymentLevel of a blueprint signifies where the blueprint will be + # applied. e.g. [HYDRATION, SINGLE_DEPLOYMENT, MULTI_DEPLOYMENT] + # @!attribute [rw] source_provider + # @return [::String] + # Source provider is the author of a public blueprint. e.g. Google, vendors + # @!attribute [r] rollback_support + # @return [::Boolean] + # Output only. Indicates if the deployment created from this blueprint can be + # rolled back. + class PublicBlueprint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Deployment contains a collection of YAML files (This collection is also known + # as package) that can to applied on an orchestration cluster (GKE cluster with + # TNA addons) or a workload cluster. + # @!attribute [rw] name + # @return [::String] + # The name of the deployment. + # @!attribute [r] revision_id + # @return [::String] + # Output only. Immutable. The revision ID of the deployment. + # A new revision is committed whenever a change in deployment is applied. + # @!attribute [rw] source_blueprint_revision + # @return [::String] + # Required. The blueprint revision from which this deployment was created. + # @!attribute [r] revision_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp that the revision was created. + # @!attribute [r] state + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment::State] + # Output only. State of the deployment (DRAFT, APPLIED, DELETING). + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human readable name of a Deployment. + # @!attribute [r] repository + # @return [::String] + # Output only. Name of the repository where the deployment package files are + # stored. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::File>] + # Optional. Files present in a deployment. + # When invoking UpdateDeployment API, only the modified files should be + # included in this. Files that are not included in the update of a deployment + # will not be changed. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels are key-value attributes that can be set on a deployment + # resource by the user. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Deployment creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the deployment was updated. + # @!attribute [r] source_provider + # @return [::String] + # Output only. Source provider is the author of a public blueprint, from + # which this deployment is created. + # @!attribute [rw] workload_cluster + # @return [::String] + # Optional. Immutable. The WorkloadCluster on which to create the Deployment. + # This field should only be passed when the deployment_level of the source + # blueprint specifies deployments on workload clusters e.g. + # WORKLOAD_CLUSTER_DEPLOYMENT. + # @!attribute [r] deployment_level + # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentLevel] + # Output only. Attributes to where the deployment can inflict changes. The + # value can only be [SINGLE_DEPLOYMENT, MULTI_DEPLOYMENT]. + # @!attribute [r] rollback_support + # @return [::Boolean] + # Output only. Indicates if the deployment can be rolled back, exported from + # public blueprint. + class Deployment + 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 + + # State defines which state the current deployment is in. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # A deployment starts in DRAFT state. All edits are made in DRAFT state. A + # deployment opened for editing after applying will be in draft state, + # while its prevision revision will be its current applied version. + DRAFT = 1 + + # This state means that the contents (YAML files containing kubernetes + # resources) of the deployment have been applied to an Orchestration or + # Workload Cluster. A revision is created when a deployment is applied. + # This revision will represent the latest view of what is applied on the + # cluster until the deployment is modified and applied again, which will + # create a new revision. + APPLIED = 2 + + # A deployment in DELETING state has been marked for deletion. Its + # deletion status can be queried using `ComputeDeploymentStatus` API. No + # updates are allowed to a deployment in DELETING state. + DELETING = 3 + end + end + + # A collection of kubernetes yaml files which are deployed on a Workload + # Cluster. Hydrated Deployments are created by TNA intent based automation. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the hydrated deployment. + # @!attribute [r] state + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment::State] + # Output only. State of the hydrated deployment (DRAFT, APPLIED). + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::File>] + # Optional. File contents of a hydrated deployment. + # When invoking UpdateHydratedBlueprint API, only the modified files should + # be included in this. Files that are not included in the update of a + # hydrated deployment will not be changed. + # @!attribute [r] workload_cluster + # @return [::String] + # Output only. WorkloadCluster identifies which workload cluster will the + # hydrated deployment will be deployed on. + class HydratedDeployment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State defines which state the current hydrated deployment is in. + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # A hydrated deployment starts in DRAFT state. All edits are made in DRAFT + # state. + DRAFT = 1 + + # When the edit is applied, the hydrated deployment moves to APPLIED + # state. No changes can be made once a hydrated deployment is applied. + APPLIED = 2 + end + end + + # Message for requesting list of OrchestrationClusters. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListOrchestrationClustersRequest + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListOrchestrationClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing OrchestrationClusters. + # @!attribute [rw] orchestration_clusters + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] + # The list of OrchestrationCluster + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListOrchestrationClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a OrchestrationCluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class GetOrchestrationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a OrchestrationCluster. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] orchestration_cluster_id + # @return [::String] + # Required. Id of the requesting object + # If auto-generating Id server-side, remove this field and + # orchestration_cluster_id from the method_signature of Create RPC + # @!attribute [rw] orchestration_cluster + # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateOrchestrationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a OrchestrationCluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteOrchestrationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of EdgeSlms + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListEdgeSlmsRequest + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results + class ListEdgeSlmsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing EdgeSlms. + # @!attribute [rw] edge_slms + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] + # The list of EdgeSlm + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListEdgeSlmsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a EdgeSlm. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class GetEdgeSlmRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a EdgeSlm. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] edge_slm_id + # @return [::String] + # Required. Id of the requesting object + # If auto-generating Id server-side, remove this field and + # edge_slm_id from the method_signature of Create RPC + # @!attribute [rw] edge_slm + # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateEdgeSlmRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a EdgeSlm. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteEdgeSlmRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `CreateBlueprint`. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of parent resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @!attribute [rw] blueprint_id + # @return [::String] + # Optional. The name of the blueprint. + # @!attribute [rw] blueprint + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # Required. The `Blueprint` to create. + class CreateBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `UpdateBlueprint`. + # @!attribute [rw] blueprint + # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] + # Required. The `blueprint` to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Update mask is used to specify the fields to be overwritten in + # the `blueprint` resource by the update. + class UpdateBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `GetBlueprint`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the blueprint. + # Case 1: If the name provided in the request is + # \\{blueprint_id}@\\{revision_id}, then the revision with revision_id will be + # returned. Case 2: If the name provided in the request is \\{blueprint}, then + # the current state of the blueprint is returned. + # @!attribute [rw] view + # @return [::Google::Cloud::TelcoAutomation::V1::BlueprintView] + # Optional. Defines the type of view of the blueprint. + # When field is not present BLUEPRINT_VIEW_BASIC is considered as default. + class GetBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `DeleteBlueprint`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of blueprint to delete. + # Blueprint name should be in the format \\{blueprint_id}, if + # \\{blueprint_id}@\\{revision_id} is passed then the API throws invalid + # argument. + class DeleteBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ListBlueprints`. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering only supports equality on blueprint state. + # It should be in the form: "state = DRAFT". `OR` operator can be used to + # get response for multiple states. e.g. "state = DRAFT OR state = PROPOSED". + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of blueprints to return per page. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, received from a previous ListBlueprints call. + # It can be provided to retrieve the subsequent page. + class ListBlueprintsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `ListBlueprints`. + # @!attribute [rw] blueprints + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # The list of requested blueprints. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListBlueprintsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ApproveBlueprint`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the blueprint to approve. The blueprint must be in + # Proposed state. A new revision is committed on approval. + class ApproveBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ProposeBlueprint`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the blueprint being proposed. + class ProposeBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `RejectBlueprint`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the blueprint being rejected. + class RejectBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ListBlueprintRevisions`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the blueprint to list revisions for. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of revisions to return per page. + # @!attribute [rw] page_token + # @return [::String] + # The page token, received from a previous ListBlueprintRevisions call + # It can be provided to retrieve the subsequent page. + class ListBlueprintRevisionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `ListBlueprintRevisions`. + # @!attribute [rw] blueprints + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # The revisions of the blueprint. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListBlueprintRevisionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `SearchBlueprintRevisions`. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @!attribute [rw] query + # @return [::String] + # Required. Supported queries: + # 1. "" : Lists all revisions across all blueprints. + # 2. "latest=true" : Lists latest revisions across all blueprints. + # 3. "name=\\{name}" : Lists all revisions of blueprint with name + # \\{name}. + # 4. "name=\\{name} latest=true": Lists latest revision of blueprint with name + # \\{name} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of blueprints revisions to return per page. + # max page size = 100, default page size = 20. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, received from a previous search call. + # It can be provided to retrieve the subsequent page. + class SearchBlueprintRevisionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `SearchBlueprintRevisions`. + # @!attribute [rw] blueprints + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Blueprint>] + # The list of requested blueprint revisions. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class SearchBlueprintRevisionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `DiscardBlueprintChanges`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the blueprint of which changes are being discarded. + class DiscardBlueprintChangesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `DiscardBlueprintChanges`. + class DiscardBlueprintChangesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ListPublicBlueprints`. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value of public blueprint. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}". + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + class ListPublicBlueprintsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `ListPublicBlueprints`. + # @!attribute [rw] public_blueprints + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] + # The list of public blueprints to return. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token identifying a page of results the server should + # return. + class ListPublicBlueprintsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `GetPublicBlueprint`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the public blueprint. + class GetPublicBlueprintRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `CreateDeployment`. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of parent resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @!attribute [rw] deployment_id + # @return [::String] + # Optional. The name of the deployment. + # @!attribute [rw] deployment + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # Required. The `Deployment` to create. + class CreateDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `UpdateDeployment`. + # @!attribute [rw] deployment + # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] + # Required. The `deployment` to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Update mask is used to specify the fields to be overwritten in + # the `deployment` resource by the update. + class UpdateDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `GetDeployment`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the deployment. + # Case 1: If the name provided in the request is + # \\{deployment_id}@\\{revision_id}, then the revision with revision_id will be + # returned. + # Case 2: If the name provided in the request is \\{deployment}, then + # the current state of the deployment is returned. + # @!attribute [rw] view + # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentView] + # Optional. Defines the type of view of the deployment. + # When field is not present VIEW_BASIC is considered as default. + class GetDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `RemoveDeployment`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of deployment to initiate delete. + class RemoveDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ListDeployments`. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering only supports equality on deployment state. + # It should be in the form: "state = DRAFT". `OR` operator can be used to + # get response for multiple states. e.g. "state = DRAFT OR state = APPLIED". + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of deployments to return per page. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, received from a previous ListDeployments call. + # It can be provided to retrieve the subsequent page. + class ListDeploymentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `ListDeployments`. + # @!attribute [rw] deployments + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # The list of requested deployments. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListDeploymentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for listing all revisions of a deployment. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the deployment to list revisions for. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of revisions to return per page. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, received from a previous ListDeploymentRevisions + # call Provide this to retrieve the subsequent page. + class ListDeploymentRevisionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of deployment revisions for a given deployment. + # @!attribute [rw] deployments + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # The revisions of the deployment. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListDeploymentRevisionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `SearchDeploymentRevisions`. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of parent orchestration cluster resource. + # Format should be - + # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". + # @!attribute [rw] query + # @return [::String] + # Required. Supported queries: + # 1. "" : Lists all revisions across all deployments. + # 2. "latest=true" : Lists latest revisions across all + # deployments. + # 3. "name=\\{name}" : Lists all revisions of deployment with name + # \\{name}. + # 4. "name=\\{name} latest=true": Lists latest revision of deployment with name + # \\{name} + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of deployment revisions to return per page. + # max page size = 100, default page size = 20. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, received from a previous search call. + # It can be provided to retrieve the subsequent page. + class SearchDeploymentRevisionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `SearchDeploymentRevisions`. + # @!attribute [rw] deployments + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Deployment>] + # The list of requested deployment revisions. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class SearchDeploymentRevisionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `DiscardDeploymentChanges`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the deployment of which changes are being discarded. + class DiscardDeploymentChangesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `DiscardDeploymentChanges`. + class DiscardDeploymentChangesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ApplyDeployment`. The resources in given deployment + # gets applied to Orchestration Cluster. A new revision is created when a + # deployment is applied. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the deployment to apply to orchestration cluster. + class ApplyDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ComputeDeploymentStatus`. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the deployment without revisionID. + class ComputeDeploymentStatusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `ComputeDeploymentStatus`. + # @!attribute [rw] name + # @return [::String] + # The name of the deployment. + # @!attribute [r] aggregated_status + # @return [::Google::Cloud::TelcoAutomation::V1::Status] + # Output only. Aggregated status of a deployment. + # @!attribute [r] resource_statuses + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::ResourceStatus>] + # Output only. Resource level status details in deployments. + class ComputeDeploymentStatusResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `RollbackDeployment`. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the deployment. + # @!attribute [rw] revision_id + # @return [::String] + # Required. The revision id of deployment to roll back to. + class RollbackDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have been cancelled successfully + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `GetHydratedDeployment`. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the hydrated deployment. + class GetHydratedDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `ListHydratedDeployments`. + # @!attribute [rw] parent + # @return [::String] + # Required. The deployment managing the hydrated deployments. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of hydrated deployments to return. The service + # may return fewer than this value. If unspecified, at most 50 hydrated + # deployments will be returned. The maximum value is 1000. Values above 1000 + # will be set to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, received from a previous ListHydratedDeployments + # call. Provide this to retrieve the subsequent page. + class ListHydratedDeploymentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response object for `ListHydratedDeployments`. + # @!attribute [rw] hydrated_deployments + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] + # The list of hydrated deployments. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListHydratedDeploymentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request object for `UpdateHydratedDeployment`. + # @!attribute [rw] hydrated_deployment + # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] + # Required. The hydrated deployment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. Update mask supports a special + # value `*` which fully replaces (equivalent to PUT) the resource provided. + class UpdateHydratedDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for applying a hydrated deployment. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the hydrated deployment to apply. + class ApplyHydratedDeploymentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of the cluster management + # @!attribute [rw] standard_management_config + # @return [::Google::Cloud::TelcoAutomation::V1::StandardManagementConfig] + # Configuration of the standard (GKE) cluster management + # + # Note: The following fields are mutually exclusive: `standard_management_config`, `full_management_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] full_management_config + # @return [::Google::Cloud::TelcoAutomation::V1::FullManagementConfig] + # Configuration of the full (Autopilot) cluster management. Full cluster + # management is a preview feature. + # + # Note: The following fields are mutually exclusive: `full_management_config`, `standard_management_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ManagementConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of the standard (GKE) cluster management. + # @!attribute [rw] network + # @return [::String] + # Optional. Name of the VPC Network to put the GKE cluster and nodes in. The + # VPC will be created if it doesn't exist. + # @!attribute [rw] subnet + # @return [::String] + # Optional. Specifies the subnet that the interface will be part of. Network + # key must be specified and the subnet must be a subnetwork of the specified + # network. + # @!attribute [rw] master_ipv4_cidr_block + # @return [::String] + # Optional. The /28 network that the masters will use. It should be free + # within the network. + # @!attribute [rw] cluster_cidr_block + # @return [::String] + # Optional. The IP address range for the cluster pod IPs. Set to blank to + # have a range chosen with the default size. Set to /netmask (e.g. /14) to + # have a range chosen with a specific netmask. Set to a CIDR notation + # (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, + # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + # @!attribute [rw] services_cidr_block + # @return [::String] + # Optional. The IP address range for the cluster service IPs. Set to blank to + # have a range chosen with the default size. Set to /netmask (e.g. /14) to + # have a range chosen with a specific netmask. Set to a CIDR notation (e.g. + # 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, + # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + # @!attribute [rw] cluster_named_range + # @return [::String] + # Optional. The name of the existing secondary range in the cluster's + # subnetwork to use for pod IP addresses. Alternatively, cluster_cidr_block + # can be used to automatically create a GKE-managed one. + # @!attribute [rw] services_named_range + # @return [::String] + # Optional. The name of the existing secondary range in the cluster's + # subnetwork to use for service ClusterIPs. Alternatively, + # services_cidr_block can be used to automatically create a GKE-managed one. + # @!attribute [rw] master_authorized_networks_config + # @return [::Google::Cloud::TelcoAutomation::V1::MasterAuthorizedNetworksConfig] + # Optional. Master Authorized Network that supports multiple CIDR blocks. + # Allows access to the k8s master from multiple blocks. It cannot be set at + # the same time with the field man_block. + class StandardManagementConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of the full (Autopilot) cluster management + # @!attribute [rw] network + # @return [::String] + # Optional. Name of the VPC Network to put the GKE cluster and nodes in. The + # VPC will be created if it doesn't exist. + # @!attribute [rw] subnet + # @return [::String] + # Optional. Specifies the subnet that the interface will be part of. Network + # key must be specified and the subnet must be a subnetwork of the specified + # network. + # @!attribute [rw] master_ipv4_cidr_block + # @return [::String] + # Optional. The /28 network that the masters will use. + # @!attribute [rw] cluster_cidr_block + # @return [::String] + # Optional. The IP address range for the cluster pod IPs. Set to blank to + # have a range chosen with the default size. Set to /netmask (e.g. /14) to + # have a range chosen with a specific netmask. Set to a CIDR notation + # (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, + # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + # @!attribute [rw] services_cidr_block + # @return [::String] + # Optional. The IP address range for the cluster service IPs. Set to blank to + # have a range chosen with the default size. Set to /netmask (e.g. /14) to + # have a range chosen with a specific netmask. Set to a CIDR notation (e.g. + # 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, + # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + # @!attribute [rw] cluster_named_range + # @return [::String] + # Optional. The name of the existing secondary range in the cluster's + # subnetwork to use for pod IP addresses. Alternatively, cluster_cidr_block + # can be used to automatically create a GKE-managed one. + # @!attribute [rw] services_named_range + # @return [::String] + # Optional. The name of the existing secondary range in the cluster's + # subnetwork to use for service ClusterIPs. Alternatively, + # services_cidr_block can be used to automatically create a GKE-managed one. + # @!attribute [rw] master_authorized_networks_config + # @return [::Google::Cloud::TelcoAutomation::V1::MasterAuthorizedNetworksConfig] + # Optional. Master Authorized Network that supports multiple CIDR blocks. + # Allows access to the k8s master from multiple blocks. It cannot be set at + # the same time with the field man_block. + class FullManagementConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of the Master Authorized Network that support multiple CIDRs + # @!attribute [rw] cidr_blocks + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::MasterAuthorizedNetworksConfig::CidrBlock>] + # Optional. cidr_blocks define up to 50 external networks that could access + # Kubernetes master through HTTPS. + class MasterAuthorizedNetworksConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # CidrBlock contains an optional name and one CIDR block. + # @!attribute [rw] display_name + # @return [::String] + # Optional. display_name is an optional field for users to identify CIDR + # blocks. + # @!attribute [rw] cidr_block + # @return [::String] + # Optional. cidr_block must be specified in CIDR notation when using + # master_authorized_networks_config. Currently, the user could still use + # the deprecated man_block field, so this field is currently optional, but + # will be required in the future. + class CidrBlock + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # File represents a yaml file present in a blueprint's package. + # @!attribute [rw] path + # @return [::String] + # Required. Path of the file in package. + # e.g. `gdce/v1/cluster.yaml` + # @!attribute [rw] content + # @return [::String] + # Optional. The contents of a file in string format. + # @!attribute [rw] deleted + # @return [::Boolean] + # Optional. Signifies whether a file is marked for deletion. + # @!attribute [rw] editable + # @return [::Boolean] + # Optional. Indicates whether changes are allowed to a file. If the field is + # not set, the file cannot be edited. + class File + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Status of a deployment resource. + # @!attribute [rw] name + # @return [::String] + # Name of the resource. + # @!attribute [rw] resource_namespace + # @return [::String] + # Namespace of the resource. + # @!attribute [rw] group + # @return [::String] + # Group to which the resource belongs to. + # @!attribute [rw] version + # @return [::String] + # Version of the resource. + # @!attribute [rw] kind + # @return [::String] + # Kind of the resource. + # @!attribute [r] resource_type + # @return [::Google::Cloud::TelcoAutomation::V1::ResourceType] + # Output only. Resource type. + # @!attribute [r] status + # @return [::Google::Cloud::TelcoAutomation::V1::Status] + # Output only. Status of the resource. + # @!attribute [r] nf_deploy_status + # @return [::Google::Cloud::TelcoAutomation::V1::NFDeployStatus] + # Output only. Detailed status of NFDeploy. + class ResourceStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Deployment status of NFDeploy. + # @!attribute [r] targeted_nfs + # @return [::Integer] + # Output only. Total number of NFs targeted by this deployment + # @!attribute [r] ready_nfs + # @return [::Integer] + # Output only. Total number of NFs targeted by this deployment with a Ready + # Condition set. + # @!attribute [r] sites + # @return [::Array<::Google::Cloud::TelcoAutomation::V1::NFDeploySiteStatus>] + # Output only. Per-Site Status. + class NFDeployStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Per-Site Status. + # @!attribute [r] site + # @return [::String] + # Output only. Site id. + # @!attribute [r] pending_deletion + # @return [::Boolean] + # Output only. If true, the Site Deletion is in progress. + # @!attribute [r] hydration + # @return [::Google::Cloud::TelcoAutomation::V1::HydrationStatus] + # Output only. Hydration status. + # @!attribute [r] workload + # @return [::Google::Cloud::TelcoAutomation::V1::WorkloadStatus] + # Output only. Workload status. + class NFDeploySiteStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Hydration status. + # @!attribute [r] site_version + # @return [::Google::Cloud::TelcoAutomation::V1::SiteVersion] + # Output only. SiteVersion Hydration is targeting. + # @!attribute [r] status + # @return [::String] + # Output only. Status. + class HydrationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # SiteVersion Hydration is targeting. + # @!attribute [r] nf_vendor + # @return [::String] + # Output only. NF vendor. + # @!attribute [r] nf_type + # @return [::String] + # Output only. NF vendor type. + # @!attribute [r] nf_version + # @return [::String] + # Output only. NF version. + class SiteVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Workload status. + # @!attribute [r] site_version + # @return [::Google::Cloud::TelcoAutomation::V1::SiteVersion] + # Output only. SiteVersion running in the workload cluster. + # @!attribute [r] status + # @return [::String] + # Output only. Status. + class WorkloadStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # BlueprintView defines the type of view of the blueprint. + module BlueprintView + # Unspecified enum value. + BLUEPRINT_VIEW_UNSPECIFIED = 0 + + # View which only contains metadata. + BLUEPRINT_VIEW_BASIC = 1 + + # View which contains metadata and files it encapsulates. + BLUEPRINT_VIEW_FULL = 2 + end + + # DeploymentView defines the type of view of the deployment. + module DeploymentView + # Unspecified enum value. + DEPLOYMENT_VIEW_UNSPECIFIED = 0 + + # View which only contains metadata. + DEPLOYMENT_VIEW_BASIC = 1 + + # View which contains metadata and files it encapsulates. + DEPLOYMENT_VIEW_FULL = 2 + end + + # Represent type of CR. + module ResourceType + # Unspecified resource type. + RESOURCE_TYPE_UNSPECIFIED = 0 + + # User specified NF Deploy CR. + NF_DEPLOY_RESOURCE = 1 + + # CRs that are part of a blueprint. + DEPLOYMENT_RESOURCE = 2 + end + + # Status of an entity (resource, deployment). + module Status + # Unknown state. + STATUS_UNSPECIFIED = 0 + + # Under progress. + STATUS_IN_PROGRESS = 1 + + # Running and ready to serve traffic. + STATUS_ACTIVE = 2 + + # Failed or stalled. + STATUS_FAILED = 3 + + # Delete in progress. + STATUS_DELETING = 4 + + # Deleted deployment. + STATUS_DELETED = 5 + + # NFDeploy specific status. Peering in progress. + STATUS_PEERING = 10 + + # K8s objects such as NetworkAttachmentDefinition don't have a defined + # status. + STATUS_NOT_APPLICABLE = 11 + end + + # DeploymentLevel of a blueprint signifies where the blueprint will be + # applied. + module DeploymentLevel + # Default unspecified deployment level. + DEPLOYMENT_LEVEL_UNSPECIFIED = 0 + + # Blueprints at HYDRATION level cannot be used to create a Deployment + # (A user cannot manually initate deployment of these blueprints on + # orchestration or workload cluster). + # These blueprints stay in a user's private catalog and are configured and + # deployed by TNA automation. + HYDRATION = 1 + + # Blueprints at SINGLE_DEPLOYMENT level can be + # a) Modified in private catalog. + # b) Used to create a deployment on orchestration cluster by the user, once + # approved. + SINGLE_DEPLOYMENT = 2 + + # Blueprints at MULTI_DEPLOYMENT level can be + # a) Modified in private catalog. + # b) Used to create a deployment on orchestration cluster which will create + # further hydrated deployments. + MULTI_DEPLOYMENT = 3 + + # Blueprints at WORKLOAD_CLUSTER_DEPLOYMENT level can be + # a) Modified in private catalog. + # b) Used to create a deployment on workload cluster by the user, once + # approved. + WORKLOAD_CLUSTER_DEPLOYMENT = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-telco_automation-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile new file mode 100644 index 000000000000..5dd146715d0e --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1", path: "../" +else + gem "google-cloud-telco_automation-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-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json new file mode 100644 index 000000000000..7a4dce2494a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json @@ -0,0 +1,1455 @@ +{ + "client_library": { + "name": "google-cloud-telco_automation-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.telcoautomation.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListOrchestrationClusters_sync", + "title": "Snippet for the list_orchestration_clusters call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_orchestration_clusters.", + "file": "telco_automation/list_orchestration_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_orchestration_clusters", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_orchestration_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListOrchestrationClusters", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListOrchestrationClusters", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetOrchestrationCluster_sync", + "title": "Snippet for the get_orchestration_cluster call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_orchestration_cluster.", + "file": "telco_automation/get_orchestration_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_orchestration_cluster", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_orchestration_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "GetOrchestrationCluster", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetOrchestrationCluster", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateOrchestrationCluster_sync", + "title": "Snippet for the create_orchestration_cluster call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_orchestration_cluster.", + "file": "telco_automation/create_orchestration_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_orchestration_cluster", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_orchestration_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "CreateOrchestrationCluster", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateOrchestrationCluster", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DeleteOrchestrationCluster_sync", + "title": "Snippet for the delete_orchestration_cluster call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_orchestration_cluster.", + "file": "telco_automation/delete_orchestration_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_orchestration_cluster", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_orchestration_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "DeleteOrchestrationCluster", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DeleteOrchestrationCluster", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListEdgeSlms_sync", + "title": "Snippet for the list_edge_slms call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_edge_slms.", + "file": "telco_automation/list_edge_slms.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_edge_slms", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_edge_slms", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListEdgeSlms", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListEdgeSlms", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetEdgeSlm_sync", + "title": "Snippet for the get_edge_slm call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_edge_slm.", + "file": "telco_automation/get_edge_slm.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_edge_slm", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_edge_slm", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::EdgeSlm", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "GetEdgeSlm", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetEdgeSlm", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateEdgeSlm_sync", + "title": "Snippet for the create_edge_slm call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_edge_slm.", + "file": "telco_automation/create_edge_slm.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_edge_slm", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_edge_slm", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "CreateEdgeSlm", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateEdgeSlm", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DeleteEdgeSlm_sync", + "title": "Snippet for the delete_edge_slm call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_edge_slm.", + "file": "telco_automation/delete_edge_slm.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_edge_slm", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_edge_slm", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "DeleteEdgeSlm", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DeleteEdgeSlm", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateBlueprint_sync", + "title": "Snippet for the create_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_blueprint.", + "file": "telco_automation/create_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "CreateBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_UpdateBlueprint_sync", + "title": "Snippet for the update_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_blueprint.", + "file": "telco_automation/update_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "UpdateBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.UpdateBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetBlueprint_sync", + "title": "Snippet for the get_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_blueprint.", + "file": "telco_automation/get_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "GetBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DeleteBlueprint_sync", + "title": "Snippet for the delete_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_blueprint.", + "file": "telco_automation/delete_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "DeleteBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DeleteBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListBlueprints_sync", + "title": "Snippet for the list_blueprints call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprints.", + "file": "telco_automation/list_blueprints.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_blueprints", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprints", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListBlueprints", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListBlueprints", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ApproveBlueprint_sync", + "title": "Snippet for the approve_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#approve_blueprint.", + "file": "telco_automation/approve_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "approve_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#approve_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ApproveBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ApproveBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ProposeBlueprint_sync", + "title": "Snippet for the propose_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#propose_blueprint.", + "file": "telco_automation/propose_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "propose_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#propose_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ProposeBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ProposeBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_RejectBlueprint_sync", + "title": "Snippet for the reject_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#reject_blueprint.", + "file": "telco_automation/reject_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "reject_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#reject_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "RejectBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.RejectBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListBlueprintRevisions_sync", + "title": "Snippet for the list_blueprint_revisions call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprint_revisions.", + "file": "telco_automation/list_blueprint_revisions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_blueprint_revisions", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprint_revisions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListBlueprintRevisions", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListBlueprintRevisions", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_SearchBlueprintRevisions_sync", + "title": "Snippet for the search_blueprint_revisions call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_blueprint_revisions.", + "file": "telco_automation/search_blueprint_revisions.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_blueprint_revisions", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_blueprint_revisions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "SearchBlueprintRevisions", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.SearchBlueprintRevisions", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_SearchDeploymentRevisions_sync", + "title": "Snippet for the search_deployment_revisions call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_deployment_revisions.", + "file": "telco_automation/search_deployment_revisions.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_deployment_revisions", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_deployment_revisions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "SearchDeploymentRevisions", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.SearchDeploymentRevisions", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DiscardBlueprintChanges_sync", + "title": "Snippet for the discard_blueprint_changes call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_blueprint_changes.", + "file": "telco_automation/discard_blueprint_changes.rb", + "language": "RUBY", + "client_method": { + "short_name": "discard_blueprint_changes", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_blueprint_changes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "DiscardBlueprintChanges", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DiscardBlueprintChanges", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListPublicBlueprints_sync", + "title": "Snippet for the list_public_blueprints call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_public_blueprints.", + "file": "telco_automation/list_public_blueprints.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_public_blueprints", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_public_blueprints", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListPublicBlueprints", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListPublicBlueprints", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetPublicBlueprint_sync", + "title": "Snippet for the get_public_blueprint call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_public_blueprint.", + "file": "telco_automation/get_public_blueprint.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_public_blueprint", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_public_blueprint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::PublicBlueprint", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "GetPublicBlueprint", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetPublicBlueprint", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateDeployment_sync", + "title": "Snippet for the create_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_deployment.", + "file": "telco_automation/create_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "CreateDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_UpdateDeployment_sync", + "title": "Snippet for the update_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_deployment.", + "file": "telco_automation/update_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "UpdateDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.UpdateDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetDeployment_sync", + "title": "Snippet for the get_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_deployment.", + "file": "telco_automation/get_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "GetDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_RemoveDeployment_sync", + "title": "Snippet for the remove_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#remove_deployment.", + "file": "telco_automation/remove_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#remove_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "RemoveDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.RemoveDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListDeployments_sync", + "title": "Snippet for the list_deployments call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployments.", + "file": "telco_automation/list_deployments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_deployments", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListDeployments", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListDeployments", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListDeploymentRevisions_sync", + "title": "Snippet for the list_deployment_revisions call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployment_revisions.", + "file": "telco_automation/list_deployment_revisions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_deployment_revisions", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployment_revisions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListDeploymentRevisions", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListDeploymentRevisions", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DiscardDeploymentChanges_sync", + "title": "Snippet for the discard_deployment_changes call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_deployment_changes.", + "file": "telco_automation/discard_deployment_changes.rb", + "language": "RUBY", + "client_method": { + "short_name": "discard_deployment_changes", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_deployment_changes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "DiscardDeploymentChanges", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DiscardDeploymentChanges", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ApplyDeployment_sync", + "title": "Snippet for the apply_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_deployment.", + "file": "telco_automation/apply_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "apply_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ApplyDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ApplyDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ComputeDeploymentStatus_sync", + "title": "Snippet for the compute_deployment_status call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#compute_deployment_status.", + "file": "telco_automation/compute_deployment_status.rb", + "language": "RUBY", + "client_method": { + "short_name": "compute_deployment_status", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#compute_deployment_status", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ComputeDeploymentStatus", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ComputeDeploymentStatus", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_RollbackDeployment_sync", + "title": "Snippet for the rollback_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#rollback_deployment.", + "file": "telco_automation/rollback_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "rollback_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#rollback_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "RollbackDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.RollbackDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetHydratedDeployment_sync", + "title": "Snippet for the get_hydrated_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_hydrated_deployment.", + "file": "telco_automation/get_hydrated_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_hydrated_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_hydrated_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::HydratedDeployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "GetHydratedDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetHydratedDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListHydratedDeployments_sync", + "title": "Snippet for the list_hydrated_deployments call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_hydrated_deployments.", + "file": "telco_automation/list_hydrated_deployments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_hydrated_deployments", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_hydrated_deployments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ListHydratedDeployments", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListHydratedDeployments", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_UpdateHydratedDeployment_sync", + "title": "Snippet for the update_hydrated_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_hydrated_deployment.", + "file": "telco_automation/update_hydrated_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_hydrated_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_hydrated_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::HydratedDeployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "UpdateHydratedDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.UpdateHydratedDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ApplyHydratedDeployment_sync", + "title": "Snippet for the apply_hydrated_deployment call in the TelcoAutomation service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_hydrated_deployment.", + "file": "telco_automation/apply_hydrated_deployment.rb", + "language": "RUBY", + "client_method": { + "short_name": "apply_hydrated_deployment", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_hydrated_deployment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TelcoAutomation::V1::HydratedDeployment", + "client": { + "short_name": "TelcoAutomation::Client", + "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" + }, + "method": { + "short_name": "ApplyHydratedDeployment", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ApplyHydratedDeployment", + "service": { + "short_name": "TelcoAutomation", + "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" + } + } + }, + "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-telco_automation-v1/snippets/telco_automation/apply_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb new file mode 100644 index 000000000000..6ef9fad80a28 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ApplyDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the apply_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#apply_deployment. +# +def apply_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new + + # Call the apply_deployment method. + result = client.apply_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_ApplyDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb new file mode 100644 index 000000000000..2b072dc5c67e --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ApplyHydratedDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the apply_hydrated_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#apply_hydrated_deployment. +# +def apply_hydrated_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new + + # Call the apply_hydrated_deployment method. + result = client.apply_hydrated_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_ApplyHydratedDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb new file mode 100644 index 000000000000..f575adec66b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ApproveBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the approve_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#approve_blueprint. +# +def approve_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new + + # Call the approve_blueprint method. + result = client.approve_blueprint request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_ApproveBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb new file mode 100644 index 000000000000..649e4df861e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ComputeDeploymentStatus_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the compute_deployment_status call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#compute_deployment_status. +# +def compute_deployment_status + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new + + # Call the compute_deployment_status method. + result = client.compute_deployment_status request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_ComputeDeploymentStatus_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb new file mode 100644 index 000000000000..fb48fce111ce --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the create_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_blueprint. +# +def create_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new + + # Call the create_blueprint method. + result = client.create_blueprint request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_CreateBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb new file mode 100644 index 000000000000..50957be164fc --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the create_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_deployment. +# +def create_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new + + # Call the create_deployment method. + result = client.create_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_CreateDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb new file mode 100644 index 000000000000..09483c7f6561 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateEdgeSlm_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the create_edge_slm call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_edge_slm. +# +def create_edge_slm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new + + # Call the create_edge_slm method. + result = client.create_edge_slm 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 telcoautomation_v1_generated_TelcoAutomation_CreateEdgeSlm_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb new file mode 100644 index 000000000000..9e819520ccbe --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateOrchestrationCluster_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the create_orchestration_cluster call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_orchestration_cluster. +# +def create_orchestration_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new + + # Call the create_orchestration_cluster method. + result = client.create_orchestration_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 telcoautomation_v1_generated_TelcoAutomation_CreateOrchestrationCluster_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb new file mode 100644 index 000000000000..7d2053f3fbe9 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DeleteBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the delete_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#delete_blueprint. +# +def delete_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new + + # Call the delete_blueprint method. + result = client.delete_blueprint request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_DeleteBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb new file mode 100644 index 000000000000..3c881a5faac3 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DeleteEdgeSlm_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the delete_edge_slm call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#delete_edge_slm. +# +def delete_edge_slm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.new + + # Call the delete_edge_slm method. + result = client.delete_edge_slm 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 telcoautomation_v1_generated_TelcoAutomation_DeleteEdgeSlm_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb new file mode 100644 index 000000000000..ec4c90ef42c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DeleteOrchestrationCluster_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the delete_orchestration_cluster call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#delete_orchestration_cluster. +# +def delete_orchestration_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.new + + # Call the delete_orchestration_cluster method. + result = client.delete_orchestration_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 telcoautomation_v1_generated_TelcoAutomation_DeleteOrchestrationCluster_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb new file mode 100644 index 000000000000..7a6b315bbc97 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DiscardBlueprintChanges_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the discard_blueprint_changes call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#discard_blueprint_changes. +# +def discard_blueprint_changes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new + + # Call the discard_blueprint_changes method. + result = client.discard_blueprint_changes request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_DiscardBlueprintChanges_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb new file mode 100644 index 000000000000..4c200c82912b --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DiscardDeploymentChanges_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the discard_deployment_changes call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#discard_deployment_changes. +# +def discard_deployment_changes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new + + # Call the discard_deployment_changes method. + result = client.discard_deployment_changes request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_DiscardDeploymentChanges_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb new file mode 100644 index 000000000000..f6389e7206c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the get_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_blueprint. +# +def get_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new + + # Call the get_blueprint method. + result = client.get_blueprint request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_GetBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb new file mode 100644 index 000000000000..d7affc180770 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the get_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_deployment. +# +def get_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new + + # Call the get_deployment method. + result = client.get_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_GetDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb new file mode 100644 index 000000000000..028ca2b921b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetEdgeSlm_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the get_edge_slm call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_edge_slm. +# +def get_edge_slm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new + + # Call the get_edge_slm method. + result = client.get_edge_slm request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::EdgeSlm. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_GetEdgeSlm_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb new file mode 100644 index 000000000000..e0fd8ecf6de2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetHydratedDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the get_hydrated_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_hydrated_deployment. +# +def get_hydrated_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new + + # Call the get_hydrated_deployment method. + result = client.get_hydrated_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_GetHydratedDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb new file mode 100644 index 000000000000..868d0765f0e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetOrchestrationCluster_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the get_orchestration_cluster call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_orchestration_cluster. +# +def get_orchestration_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new + + # Call the get_orchestration_cluster method. + result = client.get_orchestration_cluster request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::OrchestrationCluster. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_GetOrchestrationCluster_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb new file mode 100644 index 000000000000..042660f4b4e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetPublicBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the get_public_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_public_blueprint. +# +def get_public_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new + + # Call the get_public_blueprint method. + result = client.get_public_blueprint request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::PublicBlueprint. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_GetPublicBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb new file mode 100644 index 000000000000..6d392a9c3b56 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListBlueprintRevisions_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_blueprint_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprint_revisions. +# +def list_blueprint_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new + + # Call the list_blueprint_revisions method. + result = client.list_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListBlueprintRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb new file mode 100644 index 000000000000..3c3110dd1491 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListBlueprints_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_blueprints call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprints. +# +def list_blueprints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new + + # Call the list_blueprints method. + result = client.list_blueprints 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::TelcoAutomation::V1::Blueprint. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListBlueprints_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb new file mode 100644 index 000000000000..8135cf5b7fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListDeploymentRevisions_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_deployment_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_deployment_revisions. +# +def list_deployment_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new + + # Call the list_deployment_revisions method. + result = client.list_deployment_revisions 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::TelcoAutomation::V1::Deployment. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListDeploymentRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb new file mode 100644 index 000000000000..4c263b609502 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListDeployments_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_deployments call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_deployments. +# +def list_deployments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new + + # Call the list_deployments method. + result = client.list_deployments 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::TelcoAutomation::V1::Deployment. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListDeployments_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb new file mode 100644 index 000000000000..764597f3e805 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListEdgeSlms_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_edge_slms call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_edge_slms. +# +def list_edge_slms + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.new + + # Call the list_edge_slms method. + result = client.list_edge_slms 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::TelcoAutomation::V1::EdgeSlm. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListEdgeSlms_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb new file mode 100644 index 000000000000..5ef1508c264d --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListHydratedDeployments_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_hydrated_deployments call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_hydrated_deployments. +# +def list_hydrated_deployments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.new + + # Call the list_hydrated_deployments method. + result = client.list_hydrated_deployments 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::TelcoAutomation::V1::HydratedDeployment. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListHydratedDeployments_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb new file mode 100644 index 000000000000..8843a3d25975 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListOrchestrationClusters_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_orchestration_clusters call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_orchestration_clusters. +# +def list_orchestration_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new + + # Call the list_orchestration_clusters method. + result = client.list_orchestration_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::TelcoAutomation::V1::OrchestrationCluster. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListOrchestrationClusters_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb new file mode 100644 index 000000000000..e1b5503b4efd --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListPublicBlueprints_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the list_public_blueprints call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_public_blueprints. +# +def list_public_blueprints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.new + + # Call the list_public_blueprints method. + result = client.list_public_blueprints 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::TelcoAutomation::V1::PublicBlueprint. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_ListPublicBlueprints_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb new file mode 100644 index 000000000000..b7ec509c5f02 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ProposeBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the propose_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#propose_blueprint. +# +def propose_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new + + # Call the propose_blueprint method. + result = client.propose_blueprint request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_ProposeBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb new file mode 100644 index 000000000000..75a4ea6ea8af --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_RejectBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the reject_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#reject_blueprint. +# +def reject_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new + + # Call the reject_blueprint method. + result = client.reject_blueprint request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_RejectBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb new file mode 100644 index 000000000000..bb2d2295d142 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_RemoveDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the remove_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#remove_deployment. +# +def remove_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new + + # Call the remove_deployment method. + result = client.remove_deployment request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_RemoveDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb new file mode 100644 index 000000000000..b8ca6cdd4e1e --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_RollbackDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the rollback_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#rollback_deployment. +# +def rollback_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new + + # Call the rollback_deployment method. + result = client.rollback_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_RollbackDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb new file mode 100644 index 000000000000..decfa6d9bc27 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_SearchBlueprintRevisions_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the search_blueprint_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#search_blueprint_revisions. +# +def search_blueprint_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new + + # Call the search_blueprint_revisions method. + result = client.search_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_SearchBlueprintRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb new file mode 100644 index 000000000000..a17c4de2a015 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_SearchDeploymentRevisions_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the search_deployment_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#search_deployment_revisions. +# +def search_deployment_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new + + # Call the search_deployment_revisions method. + result = client.search_deployment_revisions 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::TelcoAutomation::V1::Deployment. + p item + end +end +# [END telcoautomation_v1_generated_TelcoAutomation_SearchDeploymentRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb new file mode 100644 index 000000000000..1281abedf47a --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_UpdateBlueprint_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the update_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#update_blueprint. +# +def update_blueprint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new + + # Call the update_blueprint method. + result = client.update_blueprint request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_UpdateBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb new file mode 100644 index 000000000000..3baab957f9bb --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_UpdateDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the update_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#update_deployment. +# +def update_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new + + # Call the update_deployment method. + result = client.update_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_UpdateDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb new file mode 100644 index 000000000000..b99b772b91c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_UpdateHydratedDeployment_sync] +require "google/cloud/telco_automation/v1" + +## +# Snippet for the update_hydrated_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#update_hydrated_deployment. +# +def update_hydrated_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new + + # Call the update_hydrated_deployment method. + result = client.update_hydrated_deployment request + + # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. + p result +end +# [END telcoautomation_v1_generated_TelcoAutomation_UpdateHydratedDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb new file mode 100644 index 000000000000..eedbcf1982df --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" +require "google/cloud/telcoautomation/v1/telcoautomation_services_pb" +require "google/cloud/telco_automation/v1/telco_automation" + +class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb new file mode 100644 index 000000000000..e833fcbea5eb --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/telco_automation" + +class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_blueprint_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.blueprint_path project: "value0", location: "value1", orchestration_cluster: "value2", blueprint: "value3" + assert_equal "projects/value0/locations/value1/orchestrationClusters/value2/blueprints/value3", path + end + end + + def test_deployment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.deployment_path project: "value0", location: "value1", orchestration_cluster: "value2", deployment: "value3" + assert_equal "projects/value0/locations/value1/orchestrationClusters/value2/deployments/value3", path + end + end + + def test_edge_slm_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.edge_slm_path project: "value0", location: "value1", edge_slm: "value2" + assert_equal "projects/value0/locations/value1/edgeSlms/value2", path + end + end + + def test_hydrated_deployment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.hydrated_deployment_path project: "value0", location: "value1", orchestration_cluster: "value2", deployment: "value3", hydrated_deployment: "value4" + assert_equal "projects/value0/locations/value1/orchestrationClusters/value2/deployments/value3/hydratedDeployments/value4", 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::TelcoAutomation::V1::TelcoAutomation::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_orchestration_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::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.orchestration_cluster_path project: "value0", location: "value1", orchestration_cluster: "value2" + assert_equal "projects/value0/locations/value1/orchestrationClusters/value2", path + end + end + + def test_public_blueprint_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.public_blueprint_path project: "value0", location: "value1", public_lueprint: "value2" + assert_equal "projects/value0/locations/value1/publicBlueprints/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb new file mode 100644 index 000000000000..dfa385ab3434 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb @@ -0,0 +1,2089 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" +require "google/cloud/telco_automation/v1/telco_automation/rest" + + +class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_orchestration_clusters + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.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_orchestration_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_orchestration_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_orchestration_clusters_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_orchestration_clusters({ 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_orchestration_clusters 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_orchestration_clusters ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters({ 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_orchestration_clusters(::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters_client_stub.call_count + end + end + end + + def test_get_orchestration_cluster + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_orchestration_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_orchestration_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_orchestration_cluster_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_orchestration_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_orchestration_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_orchestration_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_orchestration_cluster_client_stub.call_count + end + end + end + + def test_create_orchestration_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. + parent = "hello world" + orchestration_cluster_id = "hello world" + orchestration_cluster = {} + request_id = "hello world" + + create_orchestration_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_orchestration_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_orchestration_cluster_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_orchestration_cluster parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_orchestration_cluster_client_stub.call_count + end + end + end + + def test_delete_orchestration_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. + name = "hello world" + request_id = "hello world" + + delete_orchestration_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_delete_orchestration_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_orchestration_cluster_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_orchestration_cluster({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_orchestration_cluster name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster({ 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster_client_stub.call_count + end + end + end + + def test_list_edge_slms + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.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_edge_slms_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_edge_slms_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_edge_slms_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_edge_slms({ 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_edge_slms 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_edge_slms ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms({ 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_edge_slms(::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms_client_stub.call_count + end + end + end + + def test_get_edge_slm + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_edge_slm_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_edge_slm_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_edge_slm_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_edge_slm({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_edge_slm name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_edge_slm ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_edge_slm({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_edge_slm(::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_edge_slm_client_stub.call_count + end + end + end + + def test_create_edge_slm + # 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" + edge_slm_id = "hello world" + edge_slm = {} + request_id = "hello world" + + create_edge_slm_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_edge_slm_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_edge_slm_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_edge_slm parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_edge_slm ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_edge_slm(::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_edge_slm_client_stub.call_count + end + end + end + + def test_delete_edge_slm + # 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_edge_slm_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_delete_edge_slm_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_edge_slm_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_edge_slm({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_edge_slm name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_edge_slm ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm({ 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm_client_stub.call_count + end + end + end + + def test_create_blueprint + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + blueprint_id = "hello world" + blueprint = {} + + create_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_blueprint parent: parent, blueprint_id: blueprint_id, blueprint: blueprint do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_blueprint ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_blueprint(::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_blueprint_client_stub.call_count + end + end + end + + def test_update_blueprint + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + blueprint = {} + update_mask = {} + + update_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_update_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_blueprint({ blueprint: blueprint, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_blueprint blueprint: blueprint, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_blueprint ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_blueprint({ blueprint: blueprint, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_blueprint(::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_blueprint_client_stub.call_count + end + end + end + + def test_get_blueprint + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :BLUEPRINT_VIEW_UNSPECIFIED + + get_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_blueprint({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_blueprint name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_blueprint ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_blueprint({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_blueprint(::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_blueprint_client_stub.call_count + end + end + end + + def test_delete_blueprint + # 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_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_delete_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_blueprint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_blueprint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_blueprint ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_blueprint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_blueprint(::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_blueprint_client_stub.call_count + end + end + end + + def test_list_blueprints + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_blueprints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_blueprints_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_blueprints_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_blueprints({ parent: parent, 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_blueprints parent: parent, 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_blueprints ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints({ parent: parent, 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_blueprints(::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints_client_stub.call_count + end + end + end + + def test_approve_blueprint + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + approve_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_approve_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, approve_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.approve_blueprint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.approve_blueprint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.approve_blueprint ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.approve_blueprint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.approve_blueprint(::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, approve_blueprint_client_stub.call_count + end + end + end + + def test_propose_blueprint + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + propose_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_propose_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, propose_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.propose_blueprint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.propose_blueprint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.propose_blueprint ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.propose_blueprint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.propose_blueprint(::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, propose_blueprint_client_stub.call_count + end + end + end + + def test_reject_blueprint + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + reject_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_reject_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reject_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reject_blueprint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reject_blueprint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reject_blueprint ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reject_blueprint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reject_blueprint(::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reject_blueprint_client_stub.call_count + end + end + end + + def test_list_blueprint_revisions + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + list_blueprint_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_blueprint_revisions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_blueprint_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_blueprint_revisions({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_blueprint_revisions name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions({ name: name, 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_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions_client_stub.call_count + end + end + end + + def test_search_blueprint_revisions + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_blueprint_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_search_blueprint_revisions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_blueprint_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_blueprint_revisions({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_blueprint_revisions parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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.search_blueprint_revisions({ parent: parent, query: query, 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.search_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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, search_blueprint_revisions_client_stub.call_count + end + end + end + + def test_search_deployment_revisions + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_deployment_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_search_deployment_revisions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_deployment_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_deployment_revisions({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_deployment_revisions parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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.search_deployment_revisions({ parent: parent, query: query, 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.search_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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, search_deployment_revisions_client_stub.call_count + end + end + end + + def test_discard_blueprint_changes + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + discard_blueprint_changes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_discard_blueprint_changes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, discard_blueprint_changes_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.discard_blueprint_changes({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.discard_blueprint_changes name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.discard_blueprint_changes ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.discard_blueprint_changes({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.discard_blueprint_changes(::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, discard_blueprint_changes_client_stub.call_count + end + end + end + + def test_list_public_blueprints + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.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_public_blueprints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_public_blueprints_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_public_blueprints_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_public_blueprints({ 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_public_blueprints 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_public_blueprints ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints({ 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_public_blueprints(::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints_client_stub.call_count + end + end + end + + def test_get_public_blueprint + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_public_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_public_blueprint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_public_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_public_blueprint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_public_blueprint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_public_blueprint ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_public_blueprint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_public_blueprint(::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_public_blueprint_client_stub.call_count + end + end + end + + def test_create_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + deployment_id = "hello world" + deployment = {} + + create_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_deployment parent: parent, deployment_id: deployment_id, deployment: deployment do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_deployment ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_deployment(::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_deployment_client_stub.call_count + end + end + end + + def test_update_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + deployment = {} + update_mask = {} + + update_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_update_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_deployment({ deployment: deployment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_deployment deployment: deployment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_deployment({ deployment: deployment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_deployment_client_stub.call_count + end + end + end + + def test_get_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :DEPLOYMENT_VIEW_UNSPECIFIED + + get_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_deployment({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_deployment name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_deployment ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_deployment({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_deployment(::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_deployment_client_stub.call_count + end + end + end + + def test_remove_deployment + # 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" + + remove_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_remove_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_deployment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_deployment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_deployment ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_deployment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_deployment(::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_deployment_client_stub.call_count + end + end + end + + def test_list_deployments + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_deployments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_deployments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_deployments_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_deployments({ parent: parent, 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_deployments parent: parent, 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_deployments ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments({ parent: parent, 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_deployments(::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments_client_stub.call_count + end + end + end + + def test_list_deployment_revisions + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + list_deployment_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_deployment_revisions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_deployment_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_deployment_revisions({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_deployment_revisions name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions({ name: name, 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_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions_client_stub.call_count + end + end + end + + def test_discard_deployment_changes + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + discard_deployment_changes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_discard_deployment_changes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, discard_deployment_changes_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.discard_deployment_changes({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.discard_deployment_changes name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.discard_deployment_changes ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.discard_deployment_changes({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.discard_deployment_changes(::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, discard_deployment_changes_client_stub.call_count + end + end + end + + def test_apply_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + apply_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_apply_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, apply_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.apply_deployment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.apply_deployment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.apply_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.apply_deployment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.apply_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, apply_deployment_client_stub.call_count + end + end + end + + def test_compute_deployment_status + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + compute_deployment_status_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_compute_deployment_status_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, compute_deployment_status_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.compute_deployment_status({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.compute_deployment_status name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.compute_deployment_status ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.compute_deployment_status({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.compute_deployment_status(::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, compute_deployment_status_client_stub.call_count + end + end + end + + def test_rollback_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + revision_id = "hello world" + + rollback_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_rollback_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rollback_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.rollback_deployment({ name: name, revision_id: revision_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.rollback_deployment name: name, revision_id: revision_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.rollback_deployment ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.rollback_deployment({ name: name, revision_id: revision_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.rollback_deployment(::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, rollback_deployment_client_stub.call_count + end + end + end + + def test_get_hydrated_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_hydrated_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_hydrated_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_hydrated_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_hydrated_deployment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_hydrated_deployment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_hydrated_deployment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_hydrated_deployment_client_stub.call_count + end + end + end + + def test_list_hydrated_deployments + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.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_hydrated_deployments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_hydrated_deployments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_hydrated_deployments_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_hydrated_deployments({ 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_hydrated_deployments 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_hydrated_deployments ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments({ 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_hydrated_deployments(::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments_client_stub.call_count + end + end + end + + def test_update_hydrated_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + hydrated_deployment = {} + update_mask = {} + + update_hydrated_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_update_hydrated_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_hydrated_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_hydrated_deployment({ hydrated_deployment: hydrated_deployment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_hydrated_deployment hydrated_deployment: hydrated_deployment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_hydrated_deployment({ hydrated_deployment: hydrated_deployment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_hydrated_deployment_client_stub.call_count + end + end + end + + def test_apply_hydrated_deployment + # Create test objects. + client_result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + apply_hydrated_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_apply_hydrated_deployment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, apply_hydrated_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.apply_hydrated_deployment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.apply_hydrated_deployment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.apply_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.apply_hydrated_deployment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.apply_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, apply_hydrated_deployment_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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb new file mode 100644 index 000000000000..c2be48e205f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb @@ -0,0 +1,2368 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" +require "google/cloud/telco_automation/v1/telco_automation" + +class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_orchestration_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.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_orchestration_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_orchestration_clusters, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, 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_orchestration_clusters_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_orchestration_clusters({ 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_orchestration_clusters 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_orchestration_clusters ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters({ 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_orchestration_clusters(::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters_client_stub.call_rpc_count + end + end + + def test_get_orchestration_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.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_orchestration_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_orchestration_cluster, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_orchestration_cluster_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_orchestration_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_orchestration_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_orchestration_cluster({ 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.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_orchestration_cluster_client_stub.call_rpc_count + end + end + + def test_create_orchestration_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. + parent = "hello world" + orchestration_cluster_id = "hello world" + orchestration_cluster = {} + request_id = "hello world" + + create_orchestration_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_orchestration_cluster, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["orchestration_cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster), request["orchestration_cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_orchestration_cluster_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster_client_stub.call_rpc_count + end + end + + def test_delete_orchestration_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. + name = "hello world" + request_id = "hello world" + + delete_orchestration_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_orchestration_cluster, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_orchestration_cluster_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_orchestration_cluster({ 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_orchestration_cluster 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_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster({ 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster_client_stub.call_rpc_count + end + end + + def test_list_edge_slms + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.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_edge_slms_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_edge_slms, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, 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_edge_slms_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_edge_slms({ 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_edge_slms 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_edge_slms ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms({ 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_edge_slms(::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms_client_stub.call_rpc_count + end + end + + def test_get_edge_slm + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.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_edge_slm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_edge_slm, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_edge_slm_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_edge_slm({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_edge_slm name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_edge_slm ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_edge_slm({ 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.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_edge_slm_client_stub.call_rpc_count + end + end + + def test_create_edge_slm + # 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" + edge_slm_id = "hello world" + edge_slm = {} + request_id = "hello world" + + create_edge_slm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_edge_slm, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["edge_slm_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::EdgeSlm), request["edge_slm"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_edge_slm_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm_client_stub.call_rpc_count + end + end + + def test_delete_edge_slm + # 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_edge_slm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_edge_slm, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_edge_slm_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_edge_slm({ 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_edge_slm 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_edge_slm ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm({ 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm_client_stub.call_rpc_count + end + end + + def test_create_blueprint + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" + blueprint_id = "hello world" + blueprint = {} + + create_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["blueprint_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Blueprint), request["blueprint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_blueprint parent: parent, blueprint_id: blueprint_id, blueprint: blueprint do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_blueprint ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_blueprint(::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_blueprint_client_stub.call_rpc_count + end + end + + def test_update_blueprint + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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. + blueprint = {} + update_mask = {} + + update_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Blueprint), request["blueprint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_blueprint({ blueprint: blueprint, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_blueprint blueprint: blueprint, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_blueprint ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, 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_blueprint({ blueprint: blueprint, 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_blueprint(::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, 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_blueprint_client_stub.call_rpc_count + end + end + + def test_get_blueprint + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" + view = :BLUEPRINT_VIEW_UNSPECIFIED + + get_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, request + assert_equal "hello world", request["name"] + assert_equal :BLUEPRINT_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_blueprint({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_blueprint name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_blueprint ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_blueprint({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_blueprint(::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_blueprint_client_stub.call_rpc_count + end + end + + def test_delete_blueprint + # 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_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_blueprint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_blueprint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_blueprint ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_blueprint({ 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_blueprint(::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.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_blueprint_client_stub.call_rpc_count + end + end + + def test_list_blueprints + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_blueprints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_blueprints, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, request + assert_equal "hello world", request["parent"] + 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_blueprints_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_blueprints({ parent: parent, 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_blueprints parent: parent, 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_blueprints ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints({ parent: parent, 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_blueprints(::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints_client_stub.call_rpc_count + end + end + + def test_approve_blueprint + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" + + approve_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :approve_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, approve_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.approve_blueprint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.approve_blueprint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.approve_blueprint ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.approve_blueprint({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.approve_blueprint(::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.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, approve_blueprint_client_stub.call_rpc_count + end + end + + def test_propose_blueprint + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" + + propose_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :propose_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, propose_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.propose_blueprint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.propose_blueprint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.propose_blueprint ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.propose_blueprint({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.propose_blueprint(::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.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, propose_blueprint_client_stub.call_rpc_count + end + end + + def test_reject_blueprint + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" + + reject_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reject_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reject_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reject_blueprint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reject_blueprint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reject_blueprint ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reject_blueprint({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reject_blueprint(::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.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, reject_blueprint_client_stub.call_rpc_count + end + end + + def test_list_blueprint_revisions + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.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" + page_size = 42 + page_token = "hello world" + + list_blueprint_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_blueprint_revisions, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_blueprint_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_blueprint_revisions({ name: name, 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_blueprint_revisions name: name, 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_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions({ name: name, 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_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions_client_stub.call_rpc_count + end + end + + def test_search_blueprint_revisions + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.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" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_blueprint_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_blueprint_revisions, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_blueprint_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_blueprint_revisions({ parent: parent, query: query, 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.search_blueprint_revisions parent: parent, query: query, 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.search_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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.search_blueprint_revisions({ parent: parent, query: query, 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.search_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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, search_blueprint_revisions_client_stub.call_rpc_count + end + end + + def test_search_deployment_revisions + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.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" + query = "hello world" + page_size = 42 + page_token = "hello world" + + search_deployment_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_deployment_revisions, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["query"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_deployment_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_deployment_revisions({ parent: parent, query: query, 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.search_deployment_revisions parent: parent, query: query, 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.search_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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.search_deployment_revisions({ parent: parent, query: query, 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.search_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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, search_deployment_revisions_client_stub.call_rpc_count + end + end + + def test_discard_blueprint_changes + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.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" + + discard_blueprint_changes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :discard_blueprint_changes, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, discard_blueprint_changes_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.discard_blueprint_changes({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.discard_blueprint_changes name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.discard_blueprint_changes ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.discard_blueprint_changes({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.discard_blueprint_changes(::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.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, discard_blueprint_changes_client_stub.call_rpc_count + end + end + + def test_list_public_blueprints + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.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_public_blueprints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_public_blueprints, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, 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_public_blueprints_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_public_blueprints({ 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_public_blueprints 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_public_blueprints ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints({ 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_public_blueprints(::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints_client_stub.call_rpc_count + end + end + + def test_get_public_blueprint + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.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_public_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_public_blueprint, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_public_blueprint_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_public_blueprint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_public_blueprint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_public_blueprint ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_public_blueprint({ 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_public_blueprint(::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.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_public_blueprint_client_stub.call_rpc_count + end + end + + def test_create_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" + deployment_id = "hello world" + deployment = {} + + create_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["deployment_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Deployment), request["deployment"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_deployment parent: parent, deployment_id: deployment_id, deployment: deployment do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_deployment ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_deployment(::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_deployment_client_stub.call_rpc_count + end + end + + def test_update_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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. + deployment = {} + update_mask = {} + + update_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Deployment), request["deployment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_deployment({ deployment: deployment, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_deployment deployment: deployment, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, 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_deployment({ deployment: deployment, 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_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, 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_deployment_client_stub.call_rpc_count + end + end + + def test_get_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" + view = :DEPLOYMENT_VIEW_UNSPECIFIED + + get_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, request + assert_equal "hello world", request["name"] + assert_equal :DEPLOYMENT_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_deployment({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_deployment name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_deployment ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_deployment({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_deployment(::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_deployment_client_stub.call_rpc_count + end + end + + def test_remove_deployment + # 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" + + remove_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_deployment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_deployment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_deployment ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_deployment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_deployment(::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.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, remove_deployment_client_stub.call_rpc_count + end + end + + def test_list_deployments + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_deployments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_deployments, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, request + assert_equal "hello world", request["parent"] + 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_deployments_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_deployments({ parent: parent, 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_deployments parent: parent, 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_deployments ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments({ parent: parent, 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_deployments(::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments_client_stub.call_rpc_count + end + end + + def test_list_deployment_revisions + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.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" + page_size = 42 + page_token = "hello world" + + list_deployment_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_deployment_revisions, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_deployment_revisions_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_deployment_revisions({ name: name, 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_deployment_revisions name: name, 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_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions({ name: name, 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_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions_client_stub.call_rpc_count + end + end + + def test_discard_deployment_changes + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.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" + + discard_deployment_changes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :discard_deployment_changes, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, discard_deployment_changes_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.discard_deployment_changes({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.discard_deployment_changes name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.discard_deployment_changes ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.discard_deployment_changes({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.discard_deployment_changes(::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.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, discard_deployment_changes_client_stub.call_rpc_count + end + end + + def test_apply_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" + + apply_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :apply_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, apply_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.apply_deployment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.apply_deployment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.apply_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.apply_deployment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.apply_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.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, apply_deployment_client_stub.call_rpc_count + end + end + + def test_compute_deployment_status + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.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" + + compute_deployment_status_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :compute_deployment_status, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, compute_deployment_status_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.compute_deployment_status({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.compute_deployment_status name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.compute_deployment_status ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.compute_deployment_status({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.compute_deployment_status(::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.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, compute_deployment_status_client_stub.call_rpc_count + end + end + + def test_rollback_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" + revision_id = "hello world" + + rollback_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rollback_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["revision_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rollback_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rollback_deployment({ name: name, revision_id: revision_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.rollback_deployment name: name, revision_id: revision_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.rollback_deployment ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.rollback_deployment({ name: name, revision_id: revision_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.rollback_deployment(::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rollback_deployment_client_stub.call_rpc_count + end + end + + def test_get_hydrated_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.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_hydrated_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_hydrated_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_hydrated_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_hydrated_deployment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_hydrated_deployment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_hydrated_deployment({ 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_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.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_hydrated_deployment_client_stub.call_rpc_count + end + end + + def test_list_hydrated_deployments + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.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_hydrated_deployments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_hydrated_deployments, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, 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_hydrated_deployments_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_hydrated_deployments({ 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_hydrated_deployments 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_hydrated_deployments ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments({ 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_hydrated_deployments(::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments_client_stub.call_rpc_count + end + end + + def test_update_hydrated_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.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. + hydrated_deployment = {} + update_mask = {} + + update_hydrated_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_hydrated_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment), request["hydrated_deployment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_hydrated_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_hydrated_deployment({ hydrated_deployment: hydrated_deployment, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_hydrated_deployment hydrated_deployment: hydrated_deployment, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, 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_hydrated_deployment({ hydrated_deployment: hydrated_deployment, 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_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, 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_hydrated_deployment_client_stub.call_rpc_count + end + end + + def test_apply_hydrated_deployment + # Create GRPC objects. + grpc_response = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.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" + + apply_hydrated_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :apply_hydrated_deployment, name + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, apply_hydrated_deployment_client_stub do + # Create client + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.apply_hydrated_deployment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.apply_hydrated_deployment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.apply_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.apply_hydrated_deployment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.apply_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.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, apply_hydrated_deployment_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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client, client + assert_equal creds, client.configure.credentials + end + 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::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-telco_automation/.gitignore b/owl-bot-staging/google-cloud-telco_automation/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/.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-telco_automation/.repo-metadata.json b/owl-bot-staging/google-cloud-telco_automation/.repo-metadata.json new file mode 100644 index 000000000000..3b5aab262150 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "telcoautomation.googleapis.com", + "api_shortname": "telcoautomation", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation/latest", + "distribution_name": "google-cloud-telco_automation", + "is_cloud": true, + "language": "ruby", + "name": "telcoautomation", + "name_pretty": "Telco Automation API", + "product_documentation": "https://cloud.google.com/telecom-network-automation", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "APIs to automate management of cloud infrastructure for network functions.", + "ruby-cloud-product-url": "https://cloud.google.com/telecom-network-automation", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-telco_automation/.rubocop.yml b/owl-bot-staging/google-cloud-telco_automation/.rubocop.yml new file mode 100644 index 000000000000..b24d346a0484 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-telco_automation.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-telco_automation.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-telco_automation/.toys.rb b/owl-bot-staging/google-cloud-telco_automation/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation/.yardopts b/owl-bot-staging/google-cloud-telco_automation/.yardopts new file mode 100644 index 000000000000..1d4c6723c005 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Telco Automation API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md b/owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md new file mode 100644 index 000000000000..43e156d42ee2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-telco_automation 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-telco_automation 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/telco_automation" + +client = Google::Cloud::TelcoAutomation.telco_automation do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/telco_automation" + +Google::Cloud::TelcoAutomation.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::TelcoAutomation.telco_automation +``` + +### 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-telco_automation +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/telco_automation" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::TelcoAutomation.telco_automation +``` + +### 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-telco_automation/CHANGELOG.md b/owl-bot-staging/google-cloud-telco_automation/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-telco_automation/Gemfile b/owl-bot-staging/google-cloud-telco_automation/Gemfile new file mode 100644 index 000000000000..6c1027919be5 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-telco_automation-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-telco_automation.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.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-telco_automation/LICENSE.md b/owl-bot-staging/google-cloud-telco_automation/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/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-telco_automation/README.md b/owl-bot-staging/google-cloud-telco_automation/README.md new file mode 100644 index 000000000000..0626b489ac95 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/README.md @@ -0,0 +1,141 @@ +# Ruby Client for the Telco Automation API + +APIs to automate management of cloud infrastructure for network functions. + + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-telco_automation-v*`. +The gem `google-cloud-telco_automation` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation/latest) +for this library, google-cloud-telco_automation, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-telco_automation-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/telecom-network-automation) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-telco_automation +``` + +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/telcoautomation.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/telco_automation" + +client = Google::Cloud::TelcoAutomation.telco_automation +request = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new # (request fields as keyword arguments...) +response = client.list_orchestration_clusters request +``` + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-telco_automation-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +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-telco_automation`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-telco_automation-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-telco_automation`. +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-telco_automation-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-telco_automation/Rakefile b/owl-bot-staging/google-cloud-telco_automation/Rakefile new file mode 100644 index 000000000000..cfe4d2f92b8f --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true +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-telco_automation acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/telco_automation/v1/telco_automation/credentials" + ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-telco_automation 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-telco_automation 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-telco_automation 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-telco_automation gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-telco_automation" + header "google-cloud-telco_automation rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-telco_automation yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-telco_automation 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-telco_automation 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-telco_automation 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-telco_automation/google-cloud-telco_automation.gemspec b/owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec new file mode 100644 index 000000000000..9bee511e0bd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/telco_automation/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-telco_automation" + gem.version = Google::Cloud::TelcoAutomation::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "APIs to automate management of cloud infrastructure for network functions." + gem.summary = "APIs to automate management of cloud infrastructure for network functions." + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-telco_automation-v1", "~> 2.0" +end diff --git a/owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb b/owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb new file mode 100644 index 000000000000..f8582c59f5b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation" unless defined? Google::Cloud::TelcoAutomation::VERSION diff --git a/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb b/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb new file mode 100644 index 000000000000..07f13a2d1fd8 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb @@ -0,0 +1,160 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/telco_automation/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :telco_automation do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module TelcoAutomation + ## + # Create a new client object for TelcoAutomation. + # + # By default, this returns an instance of + # [Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest/Google-Cloud-TelcoAutomation-V1-TelcoAutomation-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TelcoAutomation service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TelcoAutomation service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::TelcoAutomation.telco_automation_available?}. + # + # ## About TelcoAutomation + # + # TelcoAutomation Service manages the control plane cluster a.k.a. + # Orchestration Cluster (GKE cluster with config controller) of TNA. It also + # exposes blueprint APIs which manages the lifecycle of blueprints that control + # the infrastructure setup (e.g GDCE clusters) and deployment of network + # functions. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.telco_automation version: :v1, transport: :grpc, &block + require "google/cloud/telco_automation/#{version.to_s.downcase}" + + package_name = Google::Cloud::TelcoAutomation + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::TelcoAutomation.const_get(package_name).const_get(:TelcoAutomation) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TelcoAutomation service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::TelcoAutomation.telco_automation}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TelcoAutomation service, + # or if the versioned client gem needs an update to support the TelcoAutomation service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.telco_automation_available? version: :v1, transport: :grpc + require "google/cloud/telco_automation/#{version.to_s.downcase}" + package_name = Google::Cloud::TelcoAutomation + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::TelcoAutomation.const_get package_name + return false unless service_module.const_defined? :TelcoAutomation + service_module = service_module.const_get :TelcoAutomation + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-telco_automation library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.telco_automation if block_given? + + ::Google::Cloud.configure.telco_automation + end + end + end +end + +helper_path = ::File.join __dir__, "telco_automation", "helpers.rb" +require "google/cloud/telco_automation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb b/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb new file mode 100644 index 000000000000..8f35f65896fc --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb b/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb new file mode 100644 index 000000000000..391875dee3c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/telco_automation" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::TelcoAutomation::ClientConstructionMinitest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_telco_automation_grpc + skip unless Google::Cloud::TelcoAutomation.telco_automation_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::TelcoAutomation.telco_automation transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client, client + end + end + + def test_telco_automation_rest + skip unless Google::Cloud::TelcoAutomation.telco_automation_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::TelcoAutomation.telco_automation transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb b/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb new file mode 100644 index 000000000000..dd854783785b --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/telco_automation/version" + +class Google::Cloud::TelcoAutomation::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::TelcoAutomation::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-telco_automation/test/helper.rb b/owl-bot-staging/google-cloud-telco_automation/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-telco_automation/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/.gitignore b/owl-bot-staging/google-cloud-text_to_speech-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-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-text_to_speech-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1/.repo-metadata.json new file mode 100644 index 000000000000..0f1680fa6d2d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "texttospeech.googleapis.com", + "api_shortname": "texttospeech", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest", + "distribution_name": "google-cloud-text_to_speech-v1", + "is_cloud": true, + "language": "ruby", + "name": "texttospeech", + "name_pretty": "Cloud Text-to-Speech V1 API", + "product_documentation": "https://cloud.google.com/text-to-speech", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TEXTTOSPEECH", + "ruby-cloud-product-url": "https://cloud.google.com/text-to-speech", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml b/owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml new file mode 100644 index 000000000000..dc3e19ac0403 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-text_to_speech-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-text_to_speech-v1.rb" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/.yardopts b/owl-bot-staging/google-cloud-text_to_speech-v1/.yardopts new file mode 100644 index 000000000000..b23b0b3b07e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Text-to-Speech 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-text_to_speech-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-text_to_speech-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..9eb74f158a54 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-text_to_speech-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-text_to_speech-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/text_to_speech/v1" + +client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/text_to_speech/v1" + +::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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-text_to_speech-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/text_to_speech/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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-text_to_speech-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-text_to_speech-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-text_to_speech-v1/LICENSE.md b/owl-bot-staging/google-cloud-text_to_speech-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-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-text_to_speech-v1/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1/README.md new file mode 100644 index 000000000000..27409b96177e --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Text-to-Speech V1 API + +Synthesizes natural-sounding speech by applying powerful neural network models. + +Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. + +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 Text-to-Speech V1 API. Most users should consider using +the main client gem, +[google-cloud-text_to_speech](https://rubygems.org/gems/google-cloud-text_to_speech). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-text_to_speech-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/texttospeech.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/text_to_speech/v1" + +client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new +request = ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new # (request fields as keyword arguments...) +response = client.list_voices request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/text-to-speech) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/text_to_speech/v1" +require "logger" + +client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-text_to_speech`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-text_to_speech-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-text_to_speech`. +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-text_to_speech-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-text_to_speech-v1/Rakefile b/owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile new file mode 100644 index 000000000000..7db3ca6b5cb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TEXTTOSPEECH_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TEXTTOSPEECH_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TEXTTOSPEECH_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 TEXTTOSPEECH_TEST_PROJECT=test123 TEXTTOSPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/text_to_speech/v1/text_to_speech/credentials" + ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TEXTTOSPEECH_PROJECT"] = project + ENV["TEXTTOSPEECH_TEST_PROJECT"] = project + ENV["TEXTTOSPEECH_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-text_to_speech-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-text_to_speech-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-text_to_speech-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-text_to_speech-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-text_to_speech-v1" + header "google-cloud-text_to_speech-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-text_to_speech-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-text_to_speech-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-text_to_speech-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-text_to_speech-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-text_to_speech-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json new file mode 100644 index 000000000000..16049d7c8a36 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.texttospeech.v1", + "libraryPackage": "::Google::Cloud::TextToSpeech::V1", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client", + "rpcs": { + "ListVoices": { + "methods": [ + "list_voices" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesize_speech" + ] + }, + "StreamingSynthesize": { + "methods": [ + "streaming_synthesize" + ] + } + } + } + } + }, + "TextToSpeechLongAudioSynthesize": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client", + "rpcs": { + "SynthesizeLongAudio": { + "methods": [ + "synthesize_long_audio" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec b/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec new file mode 100644 index 000000000000..a031828cd206 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/text_to_speech/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-text_to_speech-v1" + gem.version = Google::Cloud::TextToSpeech::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details." + gem.summary = "Synthesizes natural-sounding speech by applying powerful neural network models." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb new file mode 100644 index 000000000000..796720aff7fd --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb new file mode 100644 index 000000000000..4d6d2e5dfd49 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" +require "google/cloud/text_to_speech/v1/version" + +module Google + module Cloud + module TextToSpeech + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/text_to_speech/v1" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/text_to_speech/v1" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/text_to_speech/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb new file mode 100644 index 000000000000..410254eba135 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech/rest" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" +require "google/cloud/text_to_speech/v1/version" + +module Google + module Cloud + module TextToSpeech + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/text_to_speech/v1/rest" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb new file mode 100644 index 000000000000..ec1fb13e094d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" + +require "google/cloud/text_to_speech/v1/text_to_speech/credentials" +require "google/cloud/text_to_speech/v1/text_to_speech/paths" +require "google/cloud/text_to_speech/v1/text_to_speech/client" +require "google/cloud/text_to_speech/v1/text_to_speech/rest" + +module Google + module Cloud + module TextToSpeech + module V1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/text_to_speech/v1/text_to_speech" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/text_to_speech/v1/text_to_speech/rest" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new + # + module TextToSpeech + end + end + end + end +end + +helper_path = ::File.join __dir__, "text_to_speech", "helpers.rb" +require "google/cloud/text_to_speech/v1/text_to_speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb new file mode 100644 index 000000000000..f538e52e5dfe --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb @@ -0,0 +1,655 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeech + ## + # Client for the TextToSpeech service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_stub + + ## + # Configure the TextToSpeech Client class. + # + # See {::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeech clients + # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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", "TextToSpeech", "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.timeout = 300.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::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 + @text_to_speech_stub.universe_domain + end + + ## + # Create a new TextToSpeech client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeech 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/texttospeech/v1/cloud_tts_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 + + @text_to_speech_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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, + logger: @config.logger + ) + + @text_to_speech_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_stub.logger + end + + # Service calls + + ## + # Returns a list of Voice supported for synthesis. + # + # @overload list_voices(request, options = nil) + # Pass arguments to `list_voices` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1::ListVoicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_voices(language_code: nil) + # Pass arguments to `list_voices` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param language_code [::String] + # Optional. Recommended. + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # If not specified, the API will return all supported voices. + # If specified, the ListVoices call will only return voices that can be used + # to synthesize this language_code. For example, if you specify `"en-NZ"`, + # all `"en-NZ"` voices will be returned. If you specify `"no"`, both + # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + # returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new + # + # # Call the list_voices method. + # result = client.list_voices request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. + # p result + # + def list_voices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest + + # Converts hash 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_voices.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::TextToSpeech::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.list_voices.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_voices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.call_rpc :list_voices, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Synthesizes speech synchronously: receive results after all text input + # has been processed. + # + # @overload synthesize_speech(request, options = nil) + # Pass arguments to `synthesize_speech` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, advanced_voice_options: nil) + # Pass arguments to `synthesize_speech` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions, ::Hash] + # Advanced voice options. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new + # + # # Call the synthesize_speech method. + # result = client.synthesize_speech request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. + # p result + # + def synthesize_speech request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest + + # Converts hash 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.synthesize_speech.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::TextToSpeech::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.synthesize_speech.timeout, + metadata: metadata, + retry_policy: @config.rpcs.synthesize_speech.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.call_rpc :synthesize_speech, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs bidirectional streaming speech synthesis: receives audio while + # sending text. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest, ::Hash>] + # An enumerable of {::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_synthesize method to start streaming. + # output = client.streaming_synthesize input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new + # input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_synthesize request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest + end + + # Converts hash 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.streaming_synthesize.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::TextToSpeech::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.streaming_synthesize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_synthesize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.call_rpc :streaming_synthesize, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeech API. + # + # This class represents the configuration for TextToSpeech, + # 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::TextToSpeech::V1::TextToSpeech::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_voices to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeech 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_voices` + # @return [::Gapic::Config::Method] + # + attr_reader :list_voices + ## + # RPC-specific configuration for `synthesize_speech` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_speech + ## + # RPC-specific configuration for `streaming_synthesize` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_synthesize + + # @private + def initialize parent_rpcs = nil + list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices + @list_voices = ::Gapic::Config::Method.new list_voices_config + synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech + @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config + streaming_synthesize_config = parent_rpcs.streaming_synthesize if parent_rpcs.respond_to? :streaming_synthesize + @streaming_synthesize = ::Gapic::Config::Method.new streaming_synthesize_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb new file mode 100644 index 000000000000..ae03a5f2f50e --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + module TextToSpeech + # Credentials for the TextToSpeech API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "TEXTTOSPEECH_CREDENTIALS", + "TEXTTOSPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TEXTTOSPEECH_CREDENTIALS_JSON", + "TEXTTOSPEECH_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-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb new file mode 100644 index 000000000000..742f694939cc --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + module TextToSpeech + # Path helper methods for the TextToSpeech API. + module Paths + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb new file mode 100644 index 000000000000..c624653e2965 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" + +require "google/cloud/text_to_speech/v1/text_to_speech/credentials" +require "google/cloud/text_to_speech/v1/text_to_speech/paths" +require "google/cloud/text_to_speech/v1/text_to_speech/rest/client" + +module Google + module Cloud + module TextToSpeech + module V1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/text_to_speech/v1/text_to_speech/rest" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new + # + module TextToSpeech + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/text_to_speech/v1/text_to_speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb new file mode 100644 index 000000000000..862337249dae --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb @@ -0,0 +1,528 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" +require "google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub" + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeech + module Rest + ## + # REST client for the TextToSpeech service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_stub + + ## + # Configure the TextToSpeech Client class. + # + # See {::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeech clients + # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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", "TextToSpeech", "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.timeout = 300.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::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 + @text_to_speech_stub.universe_domain + end + + ## + # Create a new TextToSpeech REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeech 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 + + @text_to_speech_stub = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @text_to_speech_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_stub.logger + end + + # Service calls + + ## + # Returns a list of Voice supported for synthesis. + # + # @overload list_voices(request, options = nil) + # Pass arguments to `list_voices` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1::ListVoicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_voices(language_code: nil) + # Pass arguments to `list_voices` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param language_code [::String] + # Optional. Recommended. + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # If not specified, the API will return all supported voices. + # If specified, the ListVoices call will only return voices that can be used + # to synthesize this language_code. For example, if you specify `"en-NZ"`, + # all `"en-NZ"` voices will be returned. If you specify `"no"`, both + # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + # returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new + # + # # Call the list_voices method. + # result = client.list_voices request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. + # p result + # + def list_voices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest + + # Converts hash 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_voices.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::TextToSpeech::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_voices.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_voices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.list_voices request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Synthesizes speech synchronously: receive results after all text input + # has been processed. + # + # @overload synthesize_speech(request, options = nil) + # Pass arguments to `synthesize_speech` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, advanced_voice_options: nil) + # Pass arguments to `synthesize_speech` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions, ::Hash] + # Advanced voice options. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new + # + # # Call the synthesize_speech method. + # result = client.synthesize_speech request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. + # p result + # + def synthesize_speech request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest + + # Converts hash 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.synthesize_speech.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::TextToSpeech::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.synthesize_speech.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.synthesize_speech.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.synthesize_speech request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeech REST API. + # + # This class represents the configuration for TextToSpeech 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::TextToSpeech::V1::TextToSpeech::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_voices to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeech 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_voices` + # @return [::Gapic::Config::Method] + # + attr_reader :list_voices + ## + # RPC-specific configuration for `synthesize_speech` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_speech + + # @private + def initialize parent_rpcs = nil + list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices + @list_voices = ::Gapic::Config::Method.new list_voices_config + synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech + @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb new file mode 100644 index 000000000000..2b4b9cdd5d6d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb @@ -0,0 +1,200 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeech + module Rest + ## + # REST service stub for the TextToSpeech service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_voices REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest] + # 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::TextToSpeech::V1::ListVoicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] + # A result object deserialized from the server's reply + def list_voices request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_voices_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, + method_name: "list_voices", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the synthesize_speech REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest] + # 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::TextToSpeech::V1::SynthesizeSpeechResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] + # A result object deserialized from the server's reply + def synthesize_speech request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_speech_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, + method_name: "synthesize_speech", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_voices REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest] + # 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_voices_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/voices", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the synthesize_speech REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_synthesize_speech_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/text:synthesize", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb new file mode 100644 index 000000000000..5ac749d808a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" + +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" + +module Google + module Cloud + module TextToSpeech + module V1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + module TextToSpeechLongAudioSynthesize + end + end + end + end +end + +helper_path = ::File.join __dir__, "text_to_speech_long_audio_synthesize", "helpers.rb" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb new file mode 100644 index 000000000000..c0e39e1b0936 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb @@ -0,0 +1,510 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + ## + # Client for the TextToSpeechLongAudioSynthesize service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_long_audio_synthesize_stub + + ## + # Configure the TextToSpeechLongAudioSynthesize Client class. + # + # See {::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients + # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "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.synthesize_long_audio.timeout = 5000.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 + @text_to_speech_long_audio_synthesize_stub.universe_domain + end + + ## + # Create a new TextToSpeechLongAudioSynthesize client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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/texttospeech/v1/cloud_tts_lrs_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 + + @text_to_speech_long_audio_synthesize_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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, + logger: @config.logger + ) + + @text_to_speech_long_audio_synthesize_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_long_audio_synthesize_stub.logger + end + + # Service calls + + ## + # Synthesizes long form text asynchronously. + # + # @overload synthesize_long_audio(request, options = nil) + # Pass arguments to `synthesize_long_audio` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) + # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at + # least one keyword argument is 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] + # The resource states of the request in the form of + # `projects/*/locations/*`. + # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param output_gcs_uri [::String] + # Required. Specifies a Cloud Storage URI for the synthesis results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # + # @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/text_to_speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new + # + # # Call the synthesize_long_audio method. + # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest + + # Converts hash 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.synthesize_long_audio.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::TextToSpeech::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.synthesize_long_audio.timeout, + metadata: metadata, + retry_policy: @config.rpcs.synthesize_long_audio.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_long_audio_synthesize_stub.call_rpc :synthesize_long_audio, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeechLongAudioSynthesize API. + # + # This class represents the configuration for TextToSpeechLongAudioSynthesize, + # 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 + # # synthesize_long_audio to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_long_audio + + # @private + def initialize parent_rpcs = nil + synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio + @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb new file mode 100644 index 000000000000..df1224d64357 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + # Credentials for the TextToSpeechLongAudioSynthesize API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "TEXTTOSPEECH_CREDENTIALS", + "TEXTTOSPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TEXTTOSPEECH_CREDENTIALS_JSON", + "TEXTTOSPEECH_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-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb new file mode 100644 index 000000000000..fadf9ad19fb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::TextToSpeech::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? + throw :response, 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::TextToSpeech::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? + throw :response, 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::TextToSpeech::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? + 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::TextToSpeech::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? + 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::TextToSpeech::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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb new file mode 100644 index 000000000000..3632788fa392 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + # Path helper methods for the TextToSpeechLongAudioSynthesize API. + module Paths + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb new file mode 100644 index 000000000000..eb8a249fb23a --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" + +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client" + +module Google + module Cloud + module TextToSpeech + module V1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + module TextToSpeechLongAudioSynthesize + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb new file mode 100644 index 000000000000..06c4eb02a0f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb @@ -0,0 +1,460 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub" + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + module Rest + ## + # REST client for the TextToSpeechLongAudioSynthesize service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_long_audio_synthesize_stub + + ## + # Configure the TextToSpeechLongAudioSynthesize Client class. + # + # See {::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients + # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "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.synthesize_long_audio.timeout = 5000.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 + @text_to_speech_long_audio_synthesize_stub.universe_domain + end + + ## + # Create a new TextToSpeechLongAudioSynthesize REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 + + @text_to_speech_long_audio_synthesize_stub = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @text_to_speech_long_audio_synthesize_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_long_audio_synthesize_stub.logger + end + + # Service calls + + ## + # Synthesizes long form text asynchronously. + # + # @overload synthesize_long_audio(request, options = nil) + # Pass arguments to `synthesize_long_audio` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) + # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at + # least one keyword argument is 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] + # The resource states of the request in the form of + # `projects/*/locations/*`. + # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param output_gcs_uri [::String] + # Required. Specifies a Cloud Storage URI for the synthesis results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # @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/text_to_speech/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new + # + # # Call the synthesize_long_audio method. + # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest + + # Converts hash 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.synthesize_long_audio.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::TextToSpeech::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.synthesize_long_audio.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.synthesize_long_audio.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_long_audio_synthesize_stub.synthesize_long_audio request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeechLongAudioSynthesize REST API. + # + # This class represents the configuration for TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 + # # synthesize_long_audio to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_long_audio + + # @private + def initialize parent_rpcs = nil + synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio + @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb new file mode 100644 index 000000000000..166fbb391f2b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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::TextToSpeech::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? + throw :response, 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::TextToSpeech::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? + throw :response, 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::TextToSpeech::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? + 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::TextToSpeech::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? + 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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/[^/]+/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{^operations(?:/.*)?$}, true] + ] + ) + 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", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb new file mode 100644 index 000000000000..865f7c9fc35b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + module Rest + ## + # REST service stub for the TextToSpeechLongAudioSynthesize service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the synthesize_long_audio REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest] + # 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 synthesize_long_audio request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_long_audio_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, + method_name: "synthesize_long_audio", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the synthesize_long_audio REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_synthesize_long_audio_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:synthesizeLongAudio", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb new file mode 100644 index 000000000000..bac4947af0ac --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb new file mode 100644 index 000000000000..a03e80c06d34 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/texttospeech/v1/cloud_tts_lrs.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/cloud/texttospeech/v1/cloud_tts_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/texttospeech/v1/cloud_tts.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\x02\n\x1aSynthesizeLongAudioRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12@\n\x05input\x18\x02 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02\x12\x1b\n\x0eoutput_gcs_uri\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x05 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\"\x1d\n\x1bSynthesizeLongAudioResponse\"\xa4\x01\n\x1bSynthesizeLongAudioMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01\x12\x1b\n\x13progress_percentage\x18\x03 \x01(\x01\x32\x9f\x03\n\x1fTextToSpeechLongAudioSynthesize\x12\xaa\x02\n\x13SynthesizeLongAudio\x12\x38.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41t\n8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x12\x38google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xd3\xe4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xef\x01\n com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1\xea\x02\x1fGoogle::Cloud::TextToSpeech::V1b\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.texttospeech.v1.SynthesisInput", "google/cloud/texttospeech/v1/cloud_tts.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 TextToSpeech + module V1 + SynthesizeLongAudioRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeLongAudioRequest").msgclass + SynthesizeLongAudioResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeLongAudioResponse").msgclass + SynthesizeLongAudioMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb new file mode 100644 index 000000000000..a814fd22032f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/texttospeech/v1/cloud_tts_lrs.proto for package 'Google.Cloud.TextToSpeech.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/texttospeech/v1/cloud_tts_lrs_pb' + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeechLongAudioSynthesize + # Service that implements Google Cloud Text-to-Speech API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' + + # Synthesizes long form text asynchronously. + rpc :SynthesizeLongAudio, ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb new file mode 100644 index 000000000000..37ce8855607f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/texttospeech/v1/cloud_tts.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' + + +descriptor_data = "\n,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\"I\n\x12ListVoicesResponse\x12\x33\n\x06voices\x18\x01 \x03(\x0b\x32#.google.cloud.texttospeech.v1.Voice\"\x94\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\x8a\x01\n\x14\x41\x64vancedVoiceOptions\x12*\n\x1dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12$\n\x14relax_safety_filters\x18\x08 \x01(\x08\x42\x06\xe0\x41\x04\xe0\x41\x01\x42 \n\x1e_low_latency_journey_synthesis\"\xdd\x02\n\x17SynthesizeSpeechRequest\x12@\n\x05input\x18\x01 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x02 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02\x12W\n\x16\x61\x64vanced_voice_options\x18\x08 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.AdvancedVoiceOptionsH\x00\x88\x01\x01\x42\x19\n\x17_advanced_voice_options\"\xa2\x03\n\x19\x43ustomPronunciationParams\x12\x13\n\x06phrase\x18\x01 \x01(\tH\x00\x88\x01\x01\x12h\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1a\n\rpronunciation\x18\x03 \x01(\tH\x02\x88\x01\x01\"\xb6\x01\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12\'\n#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1c\n\x18PHONETIC_ENCODING_PINYIN\x10\x04\x42\t\n\x07_phraseB\x14\n\x12_phonetic_encodingB\x10\n\x0e_pronunciation\"g\n\x14\x43ustomPronunciations\x12O\n\x0epronunciations\x18\x01 \x03(\x0b\x32\x37.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\n\x12MultiSpeakerMarkup\x12I\n\x05turns\x18\x01 \x03(\x0b\x32\x35.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xe0\x41\x02\x1a/\n\x04Turn\x12\x14\n\x07speaker\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x02\"P\n\x19MultispeakerPrebuiltVoice\x12\x1a\n\rspeaker_alias\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nspeaker_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"v\n\x17MultiSpeakerVoiceConfig\x12[\n\x15speaker_voice_configs\x18\x02 \x03(\x0b\x32\x37.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xe0\x41\x02\"\x9c\x02\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12P\n\x14multi_speaker_markup\x18\x04 \x01(\x0b\x32\x30.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x12V\n\x15\x63ustom_pronunciations\x18\x03 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xe0\x41\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\x8e\x03\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12\x45\n\x0c\x63ustom_voice\x18\x04 \x01(\x0b\x32/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\n\x0bvoice_clone\x18\x05 \x01(\x0b\x32..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xe0\x41\x01\x12\x17\n\nmodel_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12^\n\x1amulti_speaker_voice_config\x18\x07 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xe0\x41\x01\"\xf1\x01\n\x0b\x41udioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01\"\xf1\x01\n\x11\x43ustomVoiceParams\x12\x32\n\x05model\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\\\n\x0ereported_usage\x18\x03 \x01(\x0e\x32=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xe0\x41\x01\"J\n\rReportedUsage\x12\x1e\n\x1aREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REALTIME\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\"2\n\x10VoiceCloneParams\x12\x1e\n\x11voice_cloning_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c\"\x9f\x01\n\x14StreamingAudioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\rspeaking_rate\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\"\x94\x02\n\x19StreamingSynthesizeConfig\x12\x46\n\x05voice\x18\x01 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12W\n\x16streaming_audio_config\x18\x04 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xe0\x41\x01\x12V\n\x15\x63ustom_pronunciations\x18\x05 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xe0\x41\x01\"\xbd\x01\n\x17StreamingSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12P\n\x14multi_speaker_markup\x18\x07 \x01(\x0b\x32\x30.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\xce\x01\n\x1aStreamingSynthesizeRequest\x12S\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12\x46\n\x05input\x18\x02 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00\x42\x13\n\x11streaming_request\"4\n\x1bStreamingSynthesizeResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*{\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x12\t\n\x05MULAW\x10\x05\x12\x08\n\x04\x41LAW\x10\x06\x12\x07\n\x03PCM\x10\x07\x12\x07\n\x03M4A\x10\x08\x32\xc7\x04\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xda\x41\rlanguage_code\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xda\x41\x18input,voice,audio_config\x82\xd3\xe4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\n\x13StreamingSynthesize\x12\x38.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1a\x39.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x01\x30\x01\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbc\x02\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xa2\x02\x04\x43TTS\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1\xea\x02\x1fGoogle::Cloud::TextToSpeech::V1\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}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 = [ + ] + 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 TextToSpeech + module V1 + ListVoicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.ListVoicesRequest").msgclass + ListVoicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.ListVoicesResponse").msgclass + Voice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.Voice").msgclass + AdvancedVoiceOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.AdvancedVoiceOptions").msgclass + SynthesizeSpeechRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechRequest").msgclass + CustomPronunciationParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomPronunciationParams").msgclass + CustomPronunciationParams::PhoneticEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding").enummodule + CustomPronunciations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomPronunciations").msgclass + MultiSpeakerMarkup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultiSpeakerMarkup").msgclass + MultiSpeakerMarkup::Turn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn").msgclass + MultispeakerPrebuiltVoice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice").msgclass + MultiSpeakerVoiceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig").msgclass + SynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesisInput").msgclass + VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.VoiceSelectionParams").msgclass + AudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.AudioConfig").msgclass + CustomVoiceParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomVoiceParams").msgclass + CustomVoiceParams::ReportedUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage").enummodule + VoiceCloneParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.VoiceCloneParams").msgclass + SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechResponse").msgclass + StreamingAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingAudioConfig").msgclass + StreamingSynthesizeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeConfig").msgclass + StreamingSynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesisInput").msgclass + StreamingSynthesizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeRequest").msgclass + StreamingSynthesizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeResponse").msgclass + SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SsmlVoiceGender").enummodule + AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.AudioEncoding").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb new file mode 100644 index 000000000000..45222db99258 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/texttospeech/v1/cloud_tts.proto for package 'Google.Cloud.TextToSpeech.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/texttospeech/v1/cloud_tts_pb' + +module Google + module Cloud + module TextToSpeech + module V1 + module TextToSpeech + # Service that implements Google Cloud Text-to-Speech API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.texttospeech.v1.TextToSpeech' + + # Returns a list of Voice supported for synthesis. + rpc :ListVoices, ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse + # Synthesizes speech synchronously: receive results after all text input + # has been processed. + rpc :SynthesizeSpeech, ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse + # Performs bidirectional streaming speech synthesis: receives audio while + # sending text. + rpc :StreamingSynthesize, stream(::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest), stream(::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md new file mode 100644 index 000000000000..ccb07287720d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Text-to-Speech V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-text_to_speech-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb new file mode 100644 index 000000000000..957a73931130 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb @@ -0,0 +1,583 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + # The top-level message sent by the client for the `ListVoices` method. + # @!attribute [rw] language_code + # @return [::String] + # Optional. Recommended. + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # If not specified, the API will return all supported voices. + # If specified, the ListVoices call will only return voices that can be used + # to synthesize this language_code. For example, if you specify `"en-NZ"`, + # all `"en-NZ"` voices will be returned. If you specify `"no"`, both + # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + # returned. + class ListVoicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message returned to the client by the `ListVoices` method. + # @!attribute [rw] voices + # @return [::Array<::Google::Cloud::TextToSpeech::V1::Voice>] + # The list of voices. + class ListVoicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of a voice supported by the TTS service. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # The languages that this voice supports, expressed as + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + # "en-US", "es-419", "cmn-tw"). + # @!attribute [rw] name + # @return [::String] + # The name of this voice. Each distinct voice has a unique name. + # @!attribute [rw] ssml_gender + # @return [::Google::Cloud::TextToSpeech::V1::SsmlVoiceGender] + # The gender of this voice. + # @!attribute [rw] natural_sample_rate_hertz + # @return [::Integer] + # The natural sample rate (in hertz) for this voice. + class Voice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Used for advanced voice options. + # @!attribute [rw] low_latency_journey_synthesis + # @return [::Boolean] + # Only for Journey voices. If false, the synthesis is context aware + # and has a higher latency. + # @!attribute [rw] relax_safety_filters + # @return [::Boolean] + # Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + # supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + # Otherwise, will return result + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + class AdvancedVoiceOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client for the `SynthesizeSpeech` method. + # @!attribute [rw] input + # @return [::Google::Cloud::TextToSpeech::V1::SynthesisInput] + # Required. The Synthesizer requires either plain text or SSML as input. + # @!attribute [rw] voice + # @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams] + # Required. The desired voice of the synthesized audio. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::TextToSpeech::V1::AudioConfig] + # Required. The configuration of the synthesized audio. + # @!attribute [rw] advanced_voice_options + # @return [::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions] + # Advanced voice options. + class SynthesizeSpeechRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pronunciation customization for a phrase. + # @!attribute [rw] phrase + # @return [::String] + # The phrase to which the customization is applied. + # The phrase can be multiple words, such as proper nouns, but shouldn't span + # the length of the sentence. + # @!attribute [rw] phonetic_encoding + # @return [::Google::Cloud::TextToSpeech::V1::CustomPronunciationParams::PhoneticEncoding] + # The phonetic encoding of the phrase. + # @!attribute [rw] pronunciation + # @return [::String] + # The pronunciation of the phrase. This must be in the phonetic encoding + # specified above. + class CustomPronunciationParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The phonetic encoding of the phrase. + module PhoneticEncoding + # Not specified. + PHONETIC_ENCODING_UNSPECIFIED = 0 + + # IPA, such as apple -> ˈæpəl. + # https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + PHONETIC_ENCODING_IPA = 1 + + # X-SAMPA, such as apple -> "{p@l". + # https://en.wikipedia.org/wiki/X-SAMPA + PHONETIC_ENCODING_X_SAMPA = 2 + + # For reading-to-pron conversion to work well, the `pronunciation` field + # should only contain Kanji, Hiragana, and Katakana. + # + # The pronunciation can also contain pitch accents. + # The start of a pitch phrase is specified with `^` and the down-pitch + # position is specified with `!`, for example: + # + # phrase:端 pronunciation:^はし + # phrase:箸 pronunciation:^は!し + # phrase:橋 pronunciation:^はし! + # + # We currently only support the Tokyo dialect, which allows at most one + # down-pitch per phrase (i.e. at most one `!` between `^`). + PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3 + + # Used to specify pronunciations for Mandarin words. See + # https://en.wikipedia.org/wiki/Pinyin. + # + # For example: 朝阳, the pronunciation is "chao2 yang2". The number + # represents the tone, and there is a space between syllables. Neutral + # tones are represented by 5, for example 孩子 "hai2 zi5". + PHONETIC_ENCODING_PINYIN = 4 + end + end + + # A collection of pronunciation customizations. + # @!attribute [rw] pronunciations + # @return [::Array<::Google::Cloud::TextToSpeech::V1::CustomPronunciationParams>] + # The pronunciation customizations are applied. + class CustomPronunciations + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of turns for multi-speaker synthesis. + # @!attribute [rw] turns + # @return [::Array<::Google::Cloud::TextToSpeech::V1::MultiSpeakerMarkup::Turn>] + # Required. Speaker turns. + class MultiSpeakerMarkup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A multi-speaker turn. + # @!attribute [rw] speaker + # @return [::String] + # Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + # to documentation for available speakers. + # @!attribute [rw] text + # @return [::String] + # Required. The text to speak. + class Turn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration for a single speaker in a Gemini TTS multi-speaker setup. + # Enables dialogue between two speakers. + # @!attribute [rw] speaker_alias + # @return [::String] + # Required. The speaker alias of the voice. This is the user-chosen speaker + # name that is used in the multispeaker text input, such as "Speaker1". + # @!attribute [rw] speaker_id + # @return [::String] + # Required. The speaker ID of the voice. See + # https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + # for available values. + class MultispeakerPrebuiltVoice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a multi-speaker text-to-speech setup. Enables the use of up + # to two distinct voices in a single synthesis request. + # @!attribute [rw] speaker_voice_configs + # @return [::Array<::Google::Cloud::TextToSpeech::V1::MultispeakerPrebuiltVoice>] + # Required. A list of configurations for the voices of the speakers. Exactly + # two speaker voice configurations must be provided. + class MultiSpeakerVoiceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains text input to be synthesized. Either `text` or `ssml` must be + # supplied. Supplying both or neither returns + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The + # input size is limited to 5000 bytes. + # @!attribute [rw] text + # @return [::String] + # The raw text to be synthesized. + # + # Note: The following fields are mutually exclusive: `text`, `markup`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] markup + # @return [::String] + # Markup for HD voices specifically. This field may not be used with any + # other voices. + # + # Note: The following fields are mutually exclusive: `markup`, `text`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ssml + # @return [::String] + # The SSML document to be synthesized. The SSML document must be valid + # and well-formed. Otherwise the RPC will fail and return + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + # more information, see + # [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + # + # Note: The following fields are mutually exclusive: `ssml`, `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] multi_speaker_markup + # @return [::Google::Cloud::TextToSpeech::V1::MultiSpeakerMarkup] + # The multi-speaker input to be synthesized. Only applicable for + # multi-speaker synthesis. + # + # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`, `ssml`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] prompt + # @return [::String] + # This system instruction is supported only for controllable/promptable voice + # models. If this system instruction is used, we pass the unedited text to + # Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + # calls this system instruction, Style Instructions. + # @!attribute [rw] custom_pronunciations + # @return [::Google::Cloud::TextToSpeech::V1::CustomPronunciations] + # Optional. The pronunciation customizations are applied to the input. If + # this is set, the input is synthesized using the given pronunciation + # customizations. + # + # The initial support is for en-us, with plans to expand to other locales in + # the future. Instant Clone voices aren't supported. + # + # In order to customize the pronunciation of a phrase, there must be an exact + # match of the phrase in the input types. If using SSML, the phrase must not + # be inside a phoneme tag. + class SynthesisInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of which voice to use for a synthesis request. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language (and potentially also the region) of the voice + # expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag, e.g. "en-US". This should not include a script tag (e.g. use + # "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + # from the input provided in the SynthesisInput. The TTS service + # will use this parameter to help choose an appropriate voice. Note that + # the TTS service may choose a voice with a slightly different language code + # than the one selected; it may substitute a different region + # (e.g. using en-US rather than en-CA if there isn't a Canadian voice + # available), or even a different language, e.g. using "nb" (Norwegian + # Bokmal) instead of "no" (Norwegian)". + # @!attribute [rw] name + # @return [::String] + # The name of the voice. If both the name and the gender are not set, + # the service will choose a voice based on the other parameters such as + # language_code. + # @!attribute [rw] ssml_gender + # @return [::Google::Cloud::TextToSpeech::V1::SsmlVoiceGender] + # The preferred gender of the voice. If not set, the service will + # choose a voice based on the other parameters such as language_code and + # name. Note that this is only a preference, not requirement; if a + # voice of the appropriate gender is not available, the synthesizer should + # substitute a voice with a different gender rather than failing the request. + # @!attribute [rw] custom_voice + # @return [::Google::Cloud::TextToSpeech::V1::CustomVoiceParams] + # The configuration for a custom voice. If [CustomVoiceParams.model] is set, + # the service will choose the custom voice matching the specified + # configuration. + # @!attribute [rw] voice_clone + # @return [::Google::Cloud::TextToSpeech::V1::VoiceCloneParams] + # Optional. The configuration for a voice clone. If + # [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + # clone matching the specified configuration. + # @!attribute [rw] model_name + # @return [::String] + # Optional. The name of the model. If set, the service will choose the model + # matching the specified configuration. + # @!attribute [rw] multi_speaker_voice_config + # @return [::Google::Cloud::TextToSpeech::V1::MultiSpeakerVoiceConfig] + # Optional. The configuration for a Gemini multi-speaker text-to-speech + # setup. Enables the use of two distinct voices in a single synthesis + # request. + class VoiceSelectionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of audio data to be synthesized. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::TextToSpeech::V1::AudioEncoding] + # Required. The format of the audio byte stream. + # @!attribute [rw] speaking_rate + # @return [::Float] + # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + # the normal native speed supported by the specific voice. 2.0 is twice as + # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + # speed. Any other values < 0.25 or > 2.0 will return an error. + # @!attribute [rw] pitch + # @return [::Float] + # Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + # increase 20 semitones from the original pitch. -20 means decrease 20 + # semitones from the original pitch. + # @!attribute [rw] volume_gain_db + # @return [::Float] + # Optional. Input only. Volume gain (in dB) of the normal native volume + # supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + # set to a value of 0.0 (dB), will play at normal native signal amplitude. A + # value of -6.0 (dB) will play at approximately half the amplitude of the + # normal native signal amplitude. A value of +6.0 (dB) will play at + # approximately twice the amplitude of the normal native signal amplitude. + # Strongly recommend not to exceed +10 (dB) as there's usually no effective + # increase in loudness for any value greater than that. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Optional. The synthesis sample rate (in hertz) for this audio. When this is + # specified in SynthesizeSpeechRequest, if this is different from the voice's + # natural sample rate, then the synthesizer will honor this request by + # converting to the desired sample rate (which might result in worse audio + # quality), unless the specified sample rate is not supported for the + # encoding chosen, in which case it will fail the request and return + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + # @!attribute [rw] effects_profile_id + # @return [::Array<::String>] + # Optional. Input only. An identifier which selects 'audio effects' profiles + # that are applied on (post synthesized) text to speech. Effects are applied + # on top of each other in the order they are given. See + # [audio + # profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + # current supported profile ids. + class AudioConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of the custom voice to be synthesized. + # @!attribute [rw] model + # @return [::String] + # Required. The name of the AutoML model that synthesizes the custom voice. + # @!attribute [rw] reported_usage + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::TextToSpeech::V1::CustomVoiceParams::ReportedUsage] + # Optional. Deprecated. The usage of the synthesized audio to be reported. + class CustomVoiceParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Deprecated. The usage of the synthesized audio. Usage does not affect + # billing. + module ReportedUsage + # Request with reported usage unspecified will be rejected. + REPORTED_USAGE_UNSPECIFIED = 0 + + # For scenarios where the synthesized audio is not downloadable and can + # only be used once. For example, real-time request in IVR system. + REALTIME = 1 + + # For scenarios where the synthesized audio is downloadable and can be + # reused. For example, the synthesized audio is downloaded, stored in + # customer service system and played repeatedly. + OFFLINE = 2 + end + end + + # The configuration of Voice Clone feature. + # @!attribute [rw] voice_cloning_key + # @return [::String] + # Required. Created by GenerateVoiceCloningKey. + class VoiceCloneParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message returned to the client by the `SynthesizeSpeech` method. + # @!attribute [rw] audio_content + # @return [::String] + # The audio data bytes encoded as specified in the request, including the + # header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + # For LINEAR16 audio, we include the WAV header. Note: as + # with all bytes fields, protobuffers use a pure binary representation, + # whereas JSON representations use base64. + class SynthesizeSpeechResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of the desired output audio data. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::TextToSpeech::V1::AudioEncoding] + # Required. The format of the audio byte stream. + # Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + # return an error. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Optional. The synthesis sample rate (in hertz) for this audio. + # @!attribute [rw] speaking_rate + # @return [::Float] + # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + # the normal native speed supported by the specific voice. 2.0 is twice as + # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + # speed. Any other values < 0.25 or > 2.0 will return an error. + class StreamingAudioConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides configuration information for the StreamingSynthesize request. + # @!attribute [rw] voice + # @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams] + # Required. The desired voice of the synthesized audio. + # @!attribute [rw] streaming_audio_config + # @return [::Google::Cloud::TextToSpeech::V1::StreamingAudioConfig] + # Optional. The configuration of the synthesized audio. + # @!attribute [rw] custom_pronunciations + # @return [::Google::Cloud::TextToSpeech::V1::CustomPronunciations] + # Optional. The pronunciation customizations are applied to the input. If + # this is set, the input is synthesized using the given pronunciation + # customizations. + # + # The initial support is for en-us, with plans to expand to other locales in + # the future. Instant Clone voices aren't supported. + # + # In order to customize the pronunciation of a phrase, there must be an exact + # match of the phrase in the input types. If using SSML, the phrase must not + # be inside a phoneme tag. + class StreamingSynthesizeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input to be synthesized. + # @!attribute [rw] text + # @return [::String] + # The raw text to be synthesized. It is recommended that each input + # contains complete, terminating sentences, which results in better prosody + # in the output audio. + # + # Note: The following fields are mutually exclusive: `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] markup + # @return [::String] + # Markup for HD voices specifically. This field may not be used with any + # other voices. + # + # Note: The following fields are mutually exclusive: `markup`, `text`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] multi_speaker_markup + # @return [::Google::Cloud::TextToSpeech::V1::MultiSpeakerMarkup] + # Multi-speaker markup for Gemini TTS. This field may not + # be used with any other voices. + # + # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] prompt + # @return [::String] + # This is system instruction supported only for controllable voice models. + class StreamingSynthesisInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `StreamingSynthesize` method. Multiple + # `StreamingSynthesizeRequest` messages are sent in one call. + # The first message must contain a `streaming_config` that + # fully specifies the request configuration and must not contain `input`. All + # subsequent messages must only have `input` set. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeConfig] + # StreamingSynthesizeConfig to be used in this streaming attempt. Only + # specified in the first message sent in a `StreamingSynthesize` call. + # + # Note: The following fields are mutually exclusive: `streaming_config`, `input`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] input + # @return [::Google::Cloud::TextToSpeech::V1::StreamingSynthesisInput] + # Input to synthesize. Specified in all messages but the first in a + # `StreamingSynthesize` call. + # + # Note: The following fields are mutually exclusive: `input`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class StreamingSynthesizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StreamingSynthesizeResponse` is the only message returned to the + # client by `StreamingSynthesize` method. A series of zero or more + # `StreamingSynthesizeResponse` messages are streamed back to the client. + # @!attribute [rw] audio_content + # @return [::String] + # The audio data bytes encoded as specified in the request. This is + # headerless LINEAR16 audio with a sample rate of 24000. + class StreamingSynthesizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Gender of the voice as described in + # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). + module SsmlVoiceGender + # An unspecified gender. + # In VoiceSelectionParams, this means that the client doesn't care which + # gender the selected voice will have. In the Voice field of + # ListVoicesResponse, this may mean that the voice doesn't fit any of the + # other categories in this enum, or that the gender of the voice isn't known. + SSML_VOICE_GENDER_UNSPECIFIED = 0 + + # A male voice. + MALE = 1 + + # A female voice. + FEMALE = 2 + + # A gender-neutral voice. This voice is not yet supported. + NEUTRAL = 3 + end + + # Configuration to set up audio encoder. The encoding determines the output + # audio format that we'd like. + module AudioEncoding + # Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return + # result + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + AUDIO_ENCODING_UNSPECIFIED = 0 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + # Audio content returned as LINEAR16 also contains a WAV header. + LINEAR16 = 1 + + # MP3 audio at 32kbps. + MP3 = 2 + + # Opus encoded audio wrapped in an ogg container. The result is a + # file which can be played natively on Android, and in browsers (at least + # Chrome and Firefox). The quality of the encoding is considerably higher + # than MP3 while using approximately the same bitrate. + OGG_OPUS = 3 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + # Audio content returned as MULAW also contains a WAV header. + MULAW = 5 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + # Audio content returned as ALAW also contains a WAV header. + ALAW = 6 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + # Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or + # any other) header. + PCM = 7 + + # M4A audio. + M4A = 8 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb new file mode 100644 index 000000000000..661006f03010 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1 + # The top-level message sent by the client for the + # `SynthesizeLongAudio` method. + # @!attribute [rw] parent + # @return [::String] + # The resource states of the request in the form of + # `projects/*/locations/*`. + # @!attribute [rw] input + # @return [::Google::Cloud::TextToSpeech::V1::SynthesisInput] + # Required. The Synthesizer requires either plain text or SSML as input. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::TextToSpeech::V1::AudioConfig] + # Required. The configuration of the synthesized audio. + # @!attribute [rw] output_gcs_uri + # @return [::String] + # Required. Specifies a Cloud Storage URI for the synthesis results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + # @!attribute [rw] voice + # @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams] + # Required. The desired voice of the synthesized audio. + class SynthesizeLongAudioRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message returned to the client by the `SynthesizeLongAudio` method. + class SynthesizeLongAudioResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for response returned by the `SynthesizeLongAudio` method. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time when the request was received. + # @!attribute [rw] last_update_time + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::Timestamp] + # Deprecated. Do not use. + # @!attribute [rw] progress_percentage + # @return [::Float] + # The progress of the most recent processing update in percentage, ie. 70.0%. + class SynthesizeLongAudioMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-text_to_speech-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile new file mode 100644 index 000000000000..7976a33d4ee6 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1", path: "../" +else + gem "google-cloud-text_to_speech-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-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json new file mode 100644 index 000000000000..69310b5a3978 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json @@ -0,0 +1,175 @@ +{ + "client_library": { + "name": "google-cloud-text_to_speech-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.texttospeech.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "texttospeech_v1_generated_TextToSpeech_ListVoices_sync", + "title": "Snippet for the list_voices call in the TextToSpeech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#list_voices.", + "file": "text_to_speech/list_voices.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_voices", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#list_voices", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1::ListVoicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TextToSpeech::V1::ListVoicesResponse", + "client": { + "short_name": "TextToSpeech::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client" + }, + "method": { + "short_name": "ListVoices", + "full_name": "google.cloud.texttospeech.v1.TextToSpeech.ListVoices", + "service": { + "short_name": "TextToSpeech", + "full_name": "google.cloud.texttospeech.v1.TextToSpeech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync", + "title": "Snippet for the synthesize_speech call in the TextToSpeech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech.", + "file": "text_to_speech/synthesize_speech.rb", + "language": "RUBY", + "client_method": { + "short_name": "synthesize_speech", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse", + "client": { + "short_name": "TextToSpeech::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client" + }, + "method": { + "short_name": "SynthesizeSpeech", + "full_name": "google.cloud.texttospeech.v1.TextToSpeech.SynthesizeSpeech", + "service": { + "short_name": "TextToSpeech", + "full_name": "google.cloud.texttospeech.v1.TextToSpeech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync", + "title": "Snippet for the streaming_synthesize call in the TextToSpeech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#streaming_synthesize.", + "file": "text_to_speech/streaming_synthesize.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_synthesize", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#streaming_synthesize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse", + "client": { + "short_name": "TextToSpeech::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client" + }, + "method": { + "short_name": "StreamingSynthesize", + "full_name": "google.cloud.texttospeech.v1.TextToSpeech.StreamingSynthesize", + "service": { + "short_name": "TextToSpeech", + "full_name": "google.cloud.texttospeech.v1.TextToSpeech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync", + "title": "Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio.", + "file": "text_to_speech_long_audio_synthesize/synthesize_long_audio.rb", + "language": "RUBY", + "client_method": { + "short_name": "synthesize_long_audio", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TextToSpeechLongAudioSynthesize::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client" + }, + "method": { + "short_name": "SynthesizeLongAudio", + "full_name": "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize.SynthesizeLongAudio", + "service": { + "short_name": "TextToSpeechLongAudioSynthesize", + "full_name": "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb new file mode 100644 index 000000000000..dcedec6e5a0c --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeech_ListVoices_sync] +require "google/cloud/text_to_speech/v1" + +## +# Snippet for the list_voices call in the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::Client#list_voices. +# +def list_voices + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new + + # Call the list_voices method. + result = client.list_voices request + + # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. + p result +end +# [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb new file mode 100644 index 000000000000..12502cdb1184 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] +require "google/cloud/text_to_speech/v1" + +## +# Snippet for the streaming_synthesize call in the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::Client#streaming_synthesize. +# +def streaming_synthesize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_synthesize method to start streaming. + output = client.streaming_synthesize input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new + input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse + output.each do |current_response| + p current_response + end +end +# [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb new file mode 100644 index 000000000000..47f43d5a430b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] +require "google/cloud/text_to_speech/v1" + +## +# Snippet for the synthesize_speech call in the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech. +# +def synthesize_speech + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new + + # Call the synthesize_speech method. + result = client.synthesize_speech request + + # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. + p result +end +# [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb new file mode 100644 index 000000000000..735a14416d4b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] +require "google/cloud/text_to_speech/v1" + +## +# Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio. +# +def synthesize_long_audio + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new + + # Call the synthesize_long_audio method. + result = client.synthesize_long_audio 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 texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb new file mode 100644 index 000000000000..db4bf31d4508 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" +require "google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" + +class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb new file mode 100644 index 000000000000..7b3d9ca4c355 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech_long_audio_synthesize" + +class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.model_path project: "value0", location: "value1", model: "value2" + assert_equal "projects/value0/locations/value1/models/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb new file mode 100644 index 000000000000..9163bb0d1bf4 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" + + +class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_synthesize_long_audio + # 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" + input = {} + audio_config = {} + output_gcs_uri = "hello world" + voice = {} + + synthesize_long_audio_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.stub :transcode_synthesize_long_audio_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, synthesize_long_audio_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, synthesize_long_audio_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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb new file mode 100644 index 000000000000..43ec433e106d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb @@ -0,0 +1,189 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" +require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" + +class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_synthesize_long_audio + # 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" + input = {} + audio_config = {} + output_gcs_uri = "hello world" + voice = {} + + synthesize_long_audio_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :synthesize_long_audio, name + assert_kind_of ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::SynthesisInput), request["input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::AudioConfig), request["audio_config"] + assert_equal "hello world", request["output_gcs_uri"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams), request["voice"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, synthesize_long_audio_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) 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.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice 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.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) 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.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, 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.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), 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, synthesize_long_audio_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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client, client + assert_equal creds, client.configure.credentials + end + 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb new file mode 100644 index 000000000000..9a2c35e6af4b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech" + +class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.model_path project: "value0", location: "value1", model: "value2" + assert_equal "projects/value0/locations/value1/models/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb new file mode 100644 index 000000000000..a521af9545c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" +require "google/cloud/text_to_speech/v1/text_to_speech/rest" + + +class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_voices + # Create test objects. + client_result = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + language_code = "hello world" + + list_voices_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TextToSpeech::V1::TextToSpeech::Rest::ServiceStub.stub :transcode_list_voices_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_voices_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_voices({ language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_voices language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_voices ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_voices({ language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_voices(::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_voices_client_stub.call_count + end + end + end + + def test_synthesize_speech + # Create test objects. + client_result = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + input = {} + voice = {} + audio_config = {} + advanced_voice_options = {} + + synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TextToSpeech::V1::TextToSpeech::Rest::ServiceStub.stub :transcode_synthesize_speech_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, synthesize_speech_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.synthesize_speech input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.synthesize_speech ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.synthesize_speech(::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, synthesize_speech_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::TextToSpeech::V1::TextToSpeech::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::TextToSpeech::V1::TextToSpeech::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb new file mode 100644 index 000000000000..ccce604bf027 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb @@ -0,0 +1,316 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" +require "google/cloud/text_to_speech/v1/text_to_speech" + +class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_voices + # Create GRPC objects. + grpc_response = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.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. + language_code = "hello world" + + list_voices_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_voices, name + assert_kind_of ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, request + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_voices_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_voices({ language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_voices language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_voices ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_voices({ language_code: language_code }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_voices(::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_voices_client_stub.call_rpc_count + end + end + + def test_synthesize_speech + # Create GRPC objects. + grpc_response = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.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. + input = {} + voice = {} + audio_config = {} + advanced_voice_options = {} + + synthesize_speech_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :synthesize_speech, name + assert_kind_of ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::SynthesisInput), request["input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams), request["voice"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::AudioConfig), request["audio_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions), request["advanced_voice_options"] + assert request.has_advanced_voice_options? + refute_nil options + end + + Gapic::ServiceStub.stub :new, synthesize_speech_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.synthesize_speech input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.synthesize_speech ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.synthesize_speech(::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, synthesize_speech_client_stub.call_rpc_count + end + end + + def test_streaming_synthesize + # Create GRPC objects. + grpc_response = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse.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 bidi streaming method. + streaming_config = {} + + streaming_synthesize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_synthesize, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_synthesize_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_synthesize enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_synthesize stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_synthesize enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_synthesize stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_synthesize_client_stub.call_rpc_count + streaming_synthesize_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeConfig), r["streaming_config"] + assert_equal :streaming_config, r.streaming_request + end + end + 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::TextToSpeech::V1::TextToSpeech::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::TextToSpeech::V1::TextToSpeech::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.gitignore b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.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-text_to_speech-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..62505f56579f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "texttospeech.googleapis.com", + "api_shortname": "texttospeech", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1beta1/latest", + "distribution_name": "google-cloud-text_to_speech-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "texttospeech", + "name_pretty": "Cloud Text-to-Speech V1beta1 API", + "product_documentation": "https://cloud.google.com/text-to-speech", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TEXTTOSPEECH", + "ruby-cloud-product-url": "https://cloud.google.com/text-to-speech", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..1902584e3617 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-text_to_speech-v1beta1.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-text_to_speech-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/.yardopts b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.yardopts new file mode 100644 index 000000000000..e1ca395542bf --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Text-to-Speech V1beta1 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-text_to_speech-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..b8cf76c40475 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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/text_to_speech/v1beta1" + +client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/text_to_speech/v1beta1" + +::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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-text_to_speech-v1beta1 +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/text_to_speech/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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-text_to_speech-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-text_to_speech-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/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-text_to_speech-v1beta1/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md new file mode 100644 index 000000000000..164b19d0e5ab --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Text-to-Speech V1beta1 API + +Synthesizes natural-sounding speech by applying powerful neural network models. + +Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. + +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 Text-to-Speech V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-text_to_speech](https://rubygems.org/gems/google-cloud-text_to_speech). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-text_to_speech-v1beta1 +``` + +## 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/texttospeech.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/text_to_speech/v1beta1" + +client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new +request = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new # (request fields as keyword arguments...) +response = client.list_voices request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/text-to-speech) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/text_to_speech/v1beta1" +require "logger" + +client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-text_to_speech`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-text_to_speech-v1beta1`. +_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-text_to_speech`. +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-text_to_speech-v1beta1`. + +### 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-text_to_speech-v1beta1/Rakefile b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile new file mode 100644 index 000000000000..d2ce03364134 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TEXTTOSPEECH_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TEXTTOSPEECH_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TEXTTOSPEECH_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 TEXTTOSPEECH_TEST_PROJECT=test123 TEXTTOSPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/text_to_speech/v1beta1/text_to_speech/credentials" + ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TEXTTOSPEECH_PROJECT"] = project + ENV["TEXTTOSPEECH_TEST_PROJECT"] = project + ENV["TEXTTOSPEECH_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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-text_to_speech-v1beta1" + header "google-cloud-text_to_speech-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-text_to_speech-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..ad2335193dfe --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json @@ -0,0 +1,47 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.texttospeech.v1beta1", + "libraryPackage": "::Google::Cloud::TextToSpeech::V1beta1", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client", + "rpcs": { + "ListVoices": { + "methods": [ + "list_voices" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesize_speech" + ] + }, + "StreamingSynthesize": { + "methods": [ + "streaming_synthesize" + ] + } + } + } + } + }, + "TextToSpeechLongAudioSynthesize": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client", + "rpcs": { + "SynthesizeLongAudio": { + "methods": [ + "synthesize_long_audio" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec new file mode 100644 index 000000000000..7e1ef7e87ddf --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/text_to_speech/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-text_to_speech-v1beta1" + gem.version = Google::Cloud::TextToSpeech::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details." + gem.summary = "Synthesizes natural-sounding speech by applying powerful neural network models." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb new file mode 100644 index 000000000000..0d9b902cd048 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb new file mode 100644 index 000000000000..5e90ad3198ba --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" +require "google/cloud/text_to_speech/v1beta1/version" + +module Google + module Cloud + module TextToSpeech + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/text_to_speech/v1beta1" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/text_to_speech/v1beta1" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/text_to_speech/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb new file mode 100644 index 000000000000..e5fbca0fbb22 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech/rest" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" +require "google/cloud/text_to_speech/v1beta1/version" + +module Google + module Cloud + module TextToSpeech + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/text_to_speech/v1beta1/rest" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb new file mode 100644 index 000000000000..b1bcd5fb1511 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" + +require "google/cloud/text_to_speech/v1beta1/text_to_speech/credentials" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/paths" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/client" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/text_to_speech/v1beta1/text_to_speech" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new + # + module TextToSpeech + end + end + end + end +end + +helper_path = ::File.join __dir__, "text_to_speech", "helpers.rb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb new file mode 100644 index 000000000000..c6f42a492766 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb @@ -0,0 +1,657 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + module TextToSpeech + ## + # Client for the TextToSpeech service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_stub + + ## + # Configure the TextToSpeech Client class. + # + # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeech clients + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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", "TextToSpeech", "V1beta1"] + 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.timeout = 300.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::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 + @text_to_speech_stub.universe_domain + end + + ## + # Create a new TextToSpeech client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeech 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/texttospeech/v1beta1/cloud_tts_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 + + @text_to_speech_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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, + logger: @config.logger + ) + + @text_to_speech_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_stub.logger + end + + # Service calls + + ## + # Returns a list of Voice supported for synthesis. + # + # @overload list_voices(request, options = nil) + # Pass arguments to `list_voices` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_voices(language_code: nil) + # Pass arguments to `list_voices` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param language_code [::String] + # Optional. Recommended. + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # If not specified, the API will return all supported voices. + # If specified, the ListVoices call will only return voices that can be used + # to synthesize this language_code. For example, if you specify `"en-NZ"`, + # all `"en-NZ"` voices will be returned. If you specify `"no"`, both + # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + # returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new + # + # # Call the list_voices method. + # result = client.list_voices request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. + # p result + # + def list_voices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest + + # Converts hash 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_voices.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::TextToSpeech::V1beta1::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.list_voices.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_voices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.call_rpc :list_voices, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Synthesizes speech synchronously: receive results after all text input + # has been processed. + # + # @overload synthesize_speech(request, options = nil) + # Pass arguments to `synthesize_speech` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, enable_time_pointing: nil, advanced_voice_options: nil) + # Pass arguments to `synthesize_speech` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param enable_time_pointing [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>] + # Whether and what timepoints are returned in the response. + # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions, ::Hash] + # Advanced voice options. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new + # + # # Call the synthesize_speech method. + # result = client.synthesize_speech request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. + # p result + # + def synthesize_speech request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest + + # Converts hash 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.synthesize_speech.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::TextToSpeech::V1beta1::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.synthesize_speech.timeout, + metadata: metadata, + retry_policy: @config.rpcs.synthesize_speech.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.call_rpc :synthesize_speech, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Performs bidirectional streaming speech synthesis: receives audio while + # sending text. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest, ::Hash>] + # An enumerable of {::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_synthesize method to start streaming. + # output = client.streaming_synthesize input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new + # input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_synthesize request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest + end + + # Converts hash 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.streaming_synthesize.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::TextToSpeech::V1beta1::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.streaming_synthesize.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_synthesize.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.call_rpc :streaming_synthesize, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeech API. + # + # This class represents the configuration for TextToSpeech, + # 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::TextToSpeech::V1beta1::TextToSpeech::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_voices to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeech 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_voices` + # @return [::Gapic::Config::Method] + # + attr_reader :list_voices + ## + # RPC-specific configuration for `synthesize_speech` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_speech + ## + # RPC-specific configuration for `streaming_synthesize` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_synthesize + + # @private + def initialize parent_rpcs = nil + list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices + @list_voices = ::Gapic::Config::Method.new list_voices_config + synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech + @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config + streaming_synthesize_config = parent_rpcs.streaming_synthesize if parent_rpcs.respond_to? :streaming_synthesize + @streaming_synthesize = ::Gapic::Config::Method.new streaming_synthesize_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb new file mode 100644 index 000000000000..20cb9a5a0f32 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + module TextToSpeech + # Credentials for the TextToSpeech API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "TEXTTOSPEECH_CREDENTIALS", + "TEXTTOSPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TEXTTOSPEECH_CREDENTIALS_JSON", + "TEXTTOSPEECH_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-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb new file mode 100644 index 000000000000..8d480777bee8 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + module TextToSpeech + # Path helper methods for the TextToSpeech API. + module Paths + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb new file mode 100644 index 000000000000..f01222022b03 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" + +require "google/cloud/text_to_speech/v1beta1/text_to_speech/credentials" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/paths" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new + # + module TextToSpeech + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb new file mode 100644 index 000000000000..75ecc2cb5a4f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb @@ -0,0 +1,530 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + module TextToSpeech + module Rest + ## + # REST client for the TextToSpeech service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_stub + + ## + # Configure the TextToSpeech Client class. + # + # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeech clients + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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", "TextToSpeech", "V1beta1"] + 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.timeout = 300.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::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 + @text_to_speech_stub.universe_domain + end + + ## + # Create a new TextToSpeech REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeech 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 + + @text_to_speech_stub = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @text_to_speech_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_stub.logger + end + + # Service calls + + ## + # Returns a list of Voice supported for synthesis. + # + # @overload list_voices(request, options = nil) + # Pass arguments to `list_voices` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_voices(language_code: nil) + # Pass arguments to `list_voices` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param language_code [::String] + # Optional. Recommended. + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # If not specified, the API will return all supported voices. + # If specified, the ListVoices call will only return voices that can be used + # to synthesize this language_code. For example, if you specify `"en-NZ"`, + # all `"en-NZ"` voices will be returned. If you specify `"no"`, both + # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + # returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new + # + # # Call the list_voices method. + # result = client.list_voices request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. + # p result + # + def list_voices request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest + + # Converts hash 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_voices.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::TextToSpeech::V1beta1::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_voices.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_voices.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.list_voices request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Synthesizes speech synchronously: receive results after all text input + # has been processed. + # + # @overload synthesize_speech(request, options = nil) + # Pass arguments to `synthesize_speech` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, enable_time_pointing: nil, advanced_voice_options: nil) + # Pass arguments to `synthesize_speech` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param enable_time_pointing [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>] + # Whether and what timepoints are returned in the response. + # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions, ::Hash] + # Advanced voice options. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/text_to_speech/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new + # + # # Call the synthesize_speech method. + # result = client.synthesize_speech request + # + # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. + # p result + # + def synthesize_speech request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest + + # Converts hash 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.synthesize_speech.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::TextToSpeech::V1beta1::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.synthesize_speech.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.synthesize_speech.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_stub.synthesize_speech request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeech REST API. + # + # This class represents the configuration for TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::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_voices to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_voices.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeech 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_voices` + # @return [::Gapic::Config::Method] + # + attr_reader :list_voices + ## + # RPC-specific configuration for `synthesize_speech` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_speech + + # @private + def initialize parent_rpcs = nil + list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices + @list_voices = ::Gapic::Config::Method.new list_voices_config + synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech + @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb new file mode 100644 index 000000000000..649d72d8ea28 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb @@ -0,0 +1,200 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + module TextToSpeech + module Rest + ## + # REST service stub for the TextToSpeech service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_voices REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest] + # 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::TextToSpeech::V1beta1::ListVoicesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] + # A result object deserialized from the server's reply + def list_voices request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_voices_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, + method_name: "list_voices", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the synthesize_speech REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest] + # 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::TextToSpeech::V1beta1::SynthesizeSpeechResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] + # A result object deserialized from the server's reply + def synthesize_speech request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_speech_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, + method_name: "synthesize_speech", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_voices REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest] + # 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_voices_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/voices", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the synthesize_speech REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_synthesize_speech_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/text:synthesize", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb new file mode 100644 index 000000000000..9e9b19a683b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" + +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + module TextToSpeechLongAudioSynthesize + end + end + end + end +end + +helper_path = ::File.join __dir__, "text_to_speech_long_audio_synthesize", "helpers.rb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb new file mode 100644 index 000000000000..dd7cf39daa54 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb @@ -0,0 +1,510 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + module TextToSpeechLongAudioSynthesize + ## + # Client for the TextToSpeechLongAudioSynthesize service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_long_audio_synthesize_stub + + ## + # Configure the TextToSpeechLongAudioSynthesize Client class. + # + # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "V1beta1"] + 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.synthesize_long_audio.timeout = 5000.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 + @text_to_speech_long_audio_synthesize_stub.universe_domain + end + + ## + # Create a new TextToSpeechLongAudioSynthesize client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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/texttospeech/v1beta1/cloud_tts_lrs_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 + + @text_to_speech_long_audio_synthesize_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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, + logger: @config.logger + ) + + @text_to_speech_long_audio_synthesize_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_long_audio_synthesize_stub.logger + end + + # Service calls + + ## + # Synthesizes long form text asynchronously. + # + # @overload synthesize_long_audio(request, options = nil) + # Pass arguments to `synthesize_long_audio` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) + # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at + # least one keyword argument is 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] + # The resource states of the request in the form of + # `projects/*/locations/*`. + # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param output_gcs_uri [::String] + # Required. Specifies a Cloud Storage URI for the synthesis results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # + # @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/text_to_speech/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new + # + # # Call the synthesize_long_audio method. + # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest + + # Converts hash 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.synthesize_long_audio.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::TextToSpeech::V1beta1::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.synthesize_long_audio.timeout, + metadata: metadata, + retry_policy: @config.rpcs.synthesize_long_audio.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_long_audio_synthesize_stub.call_rpc :synthesize_long_audio, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeechLongAudioSynthesize API. + # + # This class represents the configuration for TextToSpeechLongAudioSynthesize, + # 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 + # # synthesize_long_audio to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_long_audio + + # @private + def initialize parent_rpcs = nil + synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio + @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb new file mode 100644 index 000000000000..73270e7cae0f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + module TextToSpeechLongAudioSynthesize + # Credentials for the TextToSpeechLongAudioSynthesize API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "TEXTTOSPEECH_CREDENTIALS", + "TEXTTOSPEECH_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TEXTTOSPEECH_CREDENTIALS_JSON", + "TEXTTOSPEECH_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-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb new file mode 100644 index 000000000000..088a5688cb57 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + module TextToSpeechLongAudioSynthesize + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::TextToSpeech::V1beta1::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? + throw :response, 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::TextToSpeech::V1beta1::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? + throw :response, 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::TextToSpeech::V1beta1::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? + 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::TextToSpeech::V1beta1::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? + 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::TextToSpeech::V1beta1::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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb new file mode 100644 index 000000000000..b964dee446f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + module TextToSpeechLongAudioSynthesize + # Path helper methods for the TextToSpeechLongAudioSynthesize API. + module Paths + ## + # Create a fully-qualified Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb new file mode 100644 index 000000000000..8ecb924df3d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" + +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + ## + # Service that implements Google Cloud Text-to-Speech API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + module TextToSpeechLongAudioSynthesize + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb new file mode 100644 index 000000000000..7d208e743c42 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb @@ -0,0 +1,460 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + module TextToSpeechLongAudioSynthesize + module Rest + ## + # REST client for the TextToSpeechLongAudioSynthesize service. + # + # Service that implements Google Cloud Text-to-Speech API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :text_to_speech_long_audio_synthesize_stub + + ## + # Configure the TextToSpeechLongAudioSynthesize Client class. + # + # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "V1beta1"] + 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.synthesize_long_audio.timeout = 5000.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 + @text_to_speech_long_audio_synthesize_stub.universe_domain + end + + ## + # Create a new TextToSpeechLongAudioSynthesize REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 + + @text_to_speech_long_audio_synthesize_stub = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @text_to_speech_long_audio_synthesize_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @text_to_speech_long_audio_synthesize_stub.logger + end + + # Service calls + + ## + # Synthesizes long form text asynchronously. + # + # @overload synthesize_long_audio(request, options = nil) + # Pass arguments to `synthesize_long_audio` via a request object, either of type + # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) + # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at + # least one keyword argument is 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] + # The resource states of the request in the form of + # `projects/*/locations/*`. + # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] + # Required. The Synthesizer requires either plain text or SSML as input. + # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] + # Required. The configuration of the synthesized audio. + # @param output_gcs_uri [::String] + # Required. Specifies a Cloud Storage URI for the synthesis results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] + # Required. The desired voice of the synthesized audio. + # @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/text_to_speech/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new + # + # # Call the synthesize_long_audio method. + # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest + + # Converts hash 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.synthesize_long_audio.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::TextToSpeech::V1beta1::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.synthesize_long_audio.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.synthesize_long_audio.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @text_to_speech_long_audio_synthesize_stub.synthesize_long_audio request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TextToSpeechLongAudioSynthesize REST API. + # + # This class represents the configuration for TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 + # # synthesize_long_audio to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.synthesize_long_audio.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` + # @return [::Gapic::Config::Method] + # + attr_reader :synthesize_long_audio + + # @private + def initialize parent_rpcs = nil + synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio + @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb new file mode 100644 index 000000000000..8250012f372b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb @@ -0,0 +1,925 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + module TextToSpeechLongAudioSynthesize + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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::TextToSpeech::V1beta1::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? + throw :response, 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::TextToSpeech::V1beta1::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? + throw :response, 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::TextToSpeech::V1beta1::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? + 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::TextToSpeech::V1beta1::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? + 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "texttospeech.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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: "/v1beta1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v1beta1/{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{^operations(?:/.*)?$}, true] + ] + ) + 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", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb new file mode 100644 index 000000000000..bd08eb3a2f11 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" + +module Google + module Cloud + module TextToSpeech + module V1beta1 + module TextToSpeechLongAudioSynthesize + module Rest + ## + # REST service stub for the TextToSpeechLongAudioSynthesize service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the synthesize_long_audio REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest] + # 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 synthesize_long_audio request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_long_audio_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, + method_name: "synthesize_long_audio", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the synthesize_long_audio REST call + # + # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_synthesize_long_audio_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta1/{parent}:synthesizeLongAudio", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb new file mode 100644 index 000000000000..e867e4eac333 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb new file mode 100644 index 000000000000..a43e4e7dc031 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/cloud/texttospeech/v1beta1/cloud_tts_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto\x12!google.cloud.texttospeech.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x31google/cloud/texttospeech/v1beta1/cloud_tts.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa8\x02\n\x1aSynthesizeLongAudioRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x45\n\x05input\x18\x02 \x01(\x0b\x32\x31.google.cloud.texttospeech.v1beta1.SynthesisInputB\x03\xe0\x41\x02\x12I\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfigB\x03\xe0\x41\x02\x12\x1b\n\x0eoutput_gcs_uri\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12K\n\x05voice\x18\x05 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\"\x1d\n\x1bSynthesizeLongAudioResponse\"\xa4\x01\n\x1bSynthesizeLongAudioMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01\x12\x1b\n\x13progress_percentage\x18\x03 \x01(\x01\x32\xb3\x03\n\x1fTextToSpeechLongAudioSynthesize\x12\xbe\x02\n\x13SynthesizeLongAudio\x12=.google.cloud.texttospeech.v1beta1.SynthesizeLongAudioRequest\x1a\x1d.google.longrunning.Operation\"\xc8\x01\xca\x41~\n=google.cloud.texttospeech.v1beta1.SynthesizeLongAudioResponse\x12=google.cloud.texttospeech.v1beta1.SynthesizeLongAudioMetadata\x82\xd3\xe4\x93\x02\x41\"\n\rTimepointType\x12\x1e\n\x1aTIMEPOINT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSSML_MARK\x10\x01\x42\x19\n\x17_advanced_voice_options\"\xa7\x03\n\x19\x43ustomPronunciationParams\x12\x13\n\x06phrase\x18\x01 \x01(\tH\x00\x88\x01\x01\x12m\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32M.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1a\n\rpronunciation\x18\x03 \x01(\tH\x02\x88\x01\x01\"\xb6\x01\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12\'\n#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1c\n\x18PHONETIC_ENCODING_PINYIN\x10\x04\x42\t\n\x07_phraseB\x14\n\x12_phonetic_encodingB\x10\n\x0e_pronunciation\"l\n\x14\x43ustomPronunciations\x12T\n\x0epronunciations\x18\x01 \x03(\x0b\x32<.google.cloud.texttospeech.v1beta1.CustomPronunciationParams\"\x95\x01\n\x12MultiSpeakerMarkup\x12N\n\x05turns\x18\x01 \x03(\x0b\x32:.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.TurnB\x03\xe0\x41\x02\x1a/\n\x04Turn\x12\x14\n\x07speaker\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x02\"P\n\x19MultispeakerPrebuiltVoice\x12\x1a\n\rspeaker_alias\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nspeaker_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"{\n\x17MultiSpeakerVoiceConfig\x12`\n\x15speaker_voice_configs\x18\x02 \x03(\x0b\x32<.google.cloud.texttospeech.v1beta1.MultispeakerPrebuiltVoiceB\x03\xe0\x41\x02\"\xa6\x02\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12U\n\x14multi_speaker_markup\x18\x04 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x12[\n\x15\x63ustom_pronunciations\x18\x03 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.CustomPronunciationsB\x03\xe0\x41\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\xa2\x03\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender\x12J\n\x0c\x63ustom_voice\x18\x04 \x01(\x0b\x32\x34.google.cloud.texttospeech.v1beta1.CustomVoiceParams\x12M\n\x0bvoice_clone\x18\x05 \x01(\x0b\x32\x33.google.cloud.texttospeech.v1beta1.VoiceCloneParamsB\x03\xe0\x41\x01\x12\x17\n\nmodel_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x63\n\x1amulti_speaker_voice_config\x18\x07 \x01(\x0b\x32:.google.cloud.texttospeech.v1beta1.MultiSpeakerVoiceConfigB\x03\xe0\x41\x01\"\xf6\x01\n\x0b\x41udioConfig\x12M\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x30.google.cloud.texttospeech.v1beta1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01\"\xf6\x01\n\x11\x43ustomVoiceParams\x12\x32\n\x05model\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\x61\n\x0ereported_usage\x18\x03 \x01(\x0e\x32\x42.google.cloud.texttospeech.v1beta1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xe0\x41\x01\"J\n\rReportedUsage\x12\x1e\n\x1aREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REALTIME\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\"2\n\x10VoiceCloneParams\x12\x1e\n\x11voice_cloning_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xb9\x01\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c\x12@\n\ntimepoints\x18\x02 \x03(\x0b\x32,.google.cloud.texttospeech.v1beta1.Timepoint\x12\x44\n\x0c\x61udio_config\x18\x04 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfig\"4\n\tTimepoint\x12\x11\n\tmark_name\x18\x04 \x01(\t\x12\x14\n\x0ctime_seconds\x18\x03 \x01(\x01\"\xa4\x01\n\x14StreamingAudioConfig\x12M\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x30.google.cloud.texttospeech.v1beta1.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\rspeaking_rate\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\"\xa3\x02\n\x19StreamingSynthesizeConfig\x12K\n\x05voice\x18\x01 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\\\n\x16streaming_audio_config\x18\x04 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.StreamingAudioConfigB\x03\xe0\x41\x01\x12[\n\x15\x63ustom_pronunciations\x18\x05 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.CustomPronunciationsB\x03\xe0\x41\x01\"\xc2\x01\n\x17StreamingSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12U\n\x14multi_speaker_markup\x18\x07 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\xd8\x01\n\x1aStreamingSynthesizeRequest\x12X\n\x10streaming_config\x18\x01 \x01(\x0b\x32<.google.cloud.texttospeech.v1beta1.StreamingSynthesizeConfigH\x00\x12K\n\x05input\x18\x02 \x01(\x0b\x32:.google.cloud.texttospeech.v1beta1.StreamingSynthesisInputH\x00\x42\x13\n\x11streaming_request\"4\n\x1bStreamingSynthesizeResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*\x8c\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0f\n\x0bMP3_64_KBPS\x10\x04\x12\x0c\n\x08OGG_OPUS\x10\x03\x12\t\n\x05MULAW\x10\x05\x12\x08\n\x04\x41LAW\x10\x06\x12\x07\n\x03PCM\x10\x07\x12\x07\n\x03M4A\x10\x08\x32\xef\x04\n\x0cTextToSpeech\x12\xa2\x01\n\nListVoices\x12\x34.google.cloud.texttospeech.v1beta1.ListVoicesRequest\x1a\x35.google.cloud.texttospeech.v1beta1.ListVoicesResponse\"\'\xda\x41\rlanguage_code\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1beta1/voices\x12\xcb\x01\n\x10SynthesizeSpeech\x12:.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest\x1a;.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse\">\xda\x41\x18input,voice,audio_config\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/text:synthesize:\x01*\x12\x9a\x01\n\x13StreamingSynthesize\x12=.google.cloud.texttospeech.v1beta1.StreamingSynthesizeRequest\x1a>.google.cloud.texttospeech.v1beta1.StreamingSynthesizeResponse\"\x00(\x01\x30\x01\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd5\x02\n%com.google.cloud.texttospeech.v1beta1B\x11TextToSpeechProtoP\x01ZIcloud.google.com/go/texttospeech/apiv1beta1/texttospeechpb;texttospeechpb\xa2\x02\x04\x43TTS\xaa\x02!Google.Cloud.TextToSpeech.V1Beta1\xca\x02!Google\\Cloud\\TextToSpeech\\V1beta1\xea\x02$Google::Cloud::TextToSpeech::V1beta1\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}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 = [ + ] + 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 TextToSpeech + module V1beta1 + ListVoicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.ListVoicesRequest").msgclass + ListVoicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.ListVoicesResponse").msgclass + Voice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.Voice").msgclass + AdvancedVoiceOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AdvancedVoiceOptions").msgclass + SynthesizeSpeechRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest").msgclass + SynthesizeSpeechRequest::TimepointType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.TimepointType").enummodule + CustomPronunciationParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomPronunciationParams").msgclass + CustomPronunciationParams::PhoneticEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomPronunciationParams.PhoneticEncoding").enummodule + CustomPronunciations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomPronunciations").msgclass + MultiSpeakerMarkup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup").msgclass + MultiSpeakerMarkup::Turn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn").msgclass + MultispeakerPrebuiltVoice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultispeakerPrebuiltVoice").msgclass + MultiSpeakerVoiceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultiSpeakerVoiceConfig").msgclass + SynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesisInput").msgclass + VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.VoiceSelectionParams").msgclass + AudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AudioConfig").msgclass + CustomVoiceParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomVoiceParams").msgclass + CustomVoiceParams::ReportedUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomVoiceParams.ReportedUsage").enummodule + VoiceCloneParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.VoiceCloneParams").msgclass + SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse").msgclass + Timepoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.Timepoint").msgclass + StreamingAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingAudioConfig").msgclass + StreamingSynthesizeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesizeConfig").msgclass + StreamingSynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesisInput").msgclass + StreamingSynthesizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesizeRequest").msgclass + StreamingSynthesizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesizeResponse").msgclass + SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SsmlVoiceGender").enummodule + AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AudioEncoding").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb new file mode 100644 index 000000000000..cd9155f58667 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/texttospeech/v1beta1/cloud_tts.proto for package 'Google.Cloud.TextToSpeech.V1beta1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/texttospeech/v1beta1/cloud_tts_pb' + +module Google + module Cloud + module TextToSpeech + module V1beta1 + module TextToSpeech + # Service that implements Google Cloud Text-to-Speech API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.texttospeech.v1beta1.TextToSpeech' + + # Returns a list of Voice supported for synthesis. + rpc :ListVoices, ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse + # Synthesizes speech synchronously: receive results after all text input + # has been processed. + rpc :SynthesizeSpeech, ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse + # Performs bidirectional streaming speech synthesis: receives audio while + # sending text. + rpc :StreamingSynthesize, stream(::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest), stream(::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..86ce92848b79 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Text-to-Speech V1beta1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb new file mode 100644 index 000000000000..030e04028192 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb @@ -0,0 +1,618 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + # The top-level message sent by the client for the `ListVoices` method. + # @!attribute [rw] language_code + # @return [::String] + # Optional. Recommended. + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + # If not specified, the API will return all supported voices. + # If specified, the ListVoices call will only return voices that can be used + # to synthesize this language_code. For example, if you specify `"en-NZ"`, + # all `"en-NZ"` voices will be returned. If you specify `"no"`, both + # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be + # returned. + class ListVoicesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message returned to the client by the `ListVoices` method. + # @!attribute [rw] voices + # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::Voice>] + # The list of voices. + class ListVoicesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of a voice supported by the TTS service. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # The languages that this voice supports, expressed as + # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + # "en-US", "es-419", "cmn-tw"). + # @!attribute [rw] name + # @return [::String] + # The name of this voice. Each distinct voice has a unique name. + # @!attribute [rw] ssml_gender + # @return [::Google::Cloud::TextToSpeech::V1beta1::SsmlVoiceGender] + # The gender of this voice. + # @!attribute [rw] natural_sample_rate_hertz + # @return [::Integer] + # The natural sample rate (in hertz) for this voice. + class Voice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Used for advanced voice options. + # @!attribute [rw] low_latency_journey_synthesis + # @return [::Boolean] + # Only for Journey voices. If false, the synthesis is context aware + # and has a higher latency. + # @!attribute [rw] relax_safety_filters + # @return [::Boolean] + # Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only + # supported for accounts linked to Invoiced (Offline) Cloud billing accounts. + # Otherwise, will return result + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + class AdvancedVoiceOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client for the `SynthesizeSpeech` method. + # @!attribute [rw] input + # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput] + # Required. The Synthesizer requires either plain text or SSML as input. + # @!attribute [rw] voice + # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams] + # Required. The desired voice of the synthesized audio. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig] + # Required. The configuration of the synthesized audio. + # @!attribute [rw] enable_time_pointing + # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>] + # Whether and what timepoints are returned in the response. + # @!attribute [rw] advanced_voice_options + # @return [::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions] + # Advanced voice options. + class SynthesizeSpeechRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of timepoint information that is returned in the response. + module TimepointType + # Not specified. No timepoint information will be returned. + TIMEPOINT_TYPE_UNSPECIFIED = 0 + + # Timepoint information of `` tags in SSML input will be returned. + SSML_MARK = 1 + end + end + + # Pronunciation customization for a phrase. + # @!attribute [rw] phrase + # @return [::String] + # The phrase to which the customization is applied. + # The phrase can be multiple words, such as proper nouns, but shouldn't span + # the length of the sentence. + # @!attribute [rw] phonetic_encoding + # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciationParams::PhoneticEncoding] + # The phonetic encoding of the phrase. + # @!attribute [rw] pronunciation + # @return [::String] + # The pronunciation of the phrase. This must be in the phonetic encoding + # specified above. + class CustomPronunciationParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The phonetic encoding of the phrase. + module PhoneticEncoding + # Not specified. + PHONETIC_ENCODING_UNSPECIFIED = 0 + + # IPA, such as apple -> ˈæpəl. + # https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + PHONETIC_ENCODING_IPA = 1 + + # X-SAMPA, such as apple -> "{p@l". + # https://en.wikipedia.org/wiki/X-SAMPA + PHONETIC_ENCODING_X_SAMPA = 2 + + # For reading-to-pron conversion to work well, the `pronunciation` field + # should only contain Kanji, Hiragana, and Katakana. + # + # The pronunciation can also contain pitch accents. + # The start of a pitch phrase is specified with `^` and the down-pitch + # position is specified with `!`, for example: + # + # phrase:端 pronunciation:^はし + # phrase:箸 pronunciation:^は!し + # phrase:橋 pronunciation:^はし! + # + # We currently only support the Tokyo dialect, which allows at most one + # down-pitch per phrase (i.e. at most one `!` between `^`). + PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3 + + # Used to specify pronunciations for Mandarin words. See + # https://en.wikipedia.org/wiki/Pinyin. + # + # For example: 朝阳, the pronunciation is "chao2 yang2". The number + # represents the tone, and there is a space between syllables. Neutral + # tones are represented by 5, for example 孩子 "hai2 zi5". + PHONETIC_ENCODING_PINYIN = 4 + end + end + + # A collection of pronunciation customizations. + # @!attribute [rw] pronunciations + # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciationParams>] + # The pronunciation customizations are applied. + class CustomPronunciations + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of turns for multi-speaker synthesis. + # @!attribute [rw] turns + # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerMarkup::Turn>] + # Required. Speaker turns. + class MultiSpeakerMarkup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A multi-speaker turn. + # @!attribute [rw] speaker + # @return [::String] + # Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer + # to documentation for available speakers. + # @!attribute [rw] text + # @return [::String] + # Required. The text to speak. + class Turn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration for a single speaker in a Gemini TTS multi-speaker setup. + # Enables dialogue between two speakers. + # @!attribute [rw] speaker_alias + # @return [::String] + # Required. The speaker alias of the voice. This is the user-chosen speaker + # name that is used in the multispeaker text input, such as "Speaker1". + # @!attribute [rw] speaker_id + # @return [::String] + # Required. The speaker ID of the voice. See + # https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options + # for available values. + class MultispeakerPrebuiltVoice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a multi-speaker text-to-speech setup. Enables the use of up + # to two distinct voices in a single synthesis request. + # @!attribute [rw] speaker_voice_configs + # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::MultispeakerPrebuiltVoice>] + # Required. A list of configurations for the voices of the speakers. Exactly + # two speaker voice configurations must be provided. + class MultiSpeakerVoiceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains text input to be synthesized. Either `text` or `ssml` must be + # supplied. Supplying both or neither returns + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The + # input size is limited to 5000 bytes. + # @!attribute [rw] text + # @return [::String] + # The raw text to be synthesized. + # + # Note: The following fields are mutually exclusive: `text`, `markup`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] markup + # @return [::String] + # Markup for HD voices specifically. This field may not be used with any + # other voices. + # + # Note: The following fields are mutually exclusive: `markup`, `text`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ssml + # @return [::String] + # The SSML document to be synthesized. The SSML document must be valid + # and well-formed. Otherwise the RPC will fail and return + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For + # more information, see + # [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + # + # Note: The following fields are mutually exclusive: `ssml`, `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] multi_speaker_markup + # @return [::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerMarkup] + # The multi-speaker input to be synthesized. Only applicable for + # multi-speaker synthesis. + # + # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`, `ssml`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] prompt + # @return [::String] + # This system instruction is supported only for controllable/promptable voice + # models. If this system instruction is used, we pass the unedited text to + # Gemini-TTS. Otherwise, a default system instruction is used. AI Studio + # calls this system instruction, Style Instructions. + # @!attribute [rw] custom_pronunciations + # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciations] + # Optional. The pronunciation customizations are applied to the input. If + # this is set, the input is synthesized using the given pronunciation + # customizations. + # + # The initial support is for en-us, with plans to expand to other locales in + # the future. Instant Clone voices aren't supported. + # + # In order to customize the pronunciation of a phrase, there must be an exact + # match of the phrase in the input types. If using SSML, the phrase must not + # be inside a phoneme tag. + class SynthesisInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of which voice to use for a synthesis request. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language (and potentially also the region) of the voice + # expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag, e.g. "en-US". This should not include a script tag (e.g. use + # "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + # from the input provided in the SynthesisInput. The TTS service + # will use this parameter to help choose an appropriate voice. Note that + # the TTS service may choose a voice with a slightly different language code + # than the one selected; it may substitute a different region + # (e.g. using en-US rather than en-CA if there isn't a Canadian voice + # available), or even a different language, e.g. using "nb" (Norwegian + # Bokmal) instead of "no" (Norwegian)". + # @!attribute [rw] name + # @return [::String] + # The name of the voice. If both the name and the gender are not set, + # the service will choose a voice based on the other parameters such as + # language_code. + # @!attribute [rw] ssml_gender + # @return [::Google::Cloud::TextToSpeech::V1beta1::SsmlVoiceGender] + # The preferred gender of the voice. If not set, the service will + # choose a voice based on the other parameters such as language_code and + # name. Note that this is only a preference, not requirement; if a + # voice of the appropriate gender is not available, the synthesizer should + # substitute a voice with a different gender rather than failing the request. + # @!attribute [rw] custom_voice + # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomVoiceParams] + # The configuration for a custom voice. If [CustomVoiceParams.model] is set, + # the service will choose the custom voice matching the specified + # configuration. + # @!attribute [rw] voice_clone + # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceCloneParams] + # Optional. The configuration for a voice clone. If + # [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice + # clone matching the specified configuration. + # @!attribute [rw] model_name + # @return [::String] + # Optional. The name of the model. If set, the service will choose the model + # matching the specified configuration. + # @!attribute [rw] multi_speaker_voice_config + # @return [::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerVoiceConfig] + # Optional. The configuration for a Gemini multi-speaker text-to-speech + # setup. Enables the use of two distinct voices in a single synthesis + # request. + class VoiceSelectionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of audio data to be synthesized. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioEncoding] + # Required. The format of the audio byte stream. + # @!attribute [rw] speaking_rate + # @return [::Float] + # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + # the normal native speed supported by the specific voice. 2.0 is twice as + # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + # speed. Any other values < 0.25 or > 2.0 will return an error. + # @!attribute [rw] pitch + # @return [::Float] + # Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + # increase 20 semitones from the original pitch. -20 means decrease 20 + # semitones from the original pitch. + # @!attribute [rw] volume_gain_db + # @return [::Float] + # Optional. Input only. Volume gain (in dB) of the normal native volume + # supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + # set to a value of 0.0 (dB), will play at normal native signal amplitude. A + # value of -6.0 (dB) will play at approximately half the amplitude of the + # normal native signal amplitude. A value of +6.0 (dB) will play at + # approximately twice the amplitude of the normal native signal amplitude. + # Strongly recommend not to exceed +10 (dB) as there's usually no effective + # increase in loudness for any value greater than that. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Optional. The synthesis sample rate (in hertz) for this audio. When this is + # specified in SynthesizeSpeechRequest, if this is different from the voice's + # natural sample rate, then the synthesizer will honor this request by + # converting to the desired sample rate (which might result in worse audio + # quality), unless the specified sample rate is not supported for the + # encoding chosen, in which case it will fail the request and return + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + # @!attribute [rw] effects_profile_id + # @return [::Array<::String>] + # Optional. Input only. An identifier which selects 'audio effects' profiles + # that are applied on (post synthesized) text to speech. Effects are applied + # on top of each other in the order they are given. See + # [audio + # profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + # current supported profile ids. + class AudioConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of the custom voice to be synthesized. + # @!attribute [rw] model + # @return [::String] + # Required. The name of the AutoML model that synthesizes the custom voice. + # @!attribute [rw] reported_usage + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomVoiceParams::ReportedUsage] + # Optional. Deprecated. The usage of the synthesized audio to be reported. + class CustomVoiceParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Deprecated. The usage of the synthesized audio. Usage does not affect + # billing. + module ReportedUsage + # Request with reported usage unspecified will be rejected. + REPORTED_USAGE_UNSPECIFIED = 0 + + # For scenarios where the synthesized audio is not downloadable and can + # only be used once. For example, real-time request in IVR system. + REALTIME = 1 + + # For scenarios where the synthesized audio is downloadable and can be + # reused. For example, the synthesized audio is downloaded, stored in + # customer service system and played repeatedly. + OFFLINE = 2 + end + end + + # The configuration of Voice Clone feature. + # @!attribute [rw] voice_cloning_key + # @return [::String] + # Required. Created by GenerateVoiceCloningKey. + class VoiceCloneParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message returned to the client by the `SynthesizeSpeech` method. + # @!attribute [rw] audio_content + # @return [::String] + # The audio data bytes encoded as specified in the request, including the + # header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + # For LINEAR16 audio, we include the WAV header. Note: as + # with all bytes fields, protobuffers use a pure binary representation, + # whereas JSON representations use base64. + # @!attribute [rw] timepoints + # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::Timepoint>] + # A link between a position in the original request input and a corresponding + # time in the output audio. It's only supported via `` of SSML input. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig] + # The audio metadata of `audio_content`. + class SynthesizeSpeechResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This contains a mapping between a certain point in the input text and a + # corresponding time in the output audio. + # @!attribute [rw] mark_name + # @return [::String] + # Timepoint name as received from the client within `` tag. + # @!attribute [rw] time_seconds + # @return [::Float] + # Time offset in seconds from the start of the synthesized audio. + class Timepoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of the desired output audio data. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioEncoding] + # Required. The format of the audio byte stream. + # Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings + # return an error. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Optional. The synthesis sample rate (in hertz) for this audio. + # @!attribute [rw] speaking_rate + # @return [::Float] + # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is + # the normal native speed supported by the specific voice. 2.0 is twice as + # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + # speed. Any other values < 0.25 or > 2.0 will return an error. + class StreamingAudioConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides configuration information for the StreamingSynthesize request. + # @!attribute [rw] voice + # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams] + # Required. The desired voice of the synthesized audio. + # @!attribute [rw] streaming_audio_config + # @return [::Google::Cloud::TextToSpeech::V1beta1::StreamingAudioConfig] + # Optional. The configuration of the synthesized audio. + # @!attribute [rw] custom_pronunciations + # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciations] + # Optional. The pronunciation customizations are applied to the input. If + # this is set, the input is synthesized using the given pronunciation + # customizations. + # + # The initial support is for en-us, with plans to expand to other locales in + # the future. Instant Clone voices aren't supported. + # + # In order to customize the pronunciation of a phrase, there must be an exact + # match of the phrase in the input types. If using SSML, the phrase must not + # be inside a phoneme tag. + class StreamingSynthesizeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input to be synthesized. + # @!attribute [rw] text + # @return [::String] + # The raw text to be synthesized. It is recommended that each input + # contains complete, terminating sentences, which results in better prosody + # in the output audio. + # + # Note: The following fields are mutually exclusive: `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] markup + # @return [::String] + # Markup for HD voices specifically. This field may not be used with any + # other voices. + # + # Note: The following fields are mutually exclusive: `markup`, `text`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] multi_speaker_markup + # @return [::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerMarkup] + # Multi-speaker markup for Gemini TTS. This field may not + # be used with any other voices. + # + # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] prompt + # @return [::String] + # This is system instruction supported only for controllable voice models. + class StreamingSynthesisInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `StreamingSynthesize` method. Multiple + # `StreamingSynthesizeRequest` messages are sent in one call. + # The first message must contain a `streaming_config` that + # fully specifies the request configuration and must not contain `input`. All + # subsequent messages must only have `input` set. + # @!attribute [rw] streaming_config + # @return [::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeConfig] + # StreamingSynthesizeConfig to be used in this streaming attempt. Only + # specified in the first message sent in a `StreamingSynthesize` call. + # + # Note: The following fields are mutually exclusive: `streaming_config`, `input`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] input + # @return [::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesisInput] + # Input to synthesize. Specified in all messages but the first in a + # `StreamingSynthesize` call. + # + # Note: The following fields are mutually exclusive: `input`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class StreamingSynthesizeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `StreamingSynthesizeResponse` is the only message returned to the + # client by `StreamingSynthesize` method. A series of zero or more + # `StreamingSynthesizeResponse` messages are streamed back to the client. + # @!attribute [rw] audio_content + # @return [::String] + # The audio data bytes encoded as specified in the request. This is + # headerless LINEAR16 audio with a sample rate of 24000. + class StreamingSynthesizeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Gender of the voice as described in + # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). + module SsmlVoiceGender + # An unspecified gender. + # In VoiceSelectionParams, this means that the client doesn't care which + # gender the selected voice will have. In the Voice field of + # ListVoicesResponse, this may mean that the voice doesn't fit any of the + # other categories in this enum, or that the gender of the voice isn't known. + SSML_VOICE_GENDER_UNSPECIFIED = 0 + + # A male voice. + MALE = 1 + + # A female voice. + FEMALE = 2 + + # A gender-neutral voice. This voice is not yet supported. + NEUTRAL = 3 + end + + # Configuration to set up audio encoder. The encoding determines the output + # audio format that we'd like. + module AudioEncoding + # Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return + # result + # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. + AUDIO_ENCODING_UNSPECIFIED = 0 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + # Audio content returned as LINEAR16 also contains a WAV header. + LINEAR16 = 1 + + # MP3 audio at 32kbps. + MP3 = 2 + + # MP3 at 64kbps. + MP3_64_KBPS = 4 + + # Opus encoded audio wrapped in an ogg container. The result is a + # file which can be played natively on Android, and in browsers (at least + # Chrome and Firefox). The quality of the encoding is considerably higher + # than MP3 while using approximately the same bitrate. + OGG_OPUS = 3 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + # Audio content returned as MULAW also contains a WAV header. + MULAW = 5 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + # Audio content returned as ALAW also contains a WAV header. + ALAW = 6 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + # Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or + # any other) header. + PCM = 7 + + # M4A audio. + M4A = 8 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb new file mode 100644 index 000000000000..c155bf275945 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + module V1beta1 + # The top-level message sent by the client for the + # `SynthesizeLongAudio` method. + # @!attribute [rw] parent + # @return [::String] + # The resource states of the request in the form of + # `projects/*/locations/*`. + # @!attribute [rw] input + # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput] + # Required. The Synthesizer requires either plain text or SSML as input. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig] + # Required. The configuration of the synthesized audio. + # @!attribute [rw] output_gcs_uri + # @return [::String] + # Required. Specifies a Cloud Storage URI for the synthesis results. Must be + # specified in the format: `gs://bucket_name/object_name`, and the bucket + # must already exist. + # @!attribute [rw] voice + # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams] + # Required. The desired voice of the synthesized audio. + class SynthesizeLongAudioRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message returned to the client by the `SynthesizeLongAudio` method. + class SynthesizeLongAudioResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for response returned by the `SynthesizeLongAudio` method. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Time when the request was received. + # @!attribute [rw] last_update_time + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::Timestamp] + # Deprecated. Do not use. + # @!attribute [rw] progress_percentage + # @return [::Float] + # The progress of the most recent processing update in percentage, ie. 70.0%. + class SynthesizeLongAudioMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..d5f0f822f878 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1", path: "../" +else + gem "google-cloud-text_to_speech-v1beta1" +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-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json new file mode 100644 index 000000000000..37611738d746 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json @@ -0,0 +1,175 @@ +{ + "client_library": { + "name": "google-cloud-text_to_speech-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.texttospeech.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync", + "title": "Snippet for the list_voices call in the TextToSpeech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices.", + "file": "text_to_speech/list_voices.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_voices", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse", + "client": { + "short_name": "TextToSpeech::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client" + }, + "method": { + "short_name": "ListVoices", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech.ListVoices", + "service": { + "short_name": "TextToSpeech", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync", + "title": "Snippet for the synthesize_speech call in the TextToSpeech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#synthesize_speech.", + "file": "text_to_speech/synthesize_speech.rb", + "language": "RUBY", + "client_method": { + "short_name": "synthesize_speech", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#synthesize_speech", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse", + "client": { + "short_name": "TextToSpeech::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client" + }, + "method": { + "short_name": "SynthesizeSpeech", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech.SynthesizeSpeech", + "service": { + "short_name": "TextToSpeech", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "texttospeech_v1beta1_generated_TextToSpeech_StreamingSynthesize_sync", + "title": "Snippet for the streaming_synthesize call in the TextToSpeech service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#streaming_synthesize.", + "file": "text_to_speech/streaming_synthesize.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_synthesize", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#streaming_synthesize", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse", + "client": { + "short_name": "TextToSpeech::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client" + }, + "method": { + "short_name": "StreamingSynthesize", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech.StreamingSynthesize", + "service": { + "short_name": "TextToSpeech", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync", + "title": "Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio.", + "file": "text_to_speech_long_audio_synthesize/synthesize_long_audio.rb", + "language": "RUBY", + "client_method": { + "short_name": "synthesize_long_audio", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TextToSpeechLongAudioSynthesize::Client", + "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client" + }, + "method": { + "short_name": "SynthesizeLongAudio", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeechLongAudioSynthesize.SynthesizeLongAudio", + "service": { + "short_name": "TextToSpeechLongAudioSynthesize", + "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeechLongAudioSynthesize" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb new file mode 100644 index 000000000000..72a6f7d574e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync] +require "google/cloud/text_to_speech/v1beta1" + +## +# Snippet for the list_voices call in the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices. +# +def list_voices + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new + + # Call the list_voices method. + result = client.list_voices request + + # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. + p result +end +# [END texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb new file mode 100644 index 000000000000..69970b81486e --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeech_StreamingSynthesize_sync] +require "google/cloud/text_to_speech/v1beta1" + +## +# Snippet for the streaming_synthesize call in the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::Client#streaming_synthesize. +# +def streaming_synthesize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_synthesize method to start streaming. + output = client.streaming_synthesize input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new + input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse + output.each do |current_response| + p current_response + end +end +# [END texttospeech_v1beta1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb new file mode 100644 index 000000000000..9ec83074902f --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync] +require "google/cloud/text_to_speech/v1beta1" + +## +# Snippet for the synthesize_speech call in the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::Client#synthesize_speech. +# +def synthesize_speech + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new + + # Call the synthesize_speech method. + result = client.synthesize_speech request + + # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. + p result +end +# [END texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb new file mode 100644 index 000000000000..ea7685188b99 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] +require "google/cloud/text_to_speech/v1beta1" + +## +# Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio. +# +def synthesize_long_audio + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new + + # Call the synthesize_long_audio method. + result = client.synthesize_long_audio 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 texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb new file mode 100644 index 000000000000..9f679ded2226 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" +require "google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" + +class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb new file mode 100644 index 000000000000..434f49ebc8f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" + +class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.model_path project: "value0", location: "value1", model: "value2" + assert_equal "projects/value0/locations/value1/models/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb new file mode 100644 index 000000000000..8cc355c8b862 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" + + +class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_synthesize_long_audio + # 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" + input = {} + audio_config = {} + output_gcs_uri = "hello world" + voice = {} + + synthesize_long_audio_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.stub :transcode_synthesize_long_audio_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, synthesize_long_audio_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, synthesize_long_audio_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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb new file mode 100644 index 000000000000..5671468e58a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb @@ -0,0 +1,189 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" + +class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_synthesize_long_audio + # 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" + input = {} + audio_config = {} + output_gcs_uri = "hello world" + voice = {} + + synthesize_long_audio_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :synthesize_long_audio, name + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput), request["input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::AudioConfig), request["audio_config"] + assert_equal "hello world", request["output_gcs_uri"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams), request["voice"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, synthesize_long_audio_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) 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.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice 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.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) 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.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, 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.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), 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, synthesize_long_audio_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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client, client + assert_equal creds, client.configure.credentials + end + 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb new file mode 100644 index 000000000000..0dd55bde46da --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech" + +class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.model_path project: "value0", location: "value1", model: "value2" + assert_equal "projects/value0/locations/value1/models/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb new file mode 100644 index 000000000000..acb908987e5e --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" + + +class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_voices + # Create test objects. + client_result = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + language_code = "hello world" + + list_voices_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TextToSpeech::V1beta1::TextToSpeech::Rest::ServiceStub.stub :transcode_list_voices_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_voices_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_voices({ language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_voices language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_voices ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_voices({ language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_voices(::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_voices_client_stub.call_count + end + end + end + + def test_synthesize_speech + # Create test objects. + client_result = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + input = {} + voice = {} + audio_config = {} + enable_time_pointing = [:TIMEPOINT_TYPE_UNSPECIFIED] + advanced_voice_options = {} + + synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::TextToSpeech::V1beta1::TextToSpeech::Rest::ServiceStub.stub :transcode_synthesize_speech_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, synthesize_speech_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.synthesize_speech input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.synthesize_speech ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.synthesize_speech(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, synthesize_speech_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::TextToSpeech::V1beta1::TextToSpeech::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::TextToSpeech::V1beta1::TextToSpeech::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb new file mode 100644 index 000000000000..b789760fe045 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" +require "google/cloud/text_to_speech/v1beta1/text_to_speech" + +class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_voices + # Create GRPC objects. + grpc_response = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.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. + language_code = "hello world" + + list_voices_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_voices, name + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, request + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_voices_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_voices({ language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_voices language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_voices ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_voices({ language_code: language_code }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_voices(::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_voices_client_stub.call_rpc_count + end + end + + def test_synthesize_speech + # Create GRPC objects. + grpc_response = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.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. + input = {} + voice = {} + audio_config = {} + enable_time_pointing = [:TIMEPOINT_TYPE_UNSPECIFIED] + advanced_voice_options = {} + + synthesize_speech_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :synthesize_speech, name + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput), request["input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams), request["voice"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::AudioConfig), request["audio_config"] + assert_equal [:TIMEPOINT_TYPE_UNSPECIFIED], request["enable_time_pointing"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions), request["advanced_voice_options"] + assert request.has_advanced_voice_options? + refute_nil options + end + + Gapic::ServiceStub.stub :new, synthesize_speech_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.synthesize_speech input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.synthesize_speech ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.synthesize_speech(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, synthesize_speech_client_stub.call_rpc_count + end + end + + def test_streaming_synthesize + # Create GRPC objects. + grpc_response = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse.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 bidi streaming method. + streaming_config = {} + + streaming_synthesize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_synthesize, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_synthesize_client_stub do + # Create client + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_synthesize enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_synthesize stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config + enum_input = [request_hash, request_proto].to_enum + client.streaming_synthesize enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { streaming_config: streaming_config } + request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config + stream_input = Gapic::StreamInput.new + client.streaming_synthesize stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_synthesize_client_stub.call_rpc_count + streaming_synthesize_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeConfig), r["streaming_config"] + assert_equal :streaming_config, r.streaming_request + end + end + 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::TextToSpeech::V1beta1::TextToSpeech::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::TextToSpeech::V1beta1::TextToSpeech::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-text_to_speech/.gitignore b/owl-bot-staging/google-cloud-text_to_speech/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/.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-text_to_speech/.repo-metadata.json b/owl-bot-staging/google-cloud-text_to_speech/.repo-metadata.json new file mode 100644 index 000000000000..abbe64afe0b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "texttospeech.googleapis.com", + "api_shortname": "texttospeech", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech/latest", + "distribution_name": "google-cloud-text_to_speech", + "is_cloud": true, + "language": "ruby", + "name": "texttospeech", + "name_pretty": "Cloud Text-to-Speech API", + "product_documentation": "https://cloud.google.com/text-to-speech", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech.", + "ruby-cloud-env-prefix": "TEXTTOSPEECH", + "ruby-cloud-product-url": "https://cloud.google.com/text-to-speech", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml b/owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml new file mode 100644 index 000000000000..cafff93bab73 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-text_to_speech.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-text_to_speech.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-text_to_speech/.toys.rb b/owl-bot-staging/google-cloud-text_to_speech/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech/.yardopts b/owl-bot-staging/google-cloud-text_to_speech/.yardopts new file mode 100644 index 000000000000..242e929248cf --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Cloud Text-to-Speech API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md b/owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md new file mode 100644 index 000000000000..3ad04e2be21e --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-text_to_speech 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-text_to_speech 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/text_to_speech" + +client = Google::Cloud::TextToSpeech.text_to_speech do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/text_to_speech" + +Google::Cloud::TextToSpeech.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::TextToSpeech.text_to_speech +``` + +### 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-text_to_speech +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/text_to_speech" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::TextToSpeech.text_to_speech +``` + +### 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-text_to_speech/CHANGELOG.md b/owl-bot-staging/google-cloud-text_to_speech/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-text_to_speech/Gemfile b/owl-bot-staging/google-cloud-text_to_speech/Gemfile new file mode 100644 index 000000000000..a053f1c8c52b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-text_to_speech-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-text_to_speech.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.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-text_to_speech/LICENSE.md b/owl-bot-staging/google-cloud-text_to_speech/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/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-text_to_speech/README.md b/owl-bot-staging/google-cloud-text_to_speech/README.md new file mode 100644 index 000000000000..0ccf0430d37c --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Cloud Text-to-Speech API + +API Client library for the Cloud Text-to-Speech API + +Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-text_to_speech-v*`. +The gem `google-cloud-text_to_speech` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech/latest) +for this library, google-cloud-text_to_speech, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-text_to_speech-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/text-to-speech) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-text_to_speech +``` + +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/texttospeech.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/text_to_speech" + +client = Google::Cloud::TextToSpeech.text_to_speech +request = ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new # (request fields as keyword arguments...) +response = client.list_voices request +``` + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-text_to_speech-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +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-text_to_speech`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-text_to_speech-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-text_to_speech`. +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-text_to_speech-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-text_to_speech/Rakefile b/owl-bot-staging/google-cloud-text_to_speech/Rakefile new file mode 100644 index 000000000000..a2f1fe8dede2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true +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-text_to_speech acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TEXTTOSPEECH_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TEXTTOSPEECH_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TEXTTOSPEECH_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 TEXTTOSPEECH_TEST_PROJECT=test123 TEXTTOSPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/text_to_speech/v1/text_to_speech/credentials" + ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TEXTTOSPEECH_PROJECT"] = project + ENV["TEXTTOSPEECH_TEST_PROJECT"] = project + ENV["TEXTTOSPEECH_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-text_to_speech 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-text_to_speech 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-text_to_speech 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-text_to_speech gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-text_to_speech" + header "google-cloud-text_to_speech rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-text_to_speech yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-text_to_speech 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-text_to_speech 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-text_to_speech 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-text_to_speech/google-cloud-text_to_speech.gemspec b/owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec new file mode 100644 index 000000000000..963a39356e3c --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/text_to_speech/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-text_to_speech" + gem.version = Google::Cloud::TextToSpeech::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech." + gem.summary = "API Client library for the Cloud Text-to-Speech API" + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-text_to_speech-v1", "~> 1.7" +end diff --git a/owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb new file mode 100644 index 000000000000..c281c6815fb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech" unless defined? Google::Cloud::TextToSpeech::VERSION diff --git a/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb new file mode 100644 index 000000000000..bd6292b6eb1d --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb @@ -0,0 +1,226 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/text_to_speech/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :text_to_speech do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module TextToSpeech + ## + # Create a new client object for TextToSpeech. + # + # By default, this returns an instance of + # [Google::Cloud::TextToSpeech::V1::TextToSpeech::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest/Google-Cloud-TextToSpeech-V1-TextToSpeech-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TextToSpeech service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TextToSpeech service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::TextToSpeech.text_to_speech_available?}. + # + # ## About TextToSpeech + # + # Service that implements Google Cloud Text-to-Speech API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.text_to_speech version: :v1, transport: :grpc, &block + require "google/cloud/text_to_speech/#{version.to_s.downcase}" + + package_name = Google::Cloud::TextToSpeech + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::TextToSpeech.const_get(package_name).const_get(:TextToSpeech) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TextToSpeech service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::TextToSpeech.text_to_speech}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TextToSpeech service, + # or if the versioned client gem needs an update to support the TextToSpeech service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.text_to_speech_available? version: :v1, transport: :grpc + require "google/cloud/text_to_speech/#{version.to_s.downcase}" + package_name = Google::Cloud::TextToSpeech + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::TextToSpeech.const_get package_name + return false unless service_module.const_defined? :TextToSpeech + service_module = service_module.const_get :TextToSpeech + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Create a new client object for TextToSpeechLongAudioSynthesize. + # + # By default, this returns an instance of + # [Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest/Google-Cloud-TextToSpeech-V1-TextToSpeechLongAudioSynthesize-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TextToSpeechLongAudioSynthesize service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TextToSpeechLongAudioSynthesize service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize_available?}. + # + # ## About TextToSpeechLongAudioSynthesize + # + # Service that implements Google Cloud Text-to-Speech API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.text_to_speech_long_audio_synthesize version: :v1, transport: :grpc, &block + require "google/cloud/text_to_speech/#{version.to_s.downcase}" + + package_name = Google::Cloud::TextToSpeech + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::TextToSpeech.const_get(package_name).const_get(:TextToSpeechLongAudioSynthesize) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TextToSpeechLongAudioSynthesize service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TextToSpeechLongAudioSynthesize service, + # or if the versioned client gem needs an update to support the TextToSpeechLongAudioSynthesize service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.text_to_speech_long_audio_synthesize_available? version: :v1, transport: :grpc + require "google/cloud/text_to_speech/#{version.to_s.downcase}" + package_name = Google::Cloud::TextToSpeech + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::TextToSpeech.const_get package_name + return false unless service_module.const_defined? :TextToSpeechLongAudioSynthesize + service_module = service_module.const_get :TextToSpeechLongAudioSynthesize + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-text_to_speech library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.text_to_speech if block_given? + + ::Google::Cloud.configure.text_to_speech + end + end + end +end + +helper_path = ::File.join __dir__, "text_to_speech", "helpers.rb" +require "google/cloud/text_to_speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb b/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb new file mode 100644 index 000000000000..06eb4f49462b --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb b/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb new file mode 100644 index 000000000000..4306c2398264 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/text_to_speech" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::TextToSpeech::ClientConstructionMinitest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_text_to_speech_grpc + skip unless Google::Cloud::TextToSpeech.text_to_speech_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::TextToSpeech.text_to_speech transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client, client + end + end + + def test_text_to_speech_rest + skip unless Google::Cloud::TextToSpeech.text_to_speech_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::TextToSpeech.text_to_speech transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client, client + end + end + + def test_text_to_speech_long_audio_synthesize_grpc + skip unless Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client, client + end + end + + def test_text_to_speech_long_audio_synthesize_rest + skip unless Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb b/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb new file mode 100644 index 000000000000..12c50a24d6d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/text_to_speech/version" + +class Google::Cloud::TextToSpeech::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::TextToSpeech::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb b/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tpu-v1/.gitignore b/owl-bot-staging/google-cloud-tpu-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-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-tpu-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-tpu-v1/.repo-metadata.json new file mode 100644 index 000000000000..382bdf22eb6e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "tpu.googleapis.com", + "api_shortname": "tpu", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest", + "distribution_name": "google-cloud-tpu-v1", + "is_cloud": true, + "language": "ruby", + "name": "tpu", + "name_pretty": "Cloud TPU V1 API", + "product_documentation": "https://cloud.google.com/tpu/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform. Note that google-cloud-tpu-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tpu instead. See the readme for more details.", + "ruby-cloud-env-prefix": "CLOUD_TPU", + "ruby-cloud-product-url": "https://cloud.google.com/tpu/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml b/owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml new file mode 100644 index 000000000000..0db23e57cdbd --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-tpu-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-tpu-v1.rb" diff --git a/owl-bot-staging/google-cloud-tpu-v1/.toys.rb b/owl-bot-staging/google-cloud-tpu-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/.yardopts b/owl-bot-staging/google-cloud-tpu-v1/.yardopts new file mode 100644 index 000000000000..f2c8ec30b07e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud TPU 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-tpu-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tpu-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..dcd3772bc00e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-tpu-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-tpu-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/tpu/v1" + +client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/tpu/v1" + +::Google::Cloud::Tpu::V1::Tpu::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Tpu::V1::Tpu::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-tpu-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/tpu/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Tpu::V1::Tpu::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-tpu-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-tpu-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-tpu-v1/Gemfile b/owl-bot-staging/google-cloud-tpu-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-tpu-v1/LICENSE.md b/owl-bot-staging/google-cloud-tpu-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-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-tpu-v1/README.md b/owl-bot-staging/google-cloud-tpu-v1/README.md new file mode 100644 index 000000000000..8e5f3796c7e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud TPU V1 API + +TPU API provides customers with access to Google TPU technology. + +Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI 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 TPU V1 API. Most users should consider using +the main client gem, +[google-cloud-tpu](https://rubygems.org/gems/google-cloud-tpu). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-tpu-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/tpu.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/tpu/v1" + +client = ::Google::Cloud::Tpu::V1::Tpu::Client.new +request = ::Google::Cloud::Tpu::V1::ListNodesRequest.new # (request fields as keyword arguments...) +response = client.list_nodes request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/tpu/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/tpu/v1" +require "logger" + +client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-tpu`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-tpu-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-tpu`. +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-tpu-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-tpu-v1/Rakefile b/owl-bot-staging/google-cloud-tpu-v1/Rakefile new file mode 100644 index 000000000000..6973baaa474a --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["CLOUD_TPU_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["CLOUD_TPU_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["CLOUD_TPU_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 CLOUD_TPU_TEST_PROJECT=test123 CLOUD_TPU_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/tpu/v1/tpu/credentials" + ::Google::Cloud::Tpu::V1::Tpu::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["CLOUD_TPU_PROJECT"] = project + ENV["CLOUD_TPU_TEST_PROJECT"] = project + ENV["CLOUD_TPU_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-tpu-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-tpu-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-tpu-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-tpu-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-tpu-v1" + header "google-cloud-tpu-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-tpu-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-tpu-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-tpu-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-tpu-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-tpu-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-tpu-v1/gapic_metadata.json new file mode 100644 index 000000000000..d3485f86c0f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.tpu.v1", + "libraryPackage": "::Google::Cloud::Tpu::V1", + "services": { + "Tpu": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Tpu::V1::Tpu::Client", + "rpcs": { + "ListNodes": { + "methods": [ + "list_nodes" + ] + }, + "GetNode": { + "methods": [ + "get_node" + ] + }, + "CreateNode": { + "methods": [ + "create_node" + ] + }, + "DeleteNode": { + "methods": [ + "delete_node" + ] + }, + "ReimageNode": { + "methods": [ + "reimage_node" + ] + }, + "StopNode": { + "methods": [ + "stop_node" + ] + }, + "StartNode": { + "methods": [ + "start_node" + ] + }, + "ListTensorFlowVersions": { + "methods": [ + "list_tensor_flow_versions" + ] + }, + "GetTensorFlowVersion": { + "methods": [ + "get_tensor_flow_version" + ] + }, + "ListAcceleratorTypes": { + "methods": [ + "list_accelerator_types" + ] + }, + "GetAcceleratorType": { + "methods": [ + "get_accelerator_type" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec b/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec new file mode 100644 index 000000000000..0e02f2aa9292 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/tpu/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-tpu-v1" + gem.version = Google::Cloud::Tpu::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform. Note that google-cloud-tpu-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tpu instead. See the readme for more details." + gem.summary = "TPU API provides customers with access to Google TPU technology." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb new file mode 100644 index 000000000000..feffd3cd43da --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1" diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb new file mode 100644 index 000000000000..04462f2cc2c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/tpu" +require "google/cloud/tpu/v1/version" + +module Google + module Cloud + module Tpu + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/tpu/v1" + # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/tpu/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb new file mode 100644 index 000000000000..005205cdd0ac --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/tpu/v1/cloud_tpu.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/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n#google/cloud/tpu/v1/cloud_tpu.proto\x12\x13google.cloud.tpu.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"9\n\x10SchedulingConfig\x12\x13\n\x0bpreemptible\x18\x01 \x01(\x08\x12\x10\n\x08reserved\x18\x02 \x01(\x08\"3\n\x0fNetworkEndpoint\x12\x12\n\nip_address\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\x05\"\xc1\n\n\x04Node\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x10\x61\x63\x63\x65lerator_type\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\nip_address\x18\x08 \x01(\tB\x02\x18\x01\x12\x10\n\x04port\x18\x0e \x01(\tB\x02\x18\x01\x12\x33\n\x05state\x18\t \x01(\x0e\x32\x1f.google.cloud.tpu.v1.Node.StateB\x03\xe0\x41\x03\x12\x1f\n\x12health_description\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12tensorflow_version\x18\x0b \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07network\x18\x0c \x01(\t\x12\x12\n\ncidr_block\x18\r \x01(\t\x12\x1c\n\x0fservice_account\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x11scheduling_config\x18\x11 \x01(\x0b\x32%.google.cloud.tpu.v1.SchedulingConfig\x12\x44\n\x11network_endpoints\x18\x15 \x03(\x0b\x32$.google.cloud.tpu.v1.NetworkEndpointB\x03\xe0\x41\x03\x12\x30\n\x06health\x18\x16 \x01(\x0e\x32 .google.cloud.tpu.v1.Node.Health\x12\x35\n\x06labels\x18\x18 \x03(\x0b\x32%.google.cloud.tpu.v1.Node.LabelsEntry\x12\x1e\n\x16use_service_networking\x18\x1b \x01(\x08\x12>\n\x0b\x61pi_version\x18& \x01(\x0e\x32$.google.cloud.tpu.v1.Node.ApiVersionB\x03\xe0\x41\x03\x12\x33\n\x08symptoms\x18\' \x03(\x0b\x32\x1c.google.cloud.tpu.v1.SymptomB\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\"\xee\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0e\n\nRESTARTING\x10\x03\x12\r\n\tREIMAGING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05\x12\r\n\tREPAIRING\x10\x06\x12\x0b\n\x07STOPPED\x10\x08\x12\x0c\n\x08STOPPING\x10\t\x12\x0c\n\x08STARTING\x10\n\x12\r\n\tPREEMPTED\x10\x0b\x12\x0e\n\nTERMINATED\x10\x0c\x12\n\n\x06HIDING\x10\r\x12\n\n\x06HIDDEN\x10\x0e\x12\x0c\n\x08UNHIDING\x10\x0f\x12\x0b\n\x07UNKNOWN\x10\x10\"\x89\x01\n\x06Health\x12\x16\n\x12HEALTH_UNSPECIFIED\x10\x00\x12\x0b\n\x07HEALTHY\x10\x01\x12\x18\n\x14\x44\x45PRECATED_UNHEALTHY\x10\x02\x12\x0b\n\x07TIMEOUT\x10\x03\x12\x18\n\x14UNHEALTHY_TENSORFLOW\x10\x04\x12\x19\n\x15UNHEALTHY_MAINTENANCE\x10\x05\"O\n\nApiVersion\x12\x1b\n\x17\x41PI_VERSION_UNSPECIFIED\x10\x00\x12\r\n\tV1_ALPHA1\x10\x01\x12\x06\n\x02V1\x10\x02\x12\r\n\tV2_ALPHA1\x10\x03:R\xea\x41O\n\x17tpu.googleapis.com/Node\x12\x34projects/{project}/locations/{location}/nodes/{node}\"j\n\x10ListNodesRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17tpu.googleapis.com/Node\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"k\n\x11ListNodesResponse\x12(\n\x05nodes\x18\x01 \x03(\x0b\x32\x19.google.cloud.tpu.v1.Node\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"?\n\x0eGetNodeRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17tpu.googleapis.com/Node\"\x83\x01\n\x11\x43reateNodeRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17tpu.googleapis.com/Node\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12,\n\x04node\x18\x03 \x01(\x0b\x32\x19.google.cloud.tpu.v1.NodeB\x03\xe0\x41\x02\"B\n\x11\x44\x65leteNodeRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17tpu.googleapis.com/Node\">\n\x12ReimageNodeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1a\n\x12tensorflow_version\x18\x02 \x01(\t\"\x1f\n\x0fStopNodeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\" \n\x10StartNodeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\xaf\x01\n\x11TensorFlowVersion\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t:{\xea\x41x\n$tpu.googleapis.com/TensorFlowVersion\x12Pprojects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}\"Y\n\x1bGetTensorFlowVersionRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$tpu.googleapis.com/TensorFlowVersion\"\xa6\x01\n\x1dListTensorFlowVersionsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$tpu.googleapis.com/TensorFlowVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x10\n\x08order_by\x18\x06 \x01(\t\"\x93\x01\n\x1eListTensorFlowVersionsResponse\x12\x43\n\x13tensorflow_versions\x18\x01 \x03(\x0b\x32&.google.cloud.tpu.v1.TensorFlowVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xa3\x01\n\x0f\x41\x63\x63\x65leratorType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t:t\xea\x41q\n\"tpu.googleapis.com/AcceleratorType\x12Kprojects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}\"U\n\x19GetAcceleratorTypeRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"tpu.googleapis.com/AcceleratorType\"\xa2\x01\n\x1bListAcceleratorTypesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"tpu.googleapis.com/AcceleratorType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x10\n\x08order_by\x18\x06 \x01(\t\"\x8d\x01\n\x1cListAcceleratorTypesResponse\x12?\n\x11\x61\x63\x63\x65lerator_types\x18\x01 \x03(\x0b\x32$.google.cloud.tpu.v1.AcceleratorType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xd6\x01\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06target\x18\x03 \x01(\t\x12\x0c\n\x04verb\x18\x04 \x01(\t\x12\x15\n\rstatus_detail\x18\x05 \x01(\t\x12\x18\n\x10\x63\x61ncel_requested\x18\x06 \x01(\x08\x12\x13\n\x0b\x61pi_version\x18\x07 \x01(\t\"\xc5\x02\n\x07Symptom\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12>\n\x0csymptom_type\x18\x02 \x01(\x0e\x32(.google.cloud.tpu.v1.Symptom.SymptomType\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\x12\x11\n\tworker_id\x18\x04 \x01(\t\"\xa4\x01\n\x0bSymptomType\x12\x1c\n\x18SYMPTOM_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nLOW_MEMORY\x10\x01\x12\x11\n\rOUT_OF_MEMORY\x10\x02\x12\x15\n\x11\x45XECUTE_TIMED_OUT\x10\x03\x12\x13\n\x0fMESH_BUILD_FAIL\x10\x04\x12\x15\n\x11HBM_OUT_OF_MEMORY\x10\x05\x12\x11\n\rPROJECT_ABUSE\x10\x06\x32\xde\x0f\n\x03Tpu\x12\x96\x01\n\tListNodes\x12%.google.cloud.tpu.v1.ListNodesRequest\x1a&.google.cloud.tpu.v1.ListNodesResponse\":\xda\x41\x06parent\x82\xd3\xe4\x93\x02+\x12)/v1/{parent=projects/*/locations/*}/nodes\x12\x83\x01\n\x07GetNode\x12#.google.cloud.tpu.v1.GetNodeRequest\x1a\x19.google.cloud.tpu.v1.Node\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/nodes/*}\x12\xbe\x01\n\nCreateNode\x12&.google.cloud.tpu.v1.CreateNodeRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\xda\x41\x13parent,node,node_id\x82\xd3\xe4\x93\x02\x31\")/v1/{parent=projects/*/locations/*}/nodes:\x04node\x12\xa9\x01\n\nDeleteNode\x12&.google.cloud.tpu.v1.DeleteNodeRequest\x1a\x1d.google.longrunning.Operation\"T\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02+*)/v1/{name=projects/*/locations/*/nodes/*}\x12\xaf\x01\n\x0bReimageNode\x12\'.google.cloud.tpu.v1.ReimageNodeRequest\x1a\x1d.google.longrunning.Operation\"X\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/nodes/*}:reimage:\x01*\x12\xa6\x01\n\x08StopNode\x12$.google.cloud.tpu.v1.StopNodeRequest\x1a\x1d.google.longrunning.Operation\"U\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/nodes/*}:stop:\x01*\x12\xa9\x01\n\tStartNode\x12%.google.cloud.tpu.v1.StartNodeRequest\x1a\x1d.google.longrunning.Operation\"V\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/nodes/*}:start:\x01*\x12\xca\x01\n\x16ListTensorFlowVersions\x12\x32.google.cloud.tpu.v1.ListTensorFlowVersionsRequest\x1a\x33.google.cloud.tpu.v1.ListTensorFlowVersionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*}/tensorflowVersions\x12\xb7\x01\n\x14GetTensorFlowVersion\x12\x30.google.cloud.tpu.v1.GetTensorFlowVersionRequest\x1a&.google.cloud.tpu.v1.TensorFlowVersion\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/tensorflowVersions/*}\x12\xc2\x01\n\x14ListAcceleratorTypes\x12\x30.google.cloud.tpu.v1.ListAcceleratorTypesRequest\x1a\x31.google.cloud.tpu.v1.ListAcceleratorTypesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/acceleratorTypes\x12\xaf\x01\n\x12GetAcceleratorType\x12..google.cloud.tpu.v1.GetAcceleratorTypeRequest\x1a$.google.cloud.tpu.v1.AcceleratorType\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/acceleratorTypes/*}\x1a\x46\xca\x41\x12tpu.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBU\n\x17\x63om.google.cloud.tpu.v1B\rCloudTpuProtoP\x01Z)cloud.google.com/go/tpu/apiv1/tpupb;tpupbb\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 Tpu + module V1 + SchedulingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.SchedulingConfig").msgclass + NetworkEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.NetworkEndpoint").msgclass + Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node").msgclass + Node::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node.State").enummodule + Node::Health = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node.Health").enummodule + Node::ApiVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node.ApiVersion").enummodule + ListNodesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListNodesRequest").msgclass + ListNodesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListNodesResponse").msgclass + GetNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.GetNodeRequest").msgclass + CreateNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.CreateNodeRequest").msgclass + DeleteNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.DeleteNodeRequest").msgclass + ReimageNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ReimageNodeRequest").msgclass + StopNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.StopNodeRequest").msgclass + StartNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.StartNodeRequest").msgclass + TensorFlowVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.TensorFlowVersion").msgclass + GetTensorFlowVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.GetTensorFlowVersionRequest").msgclass + ListTensorFlowVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListTensorFlowVersionsRequest").msgclass + ListTensorFlowVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListTensorFlowVersionsResponse").msgclass + AcceleratorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.AcceleratorType").msgclass + GetAcceleratorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.GetAcceleratorTypeRequest").msgclass + ListAcceleratorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListAcceleratorTypesRequest").msgclass + ListAcceleratorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListAcceleratorTypesResponse").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.OperationMetadata").msgclass + Symptom = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Symptom").msgclass + Symptom::SymptomType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Symptom.SymptomType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb new file mode 100644 index 000000000000..2aafa9ceccbb --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/tpu/v1/cloud_tpu.proto for package 'google.cloud.tpu.v1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/tpu/v1/cloud_tpu_pb' + +module Google + module Cloud + module Tpu + module V1 + module Tpu + # Manages TPU nodes and other resources + # + # TPU API v1 + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.tpu.v1.Tpu' + + # Lists nodes. + rpc :ListNodes, ::Google::Cloud::Tpu::V1::ListNodesRequest, ::Google::Cloud::Tpu::V1::ListNodesResponse + # Gets the details of a node. + rpc :GetNode, ::Google::Cloud::Tpu::V1::GetNodeRequest, ::Google::Cloud::Tpu::V1::Node + # Creates a node. + rpc :CreateNode, ::Google::Cloud::Tpu::V1::CreateNodeRequest, ::Google::Longrunning::Operation + # Deletes a node. + rpc :DeleteNode, ::Google::Cloud::Tpu::V1::DeleteNodeRequest, ::Google::Longrunning::Operation + # Reimages a node's OS. + rpc :ReimageNode, ::Google::Cloud::Tpu::V1::ReimageNodeRequest, ::Google::Longrunning::Operation + # Stops a node, this operation is only available with single TPU nodes. + rpc :StopNode, ::Google::Cloud::Tpu::V1::StopNodeRequest, ::Google::Longrunning::Operation + # Starts a node. + rpc :StartNode, ::Google::Cloud::Tpu::V1::StartNodeRequest, ::Google::Longrunning::Operation + # List TensorFlow versions supported by this API. + rpc :ListTensorFlowVersions, ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest, ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsResponse + # Gets TensorFlow Version. + rpc :GetTensorFlowVersion, ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest, ::Google::Cloud::Tpu::V1::TensorFlowVersion + # Lists accelerator types supported by this API. + rpc :ListAcceleratorTypes, ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest, ::Google::Cloud::Tpu::V1::ListAcceleratorTypesResponse + # Gets AcceleratorType. + rpc :GetAcceleratorType, ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest, ::Google::Cloud::Tpu::V1::AcceleratorType + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb new file mode 100644 index 000000000000..30ee70ee9626 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/version" + +require "google/cloud/tpu/v1/tpu/credentials" +require "google/cloud/tpu/v1/tpu/paths" +require "google/cloud/tpu/v1/tpu/operations" +require "google/cloud/tpu/v1/tpu/client" + +module Google + module Cloud + module Tpu + module V1 + ## + # Manages TPU nodes and other resources + # + # TPU API v1 + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/tpu/v1/tpu" + # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new + # + module Tpu + end + end + end + end +end + +helper_path = ::File.join __dir__, "tpu", "helpers.rb" +require "google/cloud/tpu/v1/tpu/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb new file mode 100644 index 000000000000..2b7b841df38b --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb @@ -0,0 +1,1517 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/cloud_tpu_pb" +require "google/cloud/location" + +module Google + module Cloud + module Tpu + module V1 + module Tpu + ## + # Client for the Tpu service. + # + # Manages TPU nodes and other resources + # + # TPU API v1 + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "tpu.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tpu_stub + + ## + # Configure the Tpu Client class. + # + # See {::Google::Cloud::Tpu::V1::Tpu::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Tpu clients + # ::Google::Cloud::Tpu::V1::Tpu::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", "Tpu", "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.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Tpu 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::Tpu::V1::Tpu::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 + @tpu_stub.universe_domain + end + + ## + # Create a new Tpu client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Tpu 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/tpu/v1/cloud_tpu_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 + + @tpu_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Tpu::V1::Tpu::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, + logger: @config.logger + ) + + @tpu_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @tpu_stub.endpoint + config.universe_domain = @tpu_stub.universe_domain + config.logger = @tpu_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Tpu::V1::Tpu::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @tpu_stub.logger + end + + # Service calls + + ## + # Lists nodes. + # + # @overload list_nodes(request, options = nil) + # Pass arguments to `list_nodes` via a request object, either of type + # {::Google::Cloud::Tpu::V1::ListNodesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::ListNodesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_nodes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_nodes` via keyword arguments. Note that at + # least one keyword argument is 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 name. + # @param page_size [::Integer] + # The maximum number of items to return. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::Node>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::Node>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::ListNodesRequest.new + # + # # Call the list_nodes method. + # result = client.list_nodes 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::Tpu::V1::Node. + # p item + # end + # + def list_nodes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ListNodesRequest + + # Converts hash 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_nodes.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::Tpu::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_nodes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_nodes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :list_nodes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tpu_stub, :list_nodes, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the details of a node. + # + # @overload get_node(request, options = nil) + # Pass arguments to `get_node` via a request object, either of type + # {::Google::Cloud::Tpu::V1::GetNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::GetNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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(name: nil) + # Pass arguments to `get_node` via keyword arguments. Note that at + # least one keyword argument is 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tpu::V1::Node] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tpu::V1::Node] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::GetNodeRequest.new + # + # # Call the get_node method. + # result = client.get_node request + # + # # The returned object is of type Google::Cloud::Tpu::V1::Node. + # p result + # + def get_node request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::GetNodeRequest + + # Converts hash 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.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::Tpu::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.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :get_node, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a node. + # + # @overload create_node(request, options = nil) + # Pass arguments to `create_node` via a request object, either of type + # {::Google::Cloud::Tpu::V1::CreateNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::CreateNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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(parent: nil, node_id: nil, node: nil) + # Pass arguments to `create_node` via keyword arguments. Note that at + # least one keyword argument is 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 name. + # @param node_id [::String] + # The unqualified resource name. + # @param node [::Google::Cloud::Tpu::V1::Node, ::Hash] + # Required. The node. + # + # @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/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::CreateNodeRequest.new + # + # # Call the create_node method. + # result = client.create_node 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 request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::CreateNodeRequest + + # Converts hash 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.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::Tpu::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.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :create_node, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a node. + # + # @overload delete_node(request, options = nil) + # Pass arguments to `delete_node` via a request object, either of type + # {::Google::Cloud::Tpu::V1::DeleteNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::DeleteNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node(name: nil) + # Pass arguments to `delete_node` via keyword arguments. Note that at + # least one keyword argument is 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. + # + # @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/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::DeleteNodeRequest.new + # + # # Call the delete_node method. + # result = client.delete_node 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_node request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::DeleteNodeRequest + + # Converts hash 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_node.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::Tpu::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_node.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :delete_node, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Reimages a node's OS. + # + # @overload reimage_node(request, options = nil) + # Pass arguments to `reimage_node` via a request object, either of type + # {::Google::Cloud::Tpu::V1::ReimageNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::ReimageNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reimage_node(name: nil, tensorflow_version: nil) + # Pass arguments to `reimage_node` via keyword arguments. Note that at + # least one keyword argument is 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 resource name. + # @param tensorflow_version [::String] + # The version for reimage to create. + # + # @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/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::ReimageNodeRequest.new + # + # # Call the reimage_node method. + # result = client.reimage_node 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 reimage_node request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ReimageNodeRequest + + # Converts hash 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.reimage_node.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::Tpu::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.reimage_node.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reimage_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :reimage_node, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops a node, this operation is only available with single TPU nodes. + # + # @overload stop_node(request, options = nil) + # Pass arguments to `stop_node` via a request object, either of type + # {::Google::Cloud::Tpu::V1::StopNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::StopNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node(name: nil) + # Pass arguments to `stop_node` via keyword arguments. Note that at + # least one keyword argument is 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 resource name. + # + # @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/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::StopNodeRequest.new + # + # # Call the stop_node method. + # result = client.stop_node 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_node request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::StopNodeRequest + + # Converts hash 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_node.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::Tpu::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.stop_node.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :stop_node, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts a node. + # + # @overload start_node(request, options = nil) + # Pass arguments to `start_node` via a request object, either of type + # {::Google::Cloud::Tpu::V1::StartNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::StartNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node(name: nil) + # Pass arguments to `start_node` via keyword arguments. Note that at + # least one keyword argument is 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 resource name. + # + # @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/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::StartNodeRequest.new + # + # # Call the start_node method. + # result = client.start_node 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_node request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::StartNodeRequest + + # Converts hash 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_node.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::Tpu::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.start_node.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :start_node, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List TensorFlow versions supported by this API. + # + # @overload list_tensor_flow_versions(request, options = nil) + # Pass arguments to `list_tensor_flow_versions` via a request object, either of type + # {::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tensor_flow_versions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_tensor_flow_versions` via keyword arguments. Note that at + # least one keyword argument is 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 name. + # @param page_size [::Integer] + # The maximum number of items to return. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # List filter. + # @param order_by [::String] + # Sort results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::TensorFlowVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::TensorFlowVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.new + # + # # Call the list_tensor_flow_versions method. + # result = client.list_tensor_flow_versions 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::Tpu::V1::TensorFlowVersion. + # p item + # end + # + def list_tensor_flow_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest + + # Converts hash 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_tensor_flow_versions.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::Tpu::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_tensor_flow_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tensor_flow_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :list_tensor_flow_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tpu_stub, :list_tensor_flow_versions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets TensorFlow Version. + # + # @overload get_tensor_flow_version(request, options = nil) + # Pass arguments to `get_tensor_flow_version` via a request object, either of type + # {::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tensor_flow_version(name: nil) + # Pass arguments to `get_tensor_flow_version` via keyword arguments. Note that at + # least one keyword argument is 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tpu::V1::TensorFlowVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tpu::V1::TensorFlowVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new + # + # # Call the get_tensor_flow_version method. + # result = client.get_tensor_flow_version request + # + # # The returned object is of type Google::Cloud::Tpu::V1::TensorFlowVersion. + # p result + # + def get_tensor_flow_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest + + # Converts hash 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_tensor_flow_version.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::Tpu::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_tensor_flow_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tensor_flow_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :get_tensor_flow_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists accelerator types supported by this API. + # + # @overload list_accelerator_types(request, options = nil) + # Pass arguments to `list_accelerator_types` via a request object, either of type + # {::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_accelerator_types(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_accelerator_types` via keyword arguments. Note that at + # least one keyword argument is 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 name. + # @param page_size [::Integer] + # The maximum number of items to return. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # List filter. + # @param order_by [::String] + # Sort results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::AcceleratorType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::AcceleratorType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.new + # + # # Call the list_accelerator_types method. + # result = client.list_accelerator_types 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::Tpu::V1::AcceleratorType. + # p item + # end + # + def list_accelerator_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest + + # Converts hash 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_accelerator_types.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::Tpu::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_accelerator_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_accelerator_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :list_accelerator_types, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tpu_stub, :list_accelerator_types, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets AcceleratorType. + # + # @overload get_accelerator_type(request, options = nil) + # Pass arguments to `get_accelerator_type` via a request object, either of type + # {::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_accelerator_type(name: nil) + # Pass arguments to `get_accelerator_type` via keyword arguments. Note that at + # least one keyword argument is 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Tpu::V1::AcceleratorType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Tpu::V1::AcceleratorType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/tpu/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Tpu::V1::Tpu::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new + # + # # Call the get_accelerator_type method. + # result = client.get_accelerator_type request + # + # # The returned object is of type Google::Cloud::Tpu::V1::AcceleratorType. + # p result + # + def get_accelerator_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest + + # Converts hash 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_accelerator_type.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::Tpu::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_accelerator_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_accelerator_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tpu_stub.call_rpc :get_accelerator_type, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Tpu API. + # + # This class represents the configuration for Tpu, + # 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::Tpu::V1::Tpu::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_nodes to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Tpu::V1::Tpu::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_nodes.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_nodes.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "tpu.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 Tpu 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_nodes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_nodes + ## + # RPC-specific configuration for `get_node` + # @return [::Gapic::Config::Method] + # + attr_reader :get_node + ## + # RPC-specific configuration for `create_node` + # @return [::Gapic::Config::Method] + # + attr_reader :create_node + ## + # RPC-specific configuration for `delete_node` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_node + ## + # RPC-specific configuration for `reimage_node` + # @return [::Gapic::Config::Method] + # + attr_reader :reimage_node + ## + # RPC-specific configuration for `stop_node` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_node + ## + # RPC-specific configuration for `start_node` + # @return [::Gapic::Config::Method] + # + attr_reader :start_node + ## + # RPC-specific configuration for `list_tensor_flow_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tensor_flow_versions + ## + # RPC-specific configuration for `get_tensor_flow_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tensor_flow_version + ## + # RPC-specific configuration for `list_accelerator_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_accelerator_types + ## + # RPC-specific configuration for `get_accelerator_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_accelerator_type + + # @private + def initialize parent_rpcs = nil + list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes + @list_nodes = ::Gapic::Config::Method.new list_nodes_config + get_node_config = parent_rpcs.get_node if parent_rpcs.respond_to? :get_node + @get_node = ::Gapic::Config::Method.new get_node_config + create_node_config = parent_rpcs.create_node if parent_rpcs.respond_to? :create_node + @create_node = ::Gapic::Config::Method.new create_node_config + delete_node_config = parent_rpcs.delete_node if parent_rpcs.respond_to? :delete_node + @delete_node = ::Gapic::Config::Method.new delete_node_config + reimage_node_config = parent_rpcs.reimage_node if parent_rpcs.respond_to? :reimage_node + @reimage_node = ::Gapic::Config::Method.new reimage_node_config + stop_node_config = parent_rpcs.stop_node if parent_rpcs.respond_to? :stop_node + @stop_node = ::Gapic::Config::Method.new stop_node_config + start_node_config = parent_rpcs.start_node if parent_rpcs.respond_to? :start_node + @start_node = ::Gapic::Config::Method.new start_node_config + list_tensor_flow_versions_config = parent_rpcs.list_tensor_flow_versions if parent_rpcs.respond_to? :list_tensor_flow_versions + @list_tensor_flow_versions = ::Gapic::Config::Method.new list_tensor_flow_versions_config + get_tensor_flow_version_config = parent_rpcs.get_tensor_flow_version if parent_rpcs.respond_to? :get_tensor_flow_version + @get_tensor_flow_version = ::Gapic::Config::Method.new get_tensor_flow_version_config + list_accelerator_types_config = parent_rpcs.list_accelerator_types if parent_rpcs.respond_to? :list_accelerator_types + @list_accelerator_types = ::Gapic::Config::Method.new list_accelerator_types_config + get_accelerator_type_config = parent_rpcs.get_accelerator_type if parent_rpcs.respond_to? :get_accelerator_type + @get_accelerator_type = ::Gapic::Config::Method.new get_accelerator_type_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb new file mode 100644 index 000000000000..9c95a410d65c --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu + module V1 + module Tpu + # Credentials for the Tpu API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "CLOUD_TPU_CREDENTIALS", + "CLOUD_TPU_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "CLOUD_TPU_CREDENTIALS_JSON", + "CLOUD_TPU_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-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb new file mode 100644 index 000000000000..2705f05c388e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu + module V1 + module Tpu + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "tpu.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Tpu 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 Tpu 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::Tpu::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? + throw :response, 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::Tpu::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? + throw :response, 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::Tpu::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? + 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::Tpu::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? + 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::Tpu::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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "tpu.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb new file mode 100644 index 000000000000..e459e1626bc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu + module V1 + module Tpu + # Path helper methods for the Tpu API. + module Paths + ## + # Create a fully-qualified AcceleratorType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}` + # + # @param project [String] + # @param location [String] + # @param accelerator_type [String] + # + # @return [::String] + def accelerator_type_path project:, location:, accelerator_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/acceleratorTypes/#{accelerator_type}" + 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 Node resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/nodes/{node}` + # + # @param project [String] + # @param location [String] + # @param node [String] + # + # @return [::String] + def node_path project:, location:, node: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/nodes/#{node}" + end + + ## + # Create a fully-qualified TensorFlowVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}` + # + # @param project [String] + # @param location [String] + # @param tensor_flow_version [String] + # + # @return [::String] + def tensor_flow_version_path project:, location:, tensor_flow_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tensorFlowVersions/#{tensor_flow_version}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb new file mode 100644 index 000000000000..371ff2ba232b --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md new file mode 100644 index 000000000000..f1be9ff90bac --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud TPU V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-tpu-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb new file mode 100644 index 000000000000..337015bf0ead --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb @@ -0,0 +1,521 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu + module V1 + # Sets the scheduling options for this node. + # @!attribute [rw] preemptible + # @return [::Boolean] + # Defines whether the node is preemptible. + # @!attribute [rw] reserved + # @return [::Boolean] + # Whether the node is created under a reservation. + class SchedulingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A network endpoint over which a TPU worker can be reached. + # @!attribute [rw] ip_address + # @return [::String] + # The IP address of this network endpoint. + # @!attribute [rw] port + # @return [::Integer] + # The port of this network endpoint. + class NetworkEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A TPU instance. + # @!attribute [r] name + # @return [::String] + # Output only. Immutable. The name of the TPU + # @!attribute [rw] description + # @return [::String] + # The user-supplied description of the TPU. Maximum of 512 characters. + # @!attribute [rw] accelerator_type + # @return [::String] + # Required. The type of hardware accelerators associated with this node. + # @!attribute [rw] ip_address + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Output only. DEPRECATED! Use network_endpoints instead. + # The network address for the TPU Node as visible to Compute Engine + # instances. + # @!attribute [rw] port + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Output only. DEPRECATED! Use network_endpoints instead. + # The network port for the TPU Node as visible to Compute Engine instances. + # @!attribute [r] state + # @return [::Google::Cloud::Tpu::V1::Node::State] + # Output only. The current state for the TPU Node. + # @!attribute [r] health_description + # @return [::String] + # Output only. If this field is populated, it contains a description of why + # the TPU Node is unhealthy. + # @!attribute [rw] tensorflow_version + # @return [::String] + # Required. The version of Tensorflow running in the Node. + # @!attribute [rw] network + # @return [::String] + # The name of a network they wish to peer the TPU node to. It must be a + # preexisting Compute Engine network inside of the project on which this API + # has been activated. If none is provided, "default" will be used. + # @!attribute [rw] cidr_block + # @return [::String] + # The CIDR block that the TPU node will use when selecting an IP address. + # This CIDR block must be a /29 block; the Compute Engine networks API + # forbids a smaller block, and using a larger block would be wasteful (a + # node can only consume one IP address). Errors will occur if the CIDR block + # has already been used for a currently existing TPU node, the CIDR block + # conflicts with any subnetworks in the user's provided network, or the + # provided network is peered with another network that is using that CIDR + # block. + # @!attribute [r] service_account + # @return [::String] + # Output only. The service account used to run the tensor flow services + # within the node. To share resources, including Google Cloud Storage data, + # with the Tensorflow job running in the Node, this account must have + # permissions to that data. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the node was created. + # @!attribute [rw] scheduling_config + # @return [::Google::Cloud::Tpu::V1::SchedulingConfig] + # The scheduling options for this node. + # @!attribute [r] network_endpoints + # @return [::Array<::Google::Cloud::Tpu::V1::NetworkEndpoint>] + # Output only. The network endpoints where TPU workers can be accessed and + # sent work. It is recommended that Tensorflow clients of the node reach out + # to the 0th entry in this map first. + # @!attribute [rw] health + # @return [::Google::Cloud::Tpu::V1::Node::Health] + # The health status of the TPU node. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Resource labels to represent user-provided metadata. + # @!attribute [rw] use_service_networking + # @return [::Boolean] + # Whether the VPC peering for the node is set up through Service Networking + # API. The VPC Peering should be set up before provisioning the node. + # If this field is set, cidr_block field should not be specified. If the + # network, that you want to peer the TPU Node to, is Shared VPC networks, + # the node must be created with this this field enabled. + # @!attribute [r] api_version + # @return [::Google::Cloud::Tpu::V1::Node::ApiVersion] + # Output only. The API version that created this Node. + # @!attribute [r] symptoms + # @return [::Array<::Google::Cloud::Tpu::V1::Symptom>] + # Output only. The Symptoms that have occurred to the TPU Node. + class Node + 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 + + # Represents the different states of a TPU node during its lifecycle. + module State + # TPU node state is not known/set. + STATE_UNSPECIFIED = 0 + + # TPU node is being created. + CREATING = 1 + + # TPU node has been created. + READY = 2 + + # TPU node is restarting. + RESTARTING = 3 + + # TPU node is undergoing reimaging. + REIMAGING = 4 + + # TPU node is being deleted. + DELETING = 5 + + # TPU node is being repaired and may be unusable. Details can be + # found in the `help_description` field. + REPAIRING = 6 + + # TPU node is stopped. + STOPPED = 8 + + # TPU node is currently stopping. + STOPPING = 9 + + # TPU node is currently starting. + STARTING = 10 + + # TPU node has been preempted. Only applies to Preemptible TPU Nodes. + PREEMPTED = 11 + + # TPU node has been terminated due to maintenance or has reached the end of + # its life cycle (for preemptible nodes). + TERMINATED = 12 + + # TPU node is currently hiding. + HIDING = 13 + + # TPU node has been hidden. + HIDDEN = 14 + + # TPU node is currently unhiding. + UNHIDING = 15 + + # TPU node has unknown state after a failed repair. + UNKNOWN = 16 + end + + # Health defines the status of a TPU node as reported by + # Health Monitor. + module Health + # Health status is unknown: not initialized or failed to retrieve. + HEALTH_UNSPECIFIED = 0 + + # The resource is healthy. + HEALTHY = 1 + + # The resource is unhealthy. + DEPRECATED_UNHEALTHY = 2 + + # The resource is unresponsive. + TIMEOUT = 3 + + # The in-guest ML stack is unhealthy. + UNHEALTHY_TENSORFLOW = 4 + + # The node is under maintenance/priority boost caused rescheduling and + # will resume running once rescheduled. + UNHEALTHY_MAINTENANCE = 5 + end + + # TPU API Version. + module ApiVersion + # API version is unknown. + API_VERSION_UNSPECIFIED = 0 + + # TPU API V1Alpha1 version. + V1_ALPHA1 = 1 + + # TPU API V1 version. + V1 = 2 + + # TPU API V2Alpha1 version. + V2_ALPHA1 = 3 + end + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#list_nodes ListNodes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + class ListNodesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for {::Google::Cloud::Tpu::V1::Tpu::Client#list_nodes ListNodes}. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::Tpu::V1::Node>] + # The listed nodes. + # @!attribute [rw] next_page_token + # @return [::String] + # The next page token or empty if none. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListNodesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#get_node GetNode}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name. + class GetNodeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#create_node CreateNode}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # @!attribute [rw] node_id + # @return [::String] + # The unqualified resource name. + # @!attribute [rw] node + # @return [::Google::Cloud::Tpu::V1::Node] + # Required. The node. + class CreateNodeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#delete_node DeleteNode}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name. + class DeleteNodeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#reimage_node ReimageNode}. + # @!attribute [rw] name + # @return [::String] + # The resource name. + # @!attribute [rw] tensorflow_version + # @return [::String] + # The version for reimage to create. + class ReimageNodeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#stop_node StopNode}. + # @!attribute [rw] name + # @return [::String] + # The resource name. + class StopNodeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#start_node StartNode}. + # @!attribute [rw] name + # @return [::String] + # The resource name. + class StartNodeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A tensorflow version that a Node can be configured with. + # @!attribute [rw] name + # @return [::String] + # The resource name. + # @!attribute [rw] version + # @return [::String] + # the tensorflow version. + class TensorFlowVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Tpu::V1::Tpu::Client#get_tensor_flow_version GetTensorFlowVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name. + class GetTensorFlowVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions ListTensorFlowVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + # @!attribute [rw] filter + # @return [::String] + # List filter. + # @!attribute [rw] order_by + # @return [::String] + # Sort results. + class ListTensorFlowVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for + # {::Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions ListTensorFlowVersions}. + # @!attribute [rw] tensorflow_versions + # @return [::Array<::Google::Cloud::Tpu::V1::TensorFlowVersion>] + # The listed nodes. + # @!attribute [rw] next_page_token + # @return [::String] + # The next page token or empty if none. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListTensorFlowVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A accelerator type that a Node can be configured with. + # @!attribute [rw] name + # @return [::String] + # The resource name. + # @!attribute [rw] type + # @return [::String] + # the accelerator type. + class AcceleratorType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#get_accelerator_type GetAcceleratorType}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name. + class GetAcceleratorTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for + # {::Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types ListAcceleratorTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + # @!attribute [rw] filter + # @return [::String] + # List filter. + # @!attribute [rw] order_by + # @return [::String] + # Sort results. + class ListAcceleratorTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for + # {::Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types ListAcceleratorTypes}. + # @!attribute [rw] accelerator_types + # @return [::Array<::Google::Cloud::Tpu::V1::AcceleratorType>] + # The listed nodes. + # @!attribute [rw] next_page_token + # @return [::String] + # The next page token or empty if none. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListAcceleratorTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata describing an {::Google::Longrunning::Operation Operation} + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was created. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation finished running. + # @!attribute [rw] target + # @return [::String] + # Target of the operation - for example + # projects/project-1/connectivityTests/test-1 + # @!attribute [rw] verb + # @return [::String] + # Name of the verb executed by the operation. + # @!attribute [rw] status_detail + # @return [::String] + # Human-readable status of the operation, if any. + # @!attribute [rw] cancel_requested + # @return [::Boolean] + # Specifies if cancellation was requested for the operation. + # @!attribute [rw] api_version + # @return [::String] + # API version. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Symptom instance. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the Symptom is created. + # @!attribute [rw] symptom_type + # @return [::Google::Cloud::Tpu::V1::Symptom::SymptomType] + # Type of the Symptom. + # @!attribute [rw] details + # @return [::String] + # Detailed information of the current Symptom. + # @!attribute [rw] worker_id + # @return [::String] + # A string used to uniquely distinguish a worker within a TPU node. + class Symptom + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # SymptomType represents the different types of Symptoms that a TPU can be + # at. + module SymptomType + # Unspecified symptom. + SYMPTOM_TYPE_UNSPECIFIED = 0 + + # TPU VM memory is low. + LOW_MEMORY = 1 + + # TPU runtime is out of memory. + OUT_OF_MEMORY = 2 + + # TPU runtime execution has timed out. + EXECUTE_TIMED_OUT = 3 + + # TPU runtime fails to construct a mesh that recognizes each TPU device's + # neighbors. + MESH_BUILD_FAIL = 4 + + # TPU HBM is out of memory. + HBM_OUT_OF_MEMORY = 5 + + # Abusive behaviors have been identified on the current project. + PROJECT_ABUSE = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-tpu-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile new file mode 100644 index 000000000000..8e8e1bbc6e73 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1", path: "../" +else + gem "google-cloud-tpu-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-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json b/owl-bot-staging/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json new file mode 100644 index 000000000000..8d24f0d69dda --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json @@ -0,0 +1,455 @@ +{ + "client_library": { + "name": "google-cloud-tpu-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.tpu.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "tpu_v1_generated_Tpu_ListNodes_sync", + "title": "Snippet for the list_nodes call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#list_nodes.", + "file": "tpu/list_nodes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_nodes", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#list_nodes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::ListNodesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tpu::V1::ListNodesResponse", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "ListNodes", + "full_name": "google.cloud.tpu.v1.Tpu.ListNodes", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_GetNode_sync", + "title": "Snippet for the get_node call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#get_node.", + "file": "tpu/get_node.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_node", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#get_node", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::GetNodeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tpu::V1::Node", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "GetNode", + "full_name": "google.cloud.tpu.v1.Tpu.GetNode", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_CreateNode_sync", + "title": "Snippet for the create_node call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#create_node.", + "file": "tpu/create_node.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_node", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#create_node", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::CreateNodeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "CreateNode", + "full_name": "google.cloud.tpu.v1.Tpu.CreateNode", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_DeleteNode_sync", + "title": "Snippet for the delete_node call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#delete_node.", + "file": "tpu/delete_node.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_node", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#delete_node", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::DeleteNodeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "DeleteNode", + "full_name": "google.cloud.tpu.v1.Tpu.DeleteNode", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_ReimageNode_sync", + "title": "Snippet for the reimage_node call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#reimage_node.", + "file": "tpu/reimage_node.rb", + "language": "RUBY", + "client_method": { + "short_name": "reimage_node", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#reimage_node", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::ReimageNodeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "ReimageNode", + "full_name": "google.cloud.tpu.v1.Tpu.ReimageNode", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_StopNode_sync", + "title": "Snippet for the stop_node call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#stop_node.", + "file": "tpu/stop_node.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_node", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#stop_node", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::StopNodeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "StopNode", + "full_name": "google.cloud.tpu.v1.Tpu.StopNode", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_StartNode_sync", + "title": "Snippet for the start_node call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#start_node.", + "file": "tpu/start_node.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_node", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#start_node", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::StartNodeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "StartNode", + "full_name": "google.cloud.tpu.v1.Tpu.StartNode", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_ListTensorFlowVersions_sync", + "title": "Snippet for the list_tensor_flow_versions call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions.", + "file": "tpu/list_tensor_flow_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tensor_flow_versions", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tpu::V1::ListTensorFlowVersionsResponse", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "ListTensorFlowVersions", + "full_name": "google.cloud.tpu.v1.Tpu.ListTensorFlowVersions", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_GetTensorFlowVersion_sync", + "title": "Snippet for the get_tensor_flow_version call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#get_tensor_flow_version.", + "file": "tpu/get_tensor_flow_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tensor_flow_version", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#get_tensor_flow_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tpu::V1::TensorFlowVersion", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "GetTensorFlowVersion", + "full_name": "google.cloud.tpu.v1.Tpu.GetTensorFlowVersion", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_ListAcceleratorTypes_sync", + "title": "Snippet for the list_accelerator_types call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types.", + "file": "tpu/list_accelerator_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_accelerator_types", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tpu::V1::ListAcceleratorTypesResponse", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "ListAcceleratorTypes", + "full_name": "google.cloud.tpu.v1.Tpu.ListAcceleratorTypes", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "tpu_v1_generated_Tpu_GetAcceleratorType_sync", + "title": "Snippet for the get_accelerator_type call in the Tpu service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#get_accelerator_type.", + "file": "tpu/get_accelerator_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_accelerator_type", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#get_accelerator_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Tpu::V1::AcceleratorType", + "client": { + "short_name": "Tpu::Client", + "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" + }, + "method": { + "short_name": "GetAcceleratorType", + "full_name": "google.cloud.tpu.v1.Tpu.GetAcceleratorType", + "service": { + "short_name": "Tpu", + "full_name": "google.cloud.tpu.v1.Tpu" + } + } + }, + "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-tpu-v1/snippets/tpu/create_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/create_node.rb new file mode 100644 index 000000000000..d1c45f76a1a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/create_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_CreateNode_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the create_node call in the Tpu 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::Tpu::V1::Tpu::Client#create_node. +# +def create_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::CreateNodeRequest.new + + # Call the create_node method. + result = client.create_node 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 tpu_v1_generated_Tpu_CreateNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb new file mode 100644 index 000000000000..461da43fb962 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_DeleteNode_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the delete_node call in the Tpu 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::Tpu::V1::Tpu::Client#delete_node. +# +def delete_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::DeleteNodeRequest.new + + # Call the delete_node method. + result = client.delete_node 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 tpu_v1_generated_Tpu_DeleteNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb new file mode 100644 index 000000000000..01933680099e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_GetAcceleratorType_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the get_accelerator_type call in the Tpu 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::Tpu::V1::Tpu::Client#get_accelerator_type. +# +def get_accelerator_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new + + # Call the get_accelerator_type method. + result = client.get_accelerator_type request + + # The returned object is of type Google::Cloud::Tpu::V1::AcceleratorType. + p result +end +# [END tpu_v1_generated_Tpu_GetAcceleratorType_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb new file mode 100644 index 000000000000..8f5fd80cf9f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_GetNode_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the get_node call in the Tpu 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::Tpu::V1::Tpu::Client#get_node. +# +def get_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::GetNodeRequest.new + + # Call the get_node method. + result = client.get_node request + + # The returned object is of type Google::Cloud::Tpu::V1::Node. + p result +end +# [END tpu_v1_generated_Tpu_GetNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb new file mode 100644 index 000000000000..f8602be5c5da --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_GetTensorFlowVersion_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the get_tensor_flow_version call in the Tpu 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::Tpu::V1::Tpu::Client#get_tensor_flow_version. +# +def get_tensor_flow_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new + + # Call the get_tensor_flow_version method. + result = client.get_tensor_flow_version request + + # The returned object is of type Google::Cloud::Tpu::V1::TensorFlowVersion. + p result +end +# [END tpu_v1_generated_Tpu_GetTensorFlowVersion_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb new file mode 100644 index 000000000000..98fd7b460c0e --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ListAcceleratorTypes_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the list_accelerator_types call in the Tpu 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::Tpu::V1::Tpu::Client#list_accelerator_types. +# +def list_accelerator_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.new + + # Call the list_accelerator_types method. + result = client.list_accelerator_types 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::Tpu::V1::AcceleratorType. + p item + end +end +# [END tpu_v1_generated_Tpu_ListAcceleratorTypes_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb new file mode 100644 index 000000000000..12cc06e1969a --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ListNodes_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the list_nodes call in the Tpu 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::Tpu::V1::Tpu::Client#list_nodes. +# +def list_nodes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ListNodesRequest.new + + # Call the list_nodes method. + result = client.list_nodes 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::Tpu::V1::Node. + p item + end +end +# [END tpu_v1_generated_Tpu_ListNodes_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb new file mode 100644 index 000000000000..ca3d984b9276 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ListTensorFlowVersions_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the list_tensor_flow_versions call in the Tpu 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::Tpu::V1::Tpu::Client#list_tensor_flow_versions. +# +def list_tensor_flow_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.new + + # Call the list_tensor_flow_versions method. + result = client.list_tensor_flow_versions 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::Tpu::V1::TensorFlowVersion. + p item + end +end +# [END tpu_v1_generated_Tpu_ListTensorFlowVersions_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb new file mode 100644 index 000000000000..8af8741cff8f --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ReimageNode_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the reimage_node call in the Tpu 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::Tpu::V1::Tpu::Client#reimage_node. +# +def reimage_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ReimageNodeRequest.new + + # Call the reimage_node method. + result = client.reimage_node 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 tpu_v1_generated_Tpu_ReimageNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb new file mode 100644 index 000000000000..f4bcab475e2c --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_StartNode_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the start_node call in the Tpu 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::Tpu::V1::Tpu::Client#start_node. +# +def start_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::StartNodeRequest.new + + # Call the start_node method. + result = client.start_node 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 tpu_v1_generated_Tpu_StartNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb new file mode 100644 index 000000000000..8d4b1be90049 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_StopNode_sync] +require "google/cloud/tpu/v1" + +## +# Snippet for the stop_node call in the Tpu 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::Tpu::V1::Tpu::Client#stop_node. +# +def stop_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::StopNodeRequest.new + + # Call the stop_node method. + result = client.stop_node 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 tpu_v1_generated_Tpu_StopNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb new file mode 100644 index 000000000000..ad025ce2f9bc --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/cloud_tpu_pb" +require "google/cloud/tpu/v1/cloud_tpu_services_pb" +require "google/cloud/tpu/v1/tpu" + +class ::Google::Cloud::Tpu::V1::Tpu::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb new file mode 100644 index 000000000000..4ceac4e2e690 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/tpu" + +class ::Google::Cloud::Tpu::V1::Tpu::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_accelerator_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.accelerator_type_path project: "value0", location: "value1", accelerator_type: "value2" + assert_equal "projects/value0/locations/value1/acceleratorTypes/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::Tpu::V1::Tpu::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_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.node_path project: "value0", location: "value1", node: "value2" + assert_equal "projects/value0/locations/value1/nodes/value2", path + end + end + + def test_tensor_flow_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tensor_flow_version_path project: "value0", location: "value1", tensor_flow_version: "value2" + assert_equal "projects/value0/locations/value1/tensorFlowVersions/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb new file mode 100644 index 000000000000..96dc840e4d05 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb @@ -0,0 +1,822 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/cloud_tpu_pb" +require "google/cloud/tpu/v1/tpu" + +class ::Google::Cloud::Tpu::V1::Tpu::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_nodes + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tpu::V1::ListNodesResponse.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_nodes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_nodes, name + assert_kind_of ::Google::Cloud::Tpu::V1::ListNodesRequest, 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_nodes_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_nodes({ 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_nodes 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_nodes ::Google::Cloud::Tpu::V1::ListNodesRequest.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_nodes({ 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_nodes(::Google::Cloud::Tpu::V1::ListNodesRequest.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_nodes_client_stub.call_rpc_count + end + end + + def test_get_node + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tpu::V1::Node.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_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_node, name + assert_kind_of ::Google::Cloud::Tpu::V1::GetNodeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_node_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_node({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_node name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_node ::Google::Cloud::Tpu::V1::GetNodeRequest.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({ 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(::Google::Cloud::Tpu::V1::GetNodeRequest.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_client_stub.call_rpc_count + end + end + + def test_create_node + # 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_id = "hello world" + node = {} + + create_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_node, name + assert_kind_of ::Google::Cloud::Tpu::V1::CreateNodeRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["node_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tpu::V1::Node), request["node"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_node_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_node({ parent: parent, node_id: node_id, node: node }) 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 parent: parent, node_id: node_id, node: node 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 ::Google::Cloud::Tpu::V1::CreateNodeRequest.new(parent: parent, node_id: node_id, node: node) 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({ parent: parent, node_id: node_id, node: node }, 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(::Google::Cloud::Tpu::V1::CreateNodeRequest.new(parent: parent, node_id: node_id, node: node), 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_client_stub.call_rpc_count + end + end + + def test_delete_node + # 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" + + delete_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_node, name + assert_kind_of ::Google::Cloud::Tpu::V1::DeleteNodeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_node_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_node({ 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.delete_node 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.delete_node ::Google::Cloud::Tpu::V1::DeleteNodeRequest.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.delete_node({ 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.delete_node(::Google::Cloud::Tpu::V1::DeleteNodeRequest.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, delete_node_client_stub.call_rpc_count + end + end + + def test_reimage_node + # 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" + tensorflow_version = "hello world" + + reimage_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reimage_node, name + assert_kind_of ::Google::Cloud::Tpu::V1::ReimageNodeRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["tensorflow_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reimage_node_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reimage_node({ name: name, tensorflow_version: tensorflow_version }) 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.reimage_node name: name, tensorflow_version: tensorflow_version 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.reimage_node ::Google::Cloud::Tpu::V1::ReimageNodeRequest.new(name: name, tensorflow_version: tensorflow_version) 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.reimage_node({ name: name, tensorflow_version: tensorflow_version }, 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.reimage_node(::Google::Cloud::Tpu::V1::ReimageNodeRequest.new(name: name, tensorflow_version: tensorflow_version), 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, reimage_node_client_stub.call_rpc_count + end + end + + def test_stop_node + # 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" + + stop_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_node, name + assert_kind_of ::Google::Cloud::Tpu::V1::StopNodeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_node_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_node({ 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.stop_node 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.stop_node ::Google::Cloud::Tpu::V1::StopNodeRequest.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.stop_node({ 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.stop_node(::Google::Cloud::Tpu::V1::StopNodeRequest.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, stop_node_client_stub.call_rpc_count + end + end + + def test_start_node + # 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" + + start_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_node, name + assert_kind_of ::Google::Cloud::Tpu::V1::StartNodeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_node_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_node({ 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.start_node 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.start_node ::Google::Cloud::Tpu::V1::StartNodeRequest.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.start_node({ 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.start_node(::Google::Cloud::Tpu::V1::StartNodeRequest.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, start_node_client_stub.call_rpc_count + end + end + + def test_list_tensor_flow_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsResponse.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_tensor_flow_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tensor_flow_versions, name + assert_kind_of ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest, 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_tensor_flow_versions_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tensor_flow_versions({ 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_tensor_flow_versions 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_tensor_flow_versions ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.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_tensor_flow_versions({ 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_tensor_flow_versions(::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.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_tensor_flow_versions_client_stub.call_rpc_count + end + end + + def test_get_tensor_flow_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tpu::V1::TensorFlowVersion.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_tensor_flow_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tensor_flow_version, name + assert_kind_of ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tensor_flow_version_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_tensor_flow_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_tensor_flow_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_tensor_flow_version ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_tensor_flow_version({ 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_tensor_flow_version(::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.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_tensor_flow_version_client_stub.call_rpc_count + end + end + + def test_list_accelerator_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tpu::V1::ListAcceleratorTypesResponse.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_accelerator_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_accelerator_types, name + assert_kind_of ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest, 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_accelerator_types_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_accelerator_types({ 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_accelerator_types 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_accelerator_types ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.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_accelerator_types({ 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_accelerator_types(::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.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_accelerator_types_client_stub.call_rpc_count + end + end + + def test_get_accelerator_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Tpu::V1::AcceleratorType.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_accelerator_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_accelerator_type, name + assert_kind_of ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_accelerator_type_client_stub do + # Create client + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_accelerator_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_accelerator_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_accelerator_type ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_accelerator_type({ 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_accelerator_type(::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.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_accelerator_type_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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Tpu::V1::Tpu::Client, client + assert_equal creds, client.configure.credentials + end + 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::Tpu::V1::Tpu::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Tpu::V1::Tpu::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb b/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tpu/.gitignore b/owl-bot-staging/google-cloud-tpu/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/.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-tpu/.repo-metadata.json b/owl-bot-staging/google-cloud-tpu/.repo-metadata.json new file mode 100644 index 000000000000..7a404d7edb34 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "tpu.googleapis.com", + "api_shortname": "tpu", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tpu/latest", + "distribution_name": "google-cloud-tpu", + "is_cloud": true, + "language": "ruby", + "name": "tpu", + "name_pretty": "Cloud TPU API", + "product_documentation": "https://cloud.google.com/tpu/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform.", + "ruby-cloud-env-prefix": "CLOUD_TPU", + "ruby-cloud-product-url": "https://cloud.google.com/tpu/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-tpu/.rubocop.yml b/owl-bot-staging/google-cloud-tpu/.rubocop.yml new file mode 100644 index 000000000000..bb2820bfb3e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-tpu.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-tpu.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-tpu/.toys.rb b/owl-bot-staging/google-cloud-tpu/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu/.yardopts b/owl-bot-staging/google-cloud-tpu/.yardopts new file mode 100644 index 000000000000..159a9a920b2c --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Cloud TPU API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md new file mode 100644 index 000000000000..42020570ba11 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-tpu 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-tpu 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/tpu" + +client = Google::Cloud::Tpu.tpu do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/tpu" + +Google::Cloud::Tpu.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Tpu.tpu +``` + +### 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-tpu +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/tpu" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Tpu.tpu +``` + +### 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-tpu/CHANGELOG.md b/owl-bot-staging/google-cloud-tpu/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-tpu/Gemfile b/owl-bot-staging/google-cloud-tpu/Gemfile new file mode 100644 index 000000000000..8db1745a6566 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-tpu-v1"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-tpu.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.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-tpu/LICENSE.md b/owl-bot-staging/google-cloud-tpu/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/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-tpu/README.md b/owl-bot-staging/google-cloud-tpu/README.md new file mode 100644 index 000000000000..d3f1b3ca10fd --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/README.md @@ -0,0 +1,142 @@ +# Ruby Client for the Cloud TPU API + +API Client library for the Cloud TPU API + +Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-tpu-v*`. +The gem `google-cloud-tpu` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu/latest) +for this library, google-cloud-tpu, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-tpu-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest). + +See also the [Product Documentation](https://cloud.google.com/tpu/) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-tpu +``` + +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/tpu.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/tpu" + +client = Google::Cloud::Tpu.tpu +request = ::Google::Cloud::Tpu::V1::ListNodesRequest.new # (request fields as keyword arguments...) +response = client.list_nodes request +``` + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-tpu-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +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-tpu`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-tpu-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-tpu`. +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-tpu-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-tpu/Rakefile b/owl-bot-staging/google-cloud-tpu/Rakefile new file mode 100644 index 000000000000..3db6f8becfe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true +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-tpu acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["CLOUD_TPU_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["CLOUD_TPU_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["CLOUD_TPU_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 CLOUD_TPU_TEST_PROJECT=test123 CLOUD_TPU_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/tpu/v1/tpu/credentials" + ::Google::Cloud::Tpu::V1::Tpu::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["CLOUD_TPU_PROJECT"] = project + ENV["CLOUD_TPU_TEST_PROJECT"] = project + ENV["CLOUD_TPU_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-tpu 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-tpu 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-tpu 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-tpu gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-tpu" + header "google-cloud-tpu rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-tpu yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-tpu 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-tpu 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-tpu 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-tpu/google-cloud-tpu.gemspec b/owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec new file mode 100644 index 000000000000..781768c20cac --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec @@ -0,0 +1,27 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/tpu/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-tpu" + gem.version = Google::Cloud::Tpu::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform." + gem.summary = "API Client library for the Cloud TPU API" + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-tpu-v1", ">= 0.6", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb b/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb new file mode 100644 index 000000000000..99f9595ff472 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu" unless defined? Google::Cloud::Tpu::VERSION diff --git a/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb new file mode 100644 index 000000000000..b57a41a50a01 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/tpu/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :tpu do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Tpu + ## + # Create a new client object for Tpu. + # + # By default, this returns an instance of + # [Google::Cloud::Tpu::V1::Tpu::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest/Google-Cloud-Tpu-V1-Tpu-Client) + # for a gRPC client for version V1 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the Tpu service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the Tpu service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Tpu.tpu_available?}. + # + # ## About Tpu + # + # Manages TPU nodes and other resources + # + # TPU API v1 + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [::Object] A client object for the specified version. + # + def self.tpu version: :v1, &block + require "google/cloud/tpu/#{version.to_s.downcase}" + + package_name = Google::Cloud::Tpu + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Tpu.const_get(package_name).const_get(:Tpu) + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the Tpu service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Tpu.tpu}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the Tpu service, + # or if the versioned client gem needs an update to support the Tpu service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [boolean] Whether the service is available. + # + def self.tpu_available? version: :v1 + require "google/cloud/tpu/#{version.to_s.downcase}" + package_name = Google::Cloud::Tpu + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Tpu.const_get package_name + return false unless service_module.const_defined? :Tpu + service_module = service_module.const_get :Tpu + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-tpu library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.tpu if block_given? + + ::Google::Cloud.configure.tpu + end + end + end +end + +helper_path = ::File.join __dir__, "tpu", "helpers.rb" +require "google/cloud/tpu/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb new file mode 100644 index 000000000000..7008c26acfae --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb b/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb new file mode 100644 index 000000000000..add90e3eddd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tpu" +require "gapic/common" +require "gapic/grpc" + +class Google::Cloud::Tpu::ClientConstructionMinitest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_tpu_grpc + skip unless Google::Cloud::Tpu.tpu_available? + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Tpu.tpu do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Tpu::V1::Tpu::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb b/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb new file mode 100644 index 000000000000..71fff0353b98 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tpu/version" + +class Google::Cloud::Tpu::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Tpu::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-tpu/test/helper.rb b/owl-bot-staging/google-cloud-tpu/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-tpu/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-trace-v1/.gitignore b/owl-bot-staging/google-cloud-trace-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-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-trace-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-trace-v1/.repo-metadata.json new file mode 100644 index 000000000000..d328c585f392 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudtrace.googleapis.com", + "api_shortname": "cloudtrace", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v1/latest", + "distribution_name": "google-cloud-trace-v1", + "is_cloud": true, + "language": "ruby", + "name": "cloudtrace", + "name_pretty": "Cloud Trace V1 API", + "product_documentation": "https://cloud.google.com/trace", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TRACE", + "ruby-cloud-product-url": "https://cloud.google.com/trace", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-trace-v1/.rubocop.yml b/owl-bot-staging/google-cloud-trace-v1/.rubocop.yml new file mode 100644 index 000000000000..497c946242fd --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-trace-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-trace-v1.rb" diff --git a/owl-bot-staging/google-cloud-trace-v1/.toys.rb b/owl-bot-staging/google-cloud-trace-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/.yardopts b/owl-bot-staging/google-cloud-trace-v1/.yardopts new file mode 100644 index 000000000000..a9ea6aa99950 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Trace 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-trace-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-trace-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..ce2edb9aa12f --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-trace-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-trace-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/trace/v1" + +client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/trace/v1" + +::Google::Cloud::Trace::V1::TraceService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Trace::V1::TraceService::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-trace-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/trace/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Trace::V1::TraceService::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-trace-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-trace-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-trace-v1/Gemfile b/owl-bot-staging/google-cloud-trace-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-trace-v1/LICENSE.md b/owl-bot-staging/google-cloud-trace-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-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-trace-v1/README.md b/owl-bot-staging/google-cloud-trace-v1/README.md new file mode 100644 index 000000000000..488c98aabfe3 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Trace V1 API + +Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry. + +The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. + +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 Trace V1 API. Most users should consider using +the main client gem, +[google-cloud-trace](https://rubygems.org/gems/google-cloud-trace). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-trace-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/cloudtrace.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/trace/v1" + +client = ::Google::Cloud::Trace::V1::TraceService::Client.new +request = ::Google::Cloud::Trace::V1::ListTracesRequest.new # (request fields as keyword arguments...) +response = client.list_traces request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/trace) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/trace/v1" +require "logger" + +client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-trace`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-trace-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-trace`. +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-trace-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-trace-v1/Rakefile b/owl-bot-staging/google-cloud-trace-v1/Rakefile new file mode 100644 index 000000000000..663b8d0b3857 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TRACE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TRACE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TRACE_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 TRACE_TEST_PROJECT=test123 TRACE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/trace/v1/trace_service/credentials" + ::Google::Cloud::Trace::V1::TraceService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TRACE_PROJECT"] = project + ENV["TRACE_TEST_PROJECT"] = project + ENV["TRACE_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-trace-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-trace-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-trace-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-trace-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-trace-v1" + header "google-cloud-trace-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-trace-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-trace-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-trace-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-trace-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-trace-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-trace-v1/gapic_metadata.json new file mode 100644 index 000000000000..c869538c2a6c --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.devtools.cloudtrace.v1", + "libraryPackage": "::Google::Cloud::Trace::V1", + "services": { + "TraceService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Trace::V1::TraceService::Client", + "rpcs": { + "ListTraces": { + "methods": [ + "list_traces" + ] + }, + "GetTrace": { + "methods": [ + "get_trace" + ] + }, + "PatchTraces": { + "methods": [ + "patch_traces" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec b/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec new file mode 100644 index 000000000000..c9e4cd057fe9 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/trace/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-trace-v1" + gem.version = Google::Cloud::Trace::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details." + gem.summary = "Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb new file mode 100644 index 000000000000..d0d18e420960 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1" diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb new file mode 100644 index 000000000000..bdd9cdacfccf --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/trace_service" +require "google/cloud/trace/v1/version" + +module Google + module Cloud + module Trace + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/trace/v1" + # client = ::Google::Cloud::Trace::V1::TraceService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/trace/v1" + # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/trace/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb new file mode 100644 index 000000000000..9e774bceaca2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/trace_service/rest" +require "google/cloud/trace/v1/version" + +module Google + module Cloud + module Trace + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/trace/v1/rest" + # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb new file mode 100644 index 000000000000..4f7face77bb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/version" + +require "google/cloud/trace/v1/trace_service/credentials" +require "google/cloud/trace/v1/trace_service/client" +require "google/cloud/trace/v1/trace_service/rest" + +module Google + module Cloud + module Trace + module V1 + ## + # This file describes an API for collecting and viewing traces and spans + # within a trace. A Trace is a collection of spans corresponding to a single + # operation or set of operations for an application. A span is an individual + # timed event which forms a node of the trace tree. Spans for a single trace + # may span multiple services. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/trace/v1/trace_service" + # client = ::Google::Cloud::Trace::V1::TraceService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/trace/v1/trace_service/rest" + # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + module TraceService + end + end + end + end +end + +helper_path = ::File.join __dir__, "trace_service", "helpers.rb" +require "google/cloud/trace/v1/trace_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb new file mode 100644 index 000000000000..14e8613b2622 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb @@ -0,0 +1,753 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" + +module Google + module Cloud + module Trace + module V1 + module TraceService + ## + # Client for the TraceService service. + # + # This file describes an API for collecting and viewing traces and spans + # within a trace. A Trace is a collection of spans corresponding to a single + # operation or set of operations for an application. A span is an individual + # timed event which forms a node of the trace tree. Spans for a single trace + # may span multiple services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :trace_service_stub + + ## + # Configure the TraceService Client class. + # + # See {::Google::Cloud::Trace::V1::TraceService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TraceService clients + # ::Google::Cloud::Trace::V1::TraceService::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", "Trace", "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.list_traces.timeout = 45.0 + default_config.rpcs.list_traces.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config.rpcs.get_trace.timeout = 45.0 + default_config.rpcs.get_trace.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config.rpcs.patch_traces.timeout = 45.0 + default_config.rpcs.patch_traces.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TraceService 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::Trace::V1::TraceService::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 + @trace_service_stub.universe_domain + end + + ## + # Create a new TraceService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Trace::V1::TraceService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TraceService 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/devtools/cloudtrace/v1/trace_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 + + @trace_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Trace::V1::TraceService::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, + logger: @config.logger + ) + + @trace_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @trace_service_stub.logger + end + + # Service calls + + ## + # Returns of a list of traces that match the specified filter conditions. + # + # @overload list_traces(request, options = nil) + # Pass arguments to `list_traces` via a request object, either of type + # {::Google::Cloud::Trace::V1::ListTracesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V1::ListTracesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_traces(project_id: nil, view: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil, filter: nil, order_by: nil) + # Pass arguments to `list_traces` via keyword arguments. Note that at + # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. + # @param view [::Google::Cloud::Trace::V1::ListTracesRequest::ViewType] + # Optional. Type of data returned for traces in the list. Default is + # `MINIMAL`. + # @param page_size [::Integer] + # Optional. Maximum number of traces to return. If not specified or <= 0, the + # implementation selects a reasonable value. The implementation may + # return fewer traces than the requested page size. + # @param page_token [::String] + # Token identifying the page of results to return. If provided, use the + # value of the `next_page_token` field from a previous request. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Start of the time interval (inclusive) during which the trace data was + # collected from the application. + # @param end_time [::Google::Protobuf::Timestamp, ::Hash] + # End of the time interval (inclusive) during which the trace data was + # collected from the application. + # @param filter [::String] + # Optional. A filter against labels for the request. + # + # By default, searches use prefix matching. To specify exact match, prepend + # a plus symbol (`+`) to the search term. + # Multiple terms are ANDed. Syntax: + # + # * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root + # span starts with `NAME_PREFIX`. + # * `+root:NAME` or `+NAME`: Return traces where any root span's name is + # exactly `NAME`. + # * `span:NAME_PREFIX`: Return traces where any span starts with + # `NAME_PREFIX`. + # * `+span:NAME`: Return traces where any span's name is exactly + # `NAME`. + # * `latency:DURATION`: Return traces whose overall latency is + # greater or equal to than `DURATION`. Accepted units are nanoseconds + # (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For + # example, `latency:24ms` returns traces whose overall latency + # is greater than or equal to 24 milliseconds. + # * `label:LABEL_KEY`: Return all traces containing the specified + # label key (exact match, case-sensitive) regardless of the key:value + # pair's value (including empty values). + # * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified + # label key (exact match, case-sensitive) whose value starts with + # `VALUE_PREFIX`. Both a key and a value must be specified. + # * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair + # exactly matching the specified text. Both a key and a value must be + # specified. + # * `method:VALUE`: Equivalent to `/http/method:VALUE`. + # * `url:VALUE`: Equivalent to `/http/url:VALUE`. + # @param order_by [::String] + # Optional. Field used to sort the returned traces. + # Can be one of the following: + # + # * `trace_id` + # * `name` (`name` field of root span in the trace) + # * `duration` (difference between `end_time` and `start_time` fields of + # the root span) + # * `start` (`start_time` field of the root span) + # + # Descending order can be specified by appending `desc` to the sort field + # (for example, `name desc`). + # + # Only one sort field is permitted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/trace/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V1::TraceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V1::ListTracesRequest.new + # + # # Call the list_traces method. + # result = client.list_traces 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::Trace::V1::Trace. + # p item + # end + # + def list_traces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::ListTracesRequest + + # Converts hash 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_traces.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::Trace::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 + + 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_traces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_traces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.call_rpc :list_traces, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @trace_service_stub, :list_traces, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a single trace by its ID. + # + # @overload get_trace(request, options = nil) + # Pass arguments to `get_trace` via a request object, either of type + # {::Google::Cloud::Trace::V1::GetTraceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V1::GetTraceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_trace(project_id: nil, trace_id: nil) + # Pass arguments to `get_trace` via keyword arguments. Note that at + # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. + # @param trace_id [::String] + # Required. ID of the trace to return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Trace::V1::Trace] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Trace::V1::Trace] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/trace/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V1::TraceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V1::GetTraceRequest.new + # + # # Call the get_trace method. + # result = client.get_trace request + # + # # The returned object is of type Google::Cloud::Trace::V1::Trace. + # p result + # + def get_trace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::GetTraceRequest + + # Converts hash 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_trace.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::Trace::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.trace_id + header_params["trace_id"] = request.trace_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_trace.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_trace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.call_rpc :get_trace, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sends new traces to Stackdriver Trace or updates existing traces. If the ID + # of a trace that you send matches that of an existing trace, any fields + # in the existing trace and its spans are overwritten by the provided values, + # and any new fields provided are merged with the existing trace data. If the + # ID does not match, a new trace is created. + # + # @overload patch_traces(request, options = nil) + # Pass arguments to `patch_traces` via a request object, either of type + # {::Google::Cloud::Trace::V1::PatchTracesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V1::PatchTracesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload patch_traces(project_id: nil, traces: nil) + # Pass arguments to `patch_traces` via keyword arguments. Note that at + # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. + # @param traces [::Google::Cloud::Trace::V1::Traces, ::Hash] + # Required. The body of the message. + # + # @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/trace/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V1::TraceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V1::PatchTracesRequest.new + # + # # Call the patch_traces method. + # result = client.patch_traces request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def patch_traces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::PatchTracesRequest + + # Converts hash 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.patch_traces.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::Trace::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 + + 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.patch_traces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.patch_traces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.call_rpc :patch_traces, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TraceService API. + # + # This class represents the configuration for TraceService, + # 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::Trace::V1::TraceService::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_traces to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Trace::V1::TraceService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_traces.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_traces.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TraceService 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_traces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_traces + ## + # RPC-specific configuration for `get_trace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_trace + ## + # RPC-specific configuration for `patch_traces` + # @return [::Gapic::Config::Method] + # + attr_reader :patch_traces + + # @private + def initialize parent_rpcs = nil + list_traces_config = parent_rpcs.list_traces if parent_rpcs.respond_to? :list_traces + @list_traces = ::Gapic::Config::Method.new list_traces_config + get_trace_config = parent_rpcs.get_trace if parent_rpcs.respond_to? :get_trace + @get_trace = ::Gapic::Config::Method.new get_trace_config + patch_traces_config = parent_rpcs.patch_traces if parent_rpcs.respond_to? :patch_traces + @patch_traces = ::Gapic::Config::Method.new patch_traces_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb new file mode 100644 index 000000000000..b71df52a528b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V1 + module TraceService + # Credentials for the TraceService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.append", + "https://www.googleapis.com/auth/trace.readonly" + ] + self.env_vars = [ + "TRACE_CREDENTIALS", + "TRACE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TRACE_CREDENTIALS_JSON", + "TRACE_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-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb new file mode 100644 index 000000000000..5de97dd38be4 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/version" + +require "google/cloud/trace/v1/trace_service/credentials" +require "google/cloud/trace/v1/trace_service/rest/client" + +module Google + module Cloud + module Trace + module V1 + ## + # This file describes an API for collecting and viewing traces and spans + # within a trace. A Trace is a collection of spans corresponding to a single + # operation or set of operations for an application. A span is an individual + # timed event which forms a node of the trace tree. Spans for a single trace + # may span multiple services. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/trace/v1/trace_service/rest" + # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + module TraceService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/trace/v1/trace_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb new file mode 100644 index 000000000000..b3a5a3771116 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb @@ -0,0 +1,686 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" +require "google/cloud/trace/v1/trace_service/rest/service_stub" + +module Google + module Cloud + module Trace + module V1 + module TraceService + module Rest + ## + # REST client for the TraceService service. + # + # This file describes an API for collecting and viewing traces and spans + # within a trace. A Trace is a collection of spans corresponding to a single + # operation or set of operations for an application. A span is an individual + # timed event which forms a node of the trace tree. Spans for a single trace + # may span multiple services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :trace_service_stub + + ## + # Configure the TraceService Client class. + # + # See {::Google::Cloud::Trace::V1::TraceService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TraceService clients + # ::Google::Cloud::Trace::V1::TraceService::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", "Trace", "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.list_traces.timeout = 45.0 + default_config.rpcs.list_traces.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config.rpcs.get_trace.timeout = 45.0 + default_config.rpcs.get_trace.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config.rpcs.patch_traces.timeout = 45.0 + default_config.rpcs.patch_traces.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TraceService 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::Trace::V1::TraceService::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 + @trace_service_stub.universe_domain + end + + ## + # Create a new TraceService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TraceService 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 + + @trace_service_stub = ::Google::Cloud::Trace::V1::TraceService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @trace_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @trace_service_stub.logger + end + + # Service calls + + ## + # Returns of a list of traces that match the specified filter conditions. + # + # @overload list_traces(request, options = nil) + # Pass arguments to `list_traces` via a request object, either of type + # {::Google::Cloud::Trace::V1::ListTracesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V1::ListTracesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_traces(project_id: nil, view: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil, filter: nil, order_by: nil) + # Pass arguments to `list_traces` via keyword arguments. Note that at + # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. + # @param view [::Google::Cloud::Trace::V1::ListTracesRequest::ViewType] + # Optional. Type of data returned for traces in the list. Default is + # `MINIMAL`. + # @param page_size [::Integer] + # Optional. Maximum number of traces to return. If not specified or <= 0, the + # implementation selects a reasonable value. The implementation may + # return fewer traces than the requested page size. + # @param page_token [::String] + # Token identifying the page of results to return. If provided, use the + # value of the `next_page_token` field from a previous request. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Start of the time interval (inclusive) during which the trace data was + # collected from the application. + # @param end_time [::Google::Protobuf::Timestamp, ::Hash] + # End of the time interval (inclusive) during which the trace data was + # collected from the application. + # @param filter [::String] + # Optional. A filter against labels for the request. + # + # By default, searches use prefix matching. To specify exact match, prepend + # a plus symbol (`+`) to the search term. + # Multiple terms are ANDed. Syntax: + # + # * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root + # span starts with `NAME_PREFIX`. + # * `+root:NAME` or `+NAME`: Return traces where any root span's name is + # exactly `NAME`. + # * `span:NAME_PREFIX`: Return traces where any span starts with + # `NAME_PREFIX`. + # * `+span:NAME`: Return traces where any span's name is exactly + # `NAME`. + # * `latency:DURATION`: Return traces whose overall latency is + # greater or equal to than `DURATION`. Accepted units are nanoseconds + # (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For + # example, `latency:24ms` returns traces whose overall latency + # is greater than or equal to 24 milliseconds. + # * `label:LABEL_KEY`: Return all traces containing the specified + # label key (exact match, case-sensitive) regardless of the key:value + # pair's value (including empty values). + # * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified + # label key (exact match, case-sensitive) whose value starts with + # `VALUE_PREFIX`. Both a key and a value must be specified. + # * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair + # exactly matching the specified text. Both a key and a value must be + # specified. + # * `method:VALUE`: Equivalent to `/http/method:VALUE`. + # * `url:VALUE`: Equivalent to `/http/url:VALUE`. + # @param order_by [::String] + # Optional. Field used to sort the returned traces. + # Can be one of the following: + # + # * `trace_id` + # * `name` (`name` field of root span in the trace) + # * `duration` (difference between `end_time` and `start_time` fields of + # the root span) + # * `start` (`start_time` field of the root span) + # + # Descending order can be specified by appending `desc` to the sort field + # (for example, `name desc`). + # + # Only one sort field is permitted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/trace/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V1::ListTracesRequest.new + # + # # Call the list_traces method. + # result = client.list_traces 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::Trace::V1::Trace. + # p item + # end + # + def list_traces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::ListTracesRequest + + # Converts hash 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_traces.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::Trace::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_traces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_traces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.list_traces request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @trace_service_stub, :list_traces, "traces", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a single trace by its ID. + # + # @overload get_trace(request, options = nil) + # Pass arguments to `get_trace` via a request object, either of type + # {::Google::Cloud::Trace::V1::GetTraceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V1::GetTraceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_trace(project_id: nil, trace_id: nil) + # Pass arguments to `get_trace` via keyword arguments. Note that at + # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. + # @param trace_id [::String] + # Required. ID of the trace to return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Trace::V1::Trace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Trace::V1::Trace] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/trace/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V1::GetTraceRequest.new + # + # # Call the get_trace method. + # result = client.get_trace request + # + # # The returned object is of type Google::Cloud::Trace::V1::Trace. + # p result + # + def get_trace request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::GetTraceRequest + + # Converts hash 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_trace.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::Trace::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_trace.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_trace.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.get_trace request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sends new traces to Stackdriver Trace or updates existing traces. If the ID + # of a trace that you send matches that of an existing trace, any fields + # in the existing trace and its spans are overwritten by the provided values, + # and any new fields provided are merged with the existing trace data. If the + # ID does not match, a new trace is created. + # + # @overload patch_traces(request, options = nil) + # Pass arguments to `patch_traces` via a request object, either of type + # {::Google::Cloud::Trace::V1::PatchTracesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V1::PatchTracesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload patch_traces(project_id: nil, traces: nil) + # Pass arguments to `patch_traces` via keyword arguments. Note that at + # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. + # @param traces [::Google::Cloud::Trace::V1::Traces, ::Hash] + # Required. The body of the message. + # @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/trace/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V1::TraceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V1::PatchTracesRequest.new + # + # # Call the patch_traces method. + # result = client.patch_traces request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def patch_traces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::PatchTracesRequest + + # Converts hash 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.patch_traces.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::Trace::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.patch_traces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.patch_traces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.patch_traces request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TraceService REST API. + # + # This class represents the configuration for TraceService 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::Trace::V1::TraceService::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_traces to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Trace::V1::TraceService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_traces.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_traces.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TraceService 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_traces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_traces + ## + # RPC-specific configuration for `get_trace` + # @return [::Gapic::Config::Method] + # + attr_reader :get_trace + ## + # RPC-specific configuration for `patch_traces` + # @return [::Gapic::Config::Method] + # + attr_reader :patch_traces + + # @private + def initialize parent_rpcs = nil + list_traces_config = parent_rpcs.list_traces if parent_rpcs.respond_to? :list_traces + @list_traces = ::Gapic::Config::Method.new list_traces_config + get_trace_config = parent_rpcs.get_trace if parent_rpcs.respond_to? :get_trace + @get_trace = ::Gapic::Config::Method.new get_trace_config + patch_traces_config = parent_rpcs.patch_traces if parent_rpcs.respond_to? :patch_traces + @patch_traces = ::Gapic::Config::Method.new patch_traces_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb new file mode 100644 index 000000000000..68870f715db3 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb @@ -0,0 +1,266 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" + +module Google + module Cloud + module Trace + module V1 + module TraceService + module Rest + ## + # REST service stub for the TraceService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_traces REST call + # + # @param request_pb [::Google::Cloud::Trace::V1::ListTracesRequest] + # 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::Trace::V1::ListTracesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Trace::V1::ListTracesResponse] + # A result object deserialized from the server's reply + def list_traces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_traces_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, + method_name: "list_traces", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Trace::V1::ListTracesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_trace REST call + # + # @param request_pb [::Google::Cloud::Trace::V1::GetTraceRequest] + # 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::Trace::V1::Trace] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Trace::V1::Trace] + # A result object deserialized from the server's reply + def get_trace request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_trace_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, + method_name: "get_trace", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Trace::V1::Trace.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the patch_traces REST call + # + # @param request_pb [::Google::Cloud::Trace::V1::PatchTracesRequest] + # 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 patch_traces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_patch_traces_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, + method_name: "patch_traces", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_traces REST call + # + # @param request_pb [::Google::Cloud::Trace::V1::ListTracesRequest] + # 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_traces_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/projects/{project_id}/traces", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_trace REST call + # + # @param request_pb [::Google::Cloud::Trace::V1::GetTraceRequest] + # 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_trace_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/projects/{project_id}/traces/{trace_id}", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["trace_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the patch_traces REST call + # + # @param request_pb [::Google::Cloud::Trace::V1::PatchTracesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_patch_traces_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/projects/{project_id}/traces", + body: "traces", + matches: [ + ["project_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb new file mode 100644 index 000000000000..57e91ef8eec8 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb new file mode 100644 index 000000000000..dc5fca602562 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/devtools/cloudtrace/v1/trace.proto + +require 'google/protobuf' + +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' +require 'google/api/annotations_pb' + + +descriptor_data = "\n)google/devtools/cloudtrace/v1/trace.proto\x12\x1dgoogle.devtools.cloudtrace.v1\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto\"f\n\x05Trace\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x10\n\x08trace_id\x18\x02 \x01(\t\x12\x37\n\x05spans\x18\x03 \x03(\x0b\x32(.google.devtools.cloudtrace.v1.TraceSpan\">\n\x06Traces\x12\x34\n\x06traces\x18\x01 \x03(\x0b\x32$.google.devtools.cloudtrace.v1.Trace\"\xa2\x03\n\tTraceSpan\x12\x0f\n\x07span_id\x18\x01 \x01(\x06\x12?\n\x04kind\x18\x02 \x01(\x0e\x32\x31.google.devtools.cloudtrace.v1.TraceSpan.SpanKind\x12\x0c\n\x04name\x18\x03 \x01(\t\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x0eparent_span_id\x18\x06 \x01(\x06\x42\x03\xe0\x41\x01\x12\x44\n\x06labels\x18\x07 \x03(\x0b\x32\x34.google.devtools.cloudtrace.v1.TraceSpan.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x0e\n\nRPC_SERVER\x10\x01\x12\x0e\n\nRPC_CLIENT\x10\x02\"\x80\x03\n\x11ListTracesRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x04view\x18\x02 \x01(\x0e\x32\x39.google.devtools.cloudtrace.v1.ListTracesRequest.ViewTypeB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x04 \x01(\t\x12.\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x06\x66ilter\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x08 \x01(\tB\x03\xe0\x41\x01\"N\n\x08ViewType\x12\x19\n\x15VIEW_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MINIMAL\x10\x01\x12\x0c\n\x08ROOTSPAN\x10\x02\x12\x0c\n\x08\x43OMPLETE\x10\x03\"c\n\x12ListTracesResponse\x12\x34\n\x06traces\x18\x01 \x03(\x0b\x32$.google.devtools.cloudtrace.v1.Trace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"A\n\x0fGetTraceRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08trace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"i\n\x12PatchTracesRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06traces\x18\x02 \x01(\x0b\x32%.google.devtools.cloudtrace.v1.TracesB\x03\xe0\x41\x02\x32\xb5\x05\n\x0cTraceService\x12\xa8\x01\n\nListTraces\x12\x30.google.devtools.cloudtrace.v1.ListTracesRequest\x1a\x31.google.devtools.cloudtrace.v1.ListTracesResponse\"5\xda\x41\nproject_id\x82\xd3\xe4\x93\x02\"\x12 /v1/projects/{project_id}/traces\x12\xab\x01\n\x08GetTrace\x12..google.devtools.cloudtrace.v1.GetTraceRequest\x1a$.google.devtools.cloudtrace.v1.Trace\"I\xda\x41\x13project_id,trace_id\x82\xd3\xe4\x93\x02-\x12+/v1/projects/{project_id}/traces/{trace_id}\x12\x9e\x01\n\x0bPatchTraces\x12\x31.google.devtools.cloudtrace.v1.PatchTracesRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x11project_id,traces\x82\xd3\xe4\x93\x02*2 /v1/projects/{project_id}/traces:\x06traces\x1a\xaa\x01\xca\x41\x19\x63loudtrace.googleapis.com\xd2\x41\x8a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/trace.readonlyB\xad\x01\n!com.google.devtools.cloudtrace.v1B\nTraceProtoP\x01Z/cloud.google.com/go/trace/apiv1/tracepb;tracepb\xaa\x02\x15Google.Cloud.Trace.V1\xca\x02\x15Google\\Cloud\\Trace\\V1\xea\x02\x18Google::Cloud::Trace::V1b\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 Trace + module V1 + Trace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Trace").msgclass + Traces = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Traces").msgclass + TraceSpan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan").msgclass + TraceSpan::SpanKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan.SpanKind").enummodule + ListTracesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest").msgclass + ListTracesRequest::ViewType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest.ViewType").enummodule + ListTracesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesResponse").msgclass + GetTraceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.GetTraceRequest").msgclass + PatchTracesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.PatchTracesRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb new file mode 100644 index 000000000000..56320be47991 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/devtools/cloudtrace/v1/trace.proto for package 'Google.Cloud.Trace.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/devtools/cloudtrace/v1/trace_pb' + +module Google + module Cloud + module Trace + module V1 + module TraceService + # This file describes an API for collecting and viewing traces and spans + # within a trace. A Trace is a collection of spans corresponding to a single + # operation or set of operations for an application. A span is an individual + # timed event which forms a node of the trace tree. Spans for a single trace + # may span multiple services. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.devtools.cloudtrace.v1.TraceService' + + # Returns of a list of traces that match the specified filter conditions. + rpc :ListTraces, ::Google::Cloud::Trace::V1::ListTracesRequest, ::Google::Cloud::Trace::V1::ListTracesResponse + # Gets a single trace by its ID. + rpc :GetTrace, ::Google::Cloud::Trace::V1::GetTraceRequest, ::Google::Cloud::Trace::V1::Trace + # Sends new traces to Stackdriver Trace or updates existing traces. If the ID + # of a trace that you send matches that of an existing trace, any fields + # in the existing trace and its spans are overwritten by the provided values, + # and any new fields provided are merged with the existing trace data. If the + # ID does not match, a new trace is created. + rpc :PatchTraces, ::Google::Cloud::Trace::V1::PatchTracesRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md new file mode 100644 index 000000000000..8f04d0cc9e5b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Trace V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-trace-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb new file mode 100644 index 000000000000..f10fa9094e2d --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb @@ -0,0 +1,287 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V1 + # A trace describes how long it takes for an application to perform an + # operation. It consists of a set of spans, each of which represent a single + # timed event within the operation. + # @!attribute [rw] project_id + # @return [::String] + # Project ID of the Cloud project where the trace data is stored. + # @!attribute [rw] trace_id + # @return [::String] + # Globally unique identifier for the trace. This identifier is a 128-bit + # numeric value formatted as a 32-byte hex string. For example, + # `382d4f4c6b7bb2f4a972559d9085001d`. + # @!attribute [rw] spans + # @return [::Array<::Google::Cloud::Trace::V1::TraceSpan>] + # Collection of spans in the trace. + class Trace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of new or updated traces. + # @!attribute [rw] traces + # @return [::Array<::Google::Cloud::Trace::V1::Trace>] + # List of traces. + class Traces + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A span represents a single timed event within a trace. Spans can be nested + # and form a trace tree. Often, a trace contains a root span that describes the + # end-to-end latency of an operation and, optionally, one or more subspans for + # its suboperations. Spans do not need to be contiguous. There may be gaps + # between spans in a trace. + # @!attribute [rw] span_id + # @return [::Integer] + # Identifier for the span. Must be a 64-bit integer other than 0 and + # unique within a trace. For example, `2205310701640571284`. + # @!attribute [rw] kind + # @return [::Google::Cloud::Trace::V1::TraceSpan::SpanKind] + # Distinguishes between spans generated in a particular context. For example, + # two spans with the same name may be distinguished using `RPC_CLIENT` + # and `RPC_SERVER` to identify queueing latency associated with the span. + # @!attribute [rw] name + # @return [::String] + # Name of the span. Must be less than 128 bytes. The span name is sanitized + # and displayed in the Stackdriver Trace tool in the + # Google Cloud Platform Console. + # The name may be a method name or some other per-call site name. + # For the same executable and the same call point, a best practice is + # to use a consistent name, which makes it easier to correlate + # cross-trace spans. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start time of the span in nanoseconds from the UNIX epoch. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End time of the span in nanoseconds from the UNIX epoch. + # @!attribute [rw] parent_span_id + # @return [::Integer] + # Optional. ID of the parent span, if any. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Collection of labels associated with the span. Label keys must be less than + # 128 bytes. Label values must be less than 16 kilobytes (10MB for + # `/stacktrace` values). + # + # Some predefined label keys exist, or you may create your own. When creating + # your own, we recommend the following formats: + # + # * `/category/product/key` for agents of well-known products (e.g. + # `/db/mongodb/read_size`). + # * `short_host/path/key` for domain-specific keys (e.g. + # `foo.com/myproduct/bar`) + # + # Predefined labels include: + # + # * `/agent` + # * `/component` + # * `/error/message` + # * `/error/name` + # * `/http/client_city` + # * `/http/client_country` + # * `/http/client_protocol` + # * `/http/client_region` + # * `/http/host` + # * `/http/method` + # * `/http/path` + # * `/http/redirected_url` + # * `/http/request/size` + # * `/http/response/size` + # * `/http/route` + # * `/http/status_code` + # * `/http/url` + # * `/http/user_agent` + # * `/pid` + # * `/stacktrace` + # * `/tid` + class TraceSpan + 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 + + # Type of span. Can be used to specify additional relationships between spans + # in addition to a parent/child relationship. + module SpanKind + # Unspecified. + SPAN_KIND_UNSPECIFIED = 0 + + # Indicates that the span covers server-side handling of an RPC or other + # remote network request. + RPC_SERVER = 1 + + # Indicates that the span covers the client-side wrapper around an RPC or + # other remote request. + RPC_CLIENT = 2 + end + end + + # The request message for the `ListTraces` method. All fields are required + # unless specified. + # @!attribute [rw] project_id + # @return [::String] + # Required. ID of the Cloud project where the trace data is stored. + # @!attribute [rw] view + # @return [::Google::Cloud::Trace::V1::ListTracesRequest::ViewType] + # Optional. Type of data returned for traces in the list. Default is + # `MINIMAL`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of traces to return. If not specified or <= 0, the + # implementation selects a reasonable value. The implementation may + # return fewer traces than the requested page size. + # @!attribute [rw] page_token + # @return [::String] + # Token identifying the page of results to return. If provided, use the + # value of the `next_page_token` field from a previous request. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start of the time interval (inclusive) during which the trace data was + # collected from the application. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End of the time interval (inclusive) during which the trace data was + # collected from the application. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter against labels for the request. + # + # By default, searches use prefix matching. To specify exact match, prepend + # a plus symbol (`+`) to the search term. + # Multiple terms are ANDed. Syntax: + # + # * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root + # span starts with `NAME_PREFIX`. + # * `+root:NAME` or `+NAME`: Return traces where any root span's name is + # exactly `NAME`. + # * `span:NAME_PREFIX`: Return traces where any span starts with + # `NAME_PREFIX`. + # * `+span:NAME`: Return traces where any span's name is exactly + # `NAME`. + # * `latency:DURATION`: Return traces whose overall latency is + # greater or equal to than `DURATION`. Accepted units are nanoseconds + # (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For + # example, `latency:24ms` returns traces whose overall latency + # is greater than or equal to 24 milliseconds. + # * `label:LABEL_KEY`: Return all traces containing the specified + # label key (exact match, case-sensitive) regardless of the key:value + # pair's value (including empty values). + # * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified + # label key (exact match, case-sensitive) whose value starts with + # `VALUE_PREFIX`. Both a key and a value must be specified. + # * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair + # exactly matching the specified text. Both a key and a value must be + # specified. + # * `method:VALUE`: Equivalent to `/http/method:VALUE`. + # * `url:VALUE`: Equivalent to `/http/url:VALUE`. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Field used to sort the returned traces. + # Can be one of the following: + # + # * `trace_id` + # * `name` (`name` field of root span in the trace) + # * `duration` (difference between `end_time` and `start_time` fields of + # the root span) + # * `start` (`start_time` field of the root span) + # + # Descending order can be specified by appending `desc` to the sort field + # (for example, `name desc`). + # + # Only one sort field is permitted. + class ListTracesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of data returned for traces in the list. + module ViewType + # Default is `MINIMAL` if unspecified. + VIEW_TYPE_UNSPECIFIED = 0 + + # Minimal view of the trace record that contains only the project + # and trace IDs. + MINIMAL = 1 + + # Root span view of the trace record that returns the root spans along + # with the minimal trace data. + ROOTSPAN = 2 + + # Complete view of the trace record that contains the actual trace data. + # This is equivalent to calling the REST `get` or RPC `GetTrace` method + # using the ID of each listed trace. + COMPLETE = 3 + end + end + + # The response message for the `ListTraces` method. + # @!attribute [rw] traces + # @return [::Array<::Google::Cloud::Trace::V1::Trace>] + # List of trace records as specified by the view parameter. + # @!attribute [rw] next_page_token + # @return [::String] + # If defined, indicates that there are more traces that match the request + # and that this value should be passed to the next request to continue + # retrieving additional traces. + class ListTracesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the `GetTrace` method. + # @!attribute [rw] project_id + # @return [::String] + # Required. ID of the Cloud project where the trace data is stored. + # @!attribute [rw] trace_id + # @return [::String] + # Required. ID of the trace to return. + class GetTraceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the `PatchTraces` method. + # @!attribute [rw] project_id + # @return [::String] + # Required. ID of the Cloud project where the trace data is stored. + # @!attribute [rw] traces + # @return [::Google::Cloud::Trace::V1::Traces] + # Required. The body of the message. + class PatchTracesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile new file mode 100644 index 000000000000..c09bc4f74260 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1", path: "../" +else + gem "google-cloud-trace-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-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json b/owl-bot-staging/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json new file mode 100644 index 000000000000..314aca148ab2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json @@ -0,0 +1,135 @@ +{ + "client_library": { + "name": "google-cloud-trace-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.devtools.cloudtrace.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudtrace_v1_generated_TraceService_ListTraces_sync", + "title": "Snippet for the list_traces call in the TraceService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V1::TraceService::Client#list_traces.", + "file": "trace_service/list_traces.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_traces", + "full_name": "::Google::Cloud::Trace::V1::TraceService::Client#list_traces", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Trace::V1::ListTracesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Trace::V1::ListTracesResponse", + "client": { + "short_name": "TraceService::Client", + "full_name": "::Google::Cloud::Trace::V1::TraceService::Client" + }, + "method": { + "short_name": "ListTraces", + "full_name": "google.devtools.cloudtrace.v1.TraceService.ListTraces", + "service": { + "short_name": "TraceService", + "full_name": "google.devtools.cloudtrace.v1.TraceService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtrace_v1_generated_TraceService_GetTrace_sync", + "title": "Snippet for the get_trace call in the TraceService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V1::TraceService::Client#get_trace.", + "file": "trace_service/get_trace.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_trace", + "full_name": "::Google::Cloud::Trace::V1::TraceService::Client#get_trace", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Trace::V1::GetTraceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Trace::V1::Trace", + "client": { + "short_name": "TraceService::Client", + "full_name": "::Google::Cloud::Trace::V1::TraceService::Client" + }, + "method": { + "short_name": "GetTrace", + "full_name": "google.devtools.cloudtrace.v1.TraceService.GetTrace", + "service": { + "short_name": "TraceService", + "full_name": "google.devtools.cloudtrace.v1.TraceService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtrace_v1_generated_TraceService_PatchTraces_sync", + "title": "Snippet for the patch_traces call in the TraceService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V1::TraceService::Client#patch_traces.", + "file": "trace_service/patch_traces.rb", + "language": "RUBY", + "client_method": { + "short_name": "patch_traces", + "full_name": "::Google::Cloud::Trace::V1::TraceService::Client#patch_traces", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Trace::V1::PatchTracesRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TraceService::Client", + "full_name": "::Google::Cloud::Trace::V1::TraceService::Client" + }, + "method": { + "short_name": "PatchTraces", + "full_name": "google.devtools.cloudtrace.v1.TraceService.PatchTraces", + "service": { + "short_name": "TraceService", + "full_name": "google.devtools.cloudtrace.v1.TraceService" + } + } + }, + "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-trace-v1/snippets/trace_service/get_trace.rb b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/get_trace.rb new file mode 100644 index 000000000000..cda36e0edbd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/get_trace.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v1_generated_TraceService_GetTrace_sync] +require "google/cloud/trace/v1" + +## +# Snippet for the get_trace call in the TraceService 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::Trace::V1::TraceService::Client#get_trace. +# +def get_trace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V1::TraceService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V1::GetTraceRequest.new + + # Call the get_trace method. + result = client.get_trace request + + # The returned object is of type Google::Cloud::Trace::V1::Trace. + p result +end +# [END cloudtrace_v1_generated_TraceService_GetTrace_sync] diff --git a/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb new file mode 100644 index 000000000000..17cca45ee65e --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v1_generated_TraceService_ListTraces_sync] +require "google/cloud/trace/v1" + +## +# Snippet for the list_traces call in the TraceService 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::Trace::V1::TraceService::Client#list_traces. +# +def list_traces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V1::TraceService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V1::ListTracesRequest.new + + # Call the list_traces method. + result = client.list_traces 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::Trace::V1::Trace. + p item + end +end +# [END cloudtrace_v1_generated_TraceService_ListTraces_sync] diff --git a/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb new file mode 100644 index 000000000000..1a9f634e125c --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v1_generated_TraceService_PatchTraces_sync] +require "google/cloud/trace/v1" + +## +# Snippet for the patch_traces call in the TraceService 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::Trace::V1::TraceService::Client#patch_traces. +# +def patch_traces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V1::TraceService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V1::PatchTracesRequest.new + + # Call the patch_traces method. + result = client.patch_traces request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtrace_v1_generated_TraceService_PatchTraces_sync] diff --git a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb new file mode 100644 index 000000000000..600d2460da19 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb @@ -0,0 +1,270 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" +require "google/cloud/trace/v1/trace_service/rest" + + +class ::Google::Cloud::Trace::V1::TraceService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_traces + # Create test objects. + client_result = ::Google::Cloud::Trace::V1::ListTracesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + view = :VIEW_TYPE_UNSPECIFIED + page_size = 42 + page_token = "hello world" + start_time = {} + end_time = {} + filter = "hello world" + order_by = "hello world" + + list_traces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Trace::V1::TraceService::Rest::ServiceStub.stub :transcode_list_traces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_traces_client_stub do + # Create client + client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_traces project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_traces ::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces(::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces_client_stub.call_count + end + end + end + + def test_get_trace + # Create test objects. + client_result = ::Google::Cloud::Trace::V1::Trace.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + trace_id = "hello world" + + get_trace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Trace::V1::TraceService::Rest::ServiceStub.stub :transcode_get_trace_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_trace_client_stub do + # Create client + client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_trace({ project_id: project_id, trace_id: trace_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_trace project_id: project_id, trace_id: trace_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_trace ::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_trace({ project_id: project_id, trace_id: trace_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_trace(::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_trace_client_stub.call_count + end + end + end + + def test_patch_traces + # 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" + traces = {} + + patch_traces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Trace::V1::TraceService::Rest::ServiceStub.stub :transcode_patch_traces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, patch_traces_client_stub do + # Create client + client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.patch_traces({ project_id: project_id, traces: traces }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.patch_traces project_id: project_id, traces: traces do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.patch_traces ::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.patch_traces({ project_id: project_id, traces: traces }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.patch_traces(::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, patch_traces_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::Trace::V1::TraceService::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::Trace::V1::TraceService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb new file mode 100644 index 000000000000..cf06253597e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb @@ -0,0 +1,301 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" +require "google/cloud/trace/v1/trace_service" + +class ::Google::Cloud::Trace::V1::TraceService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_traces + # Create GRPC objects. + grpc_response = ::Google::Cloud::Trace::V1::ListTracesResponse.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" + view = :VIEW_TYPE_UNSPECIFIED + page_size = 42 + page_token = "hello world" + start_time = {} + end_time = {} + filter = "hello world" + order_by = "hello world" + + list_traces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_traces, name + assert_kind_of ::Google::Cloud::Trace::V1::ListTracesRequest, request + assert_equal "hello world", request["project_id"] + assert_equal :VIEW_TYPE_UNSPECIFIED, request["view"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["end_time"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_traces_client_stub do + # Create client + client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces ::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces(::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces_client_stub.call_rpc_count + end + end + + def test_get_trace + # Create GRPC objects. + grpc_response = ::Google::Cloud::Trace::V1::Trace.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" + trace_id = "hello world" + + get_trace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_trace, name + assert_kind_of ::Google::Cloud::Trace::V1::GetTraceRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["trace_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_trace_client_stub do + # Create client + client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_trace({ project_id: project_id, trace_id: trace_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_trace project_id: project_id, trace_id: trace_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_trace ::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_trace({ project_id: project_id, trace_id: trace_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_trace(::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_trace_client_stub.call_rpc_count + end + end + + def test_patch_traces + # 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" + traces = {} + + patch_traces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :patch_traces, name + assert_kind_of ::Google::Cloud::Trace::V1::PatchTracesRequest, request + assert_equal "hello world", request["project_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V1::Traces), request["traces"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, patch_traces_client_stub do + # Create client + client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.patch_traces({ project_id: project_id, traces: traces }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.patch_traces project_id: project_id, traces: traces do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.patch_traces ::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.patch_traces({ project_id: project_id, traces: traces }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.patch_traces(::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, patch_traces_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::Trace::V1::TraceService::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::Trace::V1::TraceService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Trace::V1::TraceService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v1/test/helper.rb b/owl-bot-staging/google-cloud-trace-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-trace-v2/.gitignore b/owl-bot-staging/google-cloud-trace-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/.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-trace-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-trace-v2/.repo-metadata.json new file mode 100644 index 000000000000..67811910934d --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "cloudtrace.googleapis.com", + "api_shortname": "cloudtrace", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v2/latest", + "distribution_name": "google-cloud-trace-v2", + "is_cloud": true, + "language": "ruby", + "name": "cloudtrace", + "name_pretty": "Cloud Trace V2 API", + "product_documentation": "https://cloud.google.com/trace", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TRACE", + "ruby-cloud-product-url": "https://cloud.google.com/trace", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-trace-v2/.rubocop.yml b/owl-bot-staging/google-cloud-trace-v2/.rubocop.yml new file mode 100644 index 000000000000..f3216e912f4e --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-trace-v2.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-trace-v2.rb" diff --git a/owl-bot-staging/google-cloud-trace-v2/.toys.rb b/owl-bot-staging/google-cloud-trace-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/.yardopts b/owl-bot-staging/google-cloud-trace-v2/.yardopts new file mode 100644 index 000000000000..6c8fa994b18f --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Trace V2 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-trace-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-trace-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..cd2b7cadfb3d --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-trace-v2 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-trace-v2 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/trace/v2" + +client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/trace/v2" + +::Google::Cloud::Trace::V2::TraceService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Trace::V2::TraceService::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-trace-v2 +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/trace/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Trace::V2::TraceService::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-trace-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-trace-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-trace-v2/Gemfile b/owl-bot-staging/google-cloud-trace-v2/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-trace-v2/LICENSE.md b/owl-bot-staging/google-cloud-trace-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/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-trace-v2/README.md b/owl-bot-staging/google-cloud-trace-v2/README.md new file mode 100644 index 000000000000..1ff702d96ad8 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Trace V2 API + +Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry. + +The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. + +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 Trace V2 API. Most users should consider using +the main client gem, +[google-cloud-trace](https://rubygems.org/gems/google-cloud-trace). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-trace-v2 +``` + +## 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/cloudtrace.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/trace/v2" + +client = ::Google::Cloud::Trace::V2::TraceService::Client.new +request = ::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new # (request fields as keyword arguments...) +response = client.batch_write_spans request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/trace) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/trace/v2" +require "logger" + +client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-trace`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-trace-v2`. +_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-trace`. +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-trace-v2`. + +### 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-trace-v2/Rakefile b/owl-bot-staging/google-cloud-trace-v2/Rakefile new file mode 100644 index 000000000000..010c4e0623c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TRACE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TRACE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TRACE_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 TRACE_TEST_PROJECT=test123 TRACE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/trace/v2/trace_service/credentials" + ::Google::Cloud::Trace::V2::TraceService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TRACE_PROJECT"] = project + ENV["TRACE_TEST_PROJECT"] = project + ENV["TRACE_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-trace-v2 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-trace-v2 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-trace-v2 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-trace-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-trace-v2" + header "google-cloud-trace-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-trace-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-trace-v2 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-trace-v2 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-trace-v2 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-trace-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-trace-v2/gapic_metadata.json new file mode 100644 index 000000000000..9cd82cbd9ba1 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/gapic_metadata.json @@ -0,0 +1,28 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.devtools.cloudtrace.v2", + "libraryPackage": "::Google::Cloud::Trace::V2", + "services": { + "TraceService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Trace::V2::TraceService::Client", + "rpcs": { + "BatchWriteSpans": { + "methods": [ + "batch_write_spans" + ] + }, + "CreateSpan": { + "methods": [ + "create_span" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec b/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec new file mode 100644 index 000000000000..d057b30781c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/trace/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-trace-v2" + gem.version = Google::Cloud::Trace::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details." + gem.summary = "Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb new file mode 100644 index 000000000000..f27f8272e44b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2" diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb new file mode 100644 index 000000000000..c1e11a6a5167 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/trace_service" +require "google/cloud/trace/v2/version" + +module Google + module Cloud + module Trace + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/trace/v2" + # client = ::Google::Cloud::Trace::V2::TraceService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/trace/v2" + # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/trace/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb new file mode 100644 index 000000000000..531187513daf --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/trace_service/rest" +require "google/cloud/trace/v2/version" + +module Google + module Cloud + module Trace + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/trace/v2/rest" + # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb new file mode 100644 index 000000000000..71726f38d623 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/version" + +require "google/cloud/trace/v2/trace_service/credentials" +require "google/cloud/trace/v2/trace_service/paths" +require "google/cloud/trace/v2/trace_service/client" +require "google/cloud/trace/v2/trace_service/rest" + +module Google + module Cloud + module Trace + module V2 + ## + # Service for collecting and viewing traces and spans within a trace. + # + # A trace is a collection of spans corresponding to a single + # operation or a set of operations in an application. + # + # A span is an individual timed event which forms a node of the trace tree. + # A single trace can contain spans from multiple services. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/trace/v2/trace_service" + # client = ::Google::Cloud::Trace::V2::TraceService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/trace/v2/trace_service/rest" + # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new + # + module TraceService + end + end + end + end +end + +helper_path = ::File.join __dir__, "trace_service", "helpers.rb" +require "google/cloud/trace/v2/trace_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb new file mode 100644 index 000000000000..1f59d76e257f --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb @@ -0,0 +1,643 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" + +module Google + module Cloud + module Trace + module V2 + module TraceService + ## + # Client for the TraceService service. + # + # Service for collecting and viewing traces and spans within a trace. + # + # A trace is a collection of spans corresponding to a single + # operation or a set of operations in an application. + # + # A span is an individual timed event which forms a node of the trace tree. + # A single trace can contain spans from multiple services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :trace_service_stub + + ## + # Configure the TraceService Client class. + # + # See {::Google::Cloud::Trace::V2::TraceService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TraceService clients + # ::Google::Cloud::Trace::V2::TraceService::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", "Trace", "V2"] + 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.batch_write_spans.timeout = 120.0 + default_config.rpcs.batch_write_spans.retry_policy = { + initial_delay: 0.1, max_delay: 30.0, multiplier: 2, retry_codes: [14, 4] + } + + default_config.rpcs.create_span.timeout = 120.0 + default_config.rpcs.create_span.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TraceService 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::Trace::V2::TraceService::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 + @trace_service_stub.universe_domain + end + + ## + # Create a new TraceService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Trace::V2::TraceService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TraceService 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/devtools/cloudtrace/v2/tracing_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 + + @trace_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Trace::V2::TraceService::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, + logger: @config.logger + ) + + @trace_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @trace_service_stub.logger + end + + # Service calls + + ## + # Batch writes new spans to new or existing traces. You cannot update + # existing spans. + # + # @overload batch_write_spans(request, options = nil) + # Pass arguments to `batch_write_spans` via a request object, either of type + # {::Google::Cloud::Trace::V2::BatchWriteSpansRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V2::BatchWriteSpansRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_write_spans(name: nil, spans: nil) + # Pass arguments to `batch_write_spans` via keyword arguments. Note that at + # least one keyword argument is 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 project where the spans belong. The format is + # `projects/[PROJECT_ID]`. + # @param spans [::Array<::Google::Cloud::Trace::V2::Span, ::Hash>] + # Required. A list of new spans. The span names must not match existing + # spans, otherwise the results are undefined. + # + # @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/trace/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V2::TraceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new + # + # # Call the batch_write_spans method. + # result = client.batch_write_spans request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def batch_write_spans request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::BatchWriteSpansRequest + + # Converts hash 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.batch_write_spans.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::Trace::V2::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.batch_write_spans.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_write_spans.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.call_rpc :batch_write_spans, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new span. + # + # @overload create_span(request, options = nil) + # Pass arguments to `create_span` via a request object, either of type + # {::Google::Cloud::Trace::V2::Span} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V2::Span, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_span(name: nil, span_id: nil, parent_span_id: nil, display_name: nil, start_time: nil, end_time: nil, attributes: nil, stack_trace: nil, time_events: nil, links: nil, status: nil, same_process_as_parent_span: nil, child_span_count: nil, span_kind: nil) + # Pass arguments to `create_span` via keyword arguments. Note that at + # least one keyword argument is 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 span in the following format: + # + # * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` + # + # `[TRACE_ID]` is a unique identifier for a trace within a project; + # it is a 32-character hexadecimal encoding of a 16-byte array. It should + # not be zero. + # + # `[SPAN_ID]` is a unique identifier for a span within a trace; it + # is a 16-character hexadecimal encoding of an 8-byte array. It should not + # be zero. + # . + # @param span_id [::String] + # Required. The `[SPAN_ID]` portion of the span's resource name. + # @param parent_span_id [::String] + # The `[SPAN_ID]` of this span's parent span. If this is a root span, + # then this field must be empty. + # @param display_name [::Google::Cloud::Trace::V2::TruncatableString, ::Hash] + # Required. A description of the span's operation (up to 128 bytes). + # Cloud Trace displays the description in the + # Cloud console. + # For example, the display name can be a qualified method name or a file name + # and a line number where the operation is called. A best practice is to use + # the same display name within an application and at the same call point. + # This makes it easier to correlate spans in different traces. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The start time of the span. On the client side, this is the time + # kept by the local machine where the span execution starts. On the server + # side, this is the time when the server's application handler starts + # running. + # @param end_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The end time of the span. On the client side, this is the time + # kept by the local machine where the span execution ends. On the server + # side, this is the time when the server application handler stops running. + # @param attributes [::Google::Cloud::Trace::V2::Span::Attributes, ::Hash] + # A set of attributes on the span. You can have up to 32 attributes per + # span. + # @param stack_trace [::Google::Cloud::Trace::V2::StackTrace, ::Hash] + # Stack trace captured at the start of the span. + # @param time_events [::Google::Cloud::Trace::V2::Span::TimeEvents, ::Hash] + # A set of time events. You can have up to 32 annotations and 128 message + # events per span. + # @param links [::Google::Cloud::Trace::V2::Span::Links, ::Hash] + # Links associated with the span. You can have up to 128 links per Span. + # @param status [::Google::Rpc::Status, ::Hash] + # Optional. The final status for this span. + # @param same_process_as_parent_span [::Google::Protobuf::BoolValue, ::Hash] + # Optional. Set this parameter to indicate whether this span is in + # the same process as its parent. If you do not set this parameter, + # Trace is unable to take advantage of this helpful information. + # @param child_span_count [::Google::Protobuf::Int32Value, ::Hash] + # Optional. The number of child spans that were generated while this span + # was active. If set, allows implementation to detect missing child spans. + # @param span_kind [::Google::Cloud::Trace::V2::Span::SpanKind] + # Optional. Distinguishes between spans generated in a particular context. + # For example, two spans with the same name may be distinguished using + # `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Trace::V2::Span] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Trace::V2::Span] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/trace/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V2::TraceService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V2::Span.new + # + # # Call the create_span method. + # result = client.create_span request + # + # # The returned object is of type Google::Cloud::Trace::V2::Span. + # p result + # + def create_span request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::Span + + # Converts hash 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_span.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::Trace::V2::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.create_span.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_span.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.call_rpc :create_span, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TraceService API. + # + # This class represents the configuration for TraceService, + # 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::Trace::V2::TraceService::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 + # # batch_write_spans to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Trace::V2::TraceService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_write_spans.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_write_spans.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TraceService 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 `batch_write_spans` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_write_spans + ## + # RPC-specific configuration for `create_span` + # @return [::Gapic::Config::Method] + # + attr_reader :create_span + + # @private + def initialize parent_rpcs = nil + batch_write_spans_config = parent_rpcs.batch_write_spans if parent_rpcs.respond_to? :batch_write_spans + @batch_write_spans = ::Gapic::Config::Method.new batch_write_spans_config + create_span_config = parent_rpcs.create_span if parent_rpcs.respond_to? :create_span + @create_span = ::Gapic::Config::Method.new create_span_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb new file mode 100644 index 000000000000..db91afb17b6c --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V2 + module TraceService + # Credentials for the TraceService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/trace.append" + ] + self.env_vars = [ + "TRACE_CREDENTIALS", + "TRACE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TRACE_CREDENTIALS_JSON", + "TRACE_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-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb new file mode 100644 index 000000000000..25d2b38e26ac --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V2 + module TraceService + # Path helper methods for the TraceService API. + module Paths + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Span resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/traces/{trace}/spans/{span}` + # + # @param project [String] + # @param trace [String] + # @param span [String] + # + # @return [::String] + def span_path project:, trace:, span: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "trace cannot contain /" if trace.to_s.include? "/" + + "projects/#{project}/traces/#{trace}/spans/#{span}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb new file mode 100644 index 000000000000..0f21f9aa2181 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/version" + +require "google/cloud/trace/v2/trace_service/credentials" +require "google/cloud/trace/v2/trace_service/paths" +require "google/cloud/trace/v2/trace_service/rest/client" + +module Google + module Cloud + module Trace + module V2 + ## + # Service for collecting and viewing traces and spans within a trace. + # + # A trace is a collection of spans corresponding to a single + # operation or a set of operations in an application. + # + # A span is an individual timed event which forms a node of the trace tree. + # A single trace can contain spans from multiple services. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/trace/v2/trace_service/rest" + # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new + # + module TraceService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/trace/v2/trace_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb new file mode 100644 index 000000000000..a96278916b0a --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb @@ -0,0 +1,586 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" +require "google/cloud/trace/v2/trace_service/rest/service_stub" + +module Google + module Cloud + module Trace + module V2 + module TraceService + module Rest + ## + # REST client for the TraceService service. + # + # Service for collecting and viewing traces and spans within a trace. + # + # A trace is a collection of spans corresponding to a single + # operation or a set of operations in an application. + # + # A span is an individual timed event which forms a node of the trace tree. + # A single trace can contain spans from multiple services. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :trace_service_stub + + ## + # Configure the TraceService Client class. + # + # See {::Google::Cloud::Trace::V2::TraceService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TraceService clients + # ::Google::Cloud::Trace::V2::TraceService::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", "Trace", "V2"] + 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.batch_write_spans.timeout = 120.0 + default_config.rpcs.batch_write_spans.retry_policy = { + initial_delay: 0.1, max_delay: 30.0, multiplier: 2, retry_codes: [14, 4] + } + + default_config.rpcs.create_span.timeout = 120.0 + default_config.rpcs.create_span.retry_policy = { + initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TraceService 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::Trace::V2::TraceService::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 + @trace_service_stub.universe_domain + end + + ## + # Create a new TraceService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TraceService 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 + + @trace_service_stub = ::Google::Cloud::Trace::V2::TraceService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @trace_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @trace_service_stub.logger + end + + # Service calls + + ## + # Batch writes new spans to new or existing traces. You cannot update + # existing spans. + # + # @overload batch_write_spans(request, options = nil) + # Pass arguments to `batch_write_spans` via a request object, either of type + # {::Google::Cloud::Trace::V2::BatchWriteSpansRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V2::BatchWriteSpansRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_write_spans(name: nil, spans: nil) + # Pass arguments to `batch_write_spans` via keyword arguments. Note that at + # least one keyword argument is 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 project where the spans belong. The format is + # `projects/[PROJECT_ID]`. + # @param spans [::Array<::Google::Cloud::Trace::V2::Span, ::Hash>] + # Required. A list of new spans. The span names must not match existing + # spans, otherwise the results are undefined. + # @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/trace/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V2::TraceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new + # + # # Call the batch_write_spans method. + # result = client.batch_write_spans request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def batch_write_spans request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::BatchWriteSpansRequest + + # Converts hash 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.batch_write_spans.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::Trace::V2::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.batch_write_spans.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_write_spans.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.batch_write_spans request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new span. + # + # @overload create_span(request, options = nil) + # Pass arguments to `create_span` via a request object, either of type + # {::Google::Cloud::Trace::V2::Span} or an equivalent Hash. + # + # @param request [::Google::Cloud::Trace::V2::Span, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_span(name: nil, span_id: nil, parent_span_id: nil, display_name: nil, start_time: nil, end_time: nil, attributes: nil, stack_trace: nil, time_events: nil, links: nil, status: nil, same_process_as_parent_span: nil, child_span_count: nil, span_kind: nil) + # Pass arguments to `create_span` via keyword arguments. Note that at + # least one keyword argument is 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 span in the following format: + # + # * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` + # + # `[TRACE_ID]` is a unique identifier for a trace within a project; + # it is a 32-character hexadecimal encoding of a 16-byte array. It should + # not be zero. + # + # `[SPAN_ID]` is a unique identifier for a span within a trace; it + # is a 16-character hexadecimal encoding of an 8-byte array. It should not + # be zero. + # . + # @param span_id [::String] + # Required. The `[SPAN_ID]` portion of the span's resource name. + # @param parent_span_id [::String] + # The `[SPAN_ID]` of this span's parent span. If this is a root span, + # then this field must be empty. + # @param display_name [::Google::Cloud::Trace::V2::TruncatableString, ::Hash] + # Required. A description of the span's operation (up to 128 bytes). + # Cloud Trace displays the description in the + # Cloud console. + # For example, the display name can be a qualified method name or a file name + # and a line number where the operation is called. A best practice is to use + # the same display name within an application and at the same call point. + # This makes it easier to correlate spans in different traces. + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The start time of the span. On the client side, this is the time + # kept by the local machine where the span execution starts. On the server + # side, this is the time when the server's application handler starts + # running. + # @param end_time [::Google::Protobuf::Timestamp, ::Hash] + # Required. The end time of the span. On the client side, this is the time + # kept by the local machine where the span execution ends. On the server + # side, this is the time when the server application handler stops running. + # @param attributes [::Google::Cloud::Trace::V2::Span::Attributes, ::Hash] + # A set of attributes on the span. You can have up to 32 attributes per + # span. + # @param stack_trace [::Google::Cloud::Trace::V2::StackTrace, ::Hash] + # Stack trace captured at the start of the span. + # @param time_events [::Google::Cloud::Trace::V2::Span::TimeEvents, ::Hash] + # A set of time events. You can have up to 32 annotations and 128 message + # events per span. + # @param links [::Google::Cloud::Trace::V2::Span::Links, ::Hash] + # Links associated with the span. You can have up to 128 links per Span. + # @param status [::Google::Rpc::Status, ::Hash] + # Optional. The final status for this span. + # @param same_process_as_parent_span [::Google::Protobuf::BoolValue, ::Hash] + # Optional. Set this parameter to indicate whether this span is in + # the same process as its parent. If you do not set this parameter, + # Trace is unable to take advantage of this helpful information. + # @param child_span_count [::Google::Protobuf::Int32Value, ::Hash] + # Optional. The number of child spans that were generated while this span + # was active. If set, allows implementation to detect missing child spans. + # @param span_kind [::Google::Cloud::Trace::V2::Span::SpanKind] + # Optional. Distinguishes between spans generated in a particular context. + # For example, two spans with the same name may be distinguished using + # `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Trace::V2::Span] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Trace::V2::Span] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/trace/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Trace::V2::TraceService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Trace::V2::Span.new + # + # # Call the create_span method. + # result = client.create_span request + # + # # The returned object is of type Google::Cloud::Trace::V2::Span. + # p result + # + def create_span request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::Span + + # Converts hash 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_span.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::Trace::V2::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_span.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_span.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @trace_service_stub.create_span request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TraceService REST API. + # + # This class represents the configuration for TraceService 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::Trace::V2::TraceService::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 + # # batch_write_spans to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Trace::V2::TraceService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_write_spans.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_write_spans.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TraceService 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 `batch_write_spans` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_write_spans + ## + # RPC-specific configuration for `create_span` + # @return [::Gapic::Config::Method] + # + attr_reader :create_span + + # @private + def initialize parent_rpcs = nil + batch_write_spans_config = parent_rpcs.batch_write_spans if parent_rpcs.respond_to? :batch_write_spans + @batch_write_spans = ::Gapic::Config::Method.new batch_write_spans_config + create_span_config = parent_rpcs.create_span if parent_rpcs.respond_to? :create_span + @create_span = ::Gapic::Config::Method.new create_span_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb new file mode 100644 index 000000000000..bd1feae3a232 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb @@ -0,0 +1,205 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" + +module Google + module Cloud + module Trace + module V2 + module TraceService + module Rest + ## + # REST service stub for the TraceService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the batch_write_spans REST call + # + # @param request_pb [::Google::Cloud::Trace::V2::BatchWriteSpansRequest] + # 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 batch_write_spans request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_write_spans_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, + method_name: "batch_write_spans", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_span REST call + # + # @param request_pb [::Google::Cloud::Trace::V2::Span] + # 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::Trace::V2::Span] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Trace::V2::Span] + # A result object deserialized from the server's reply + def create_span request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_span_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, + method_name: "create_span", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Trace::V2::Span.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_write_spans REST call + # + # @param request_pb [::Google::Cloud::Trace::V2::BatchWriteSpansRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_write_spans_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}/traces:batchWrite", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_span REST call + # + # @param request_pb [::Google::Cloud::Trace::V2::Span] + # 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_span_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/traces/[^/]+/spans/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb new file mode 100644 index 000000000000..d2142daddb36 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb new file mode 100644 index 000000000000..01114e89013b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/devtools/cloudtrace/v2/trace.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n)google/devtools/cloudtrace/v2/trace.proto\x12\x1dgoogle.devtools.cloudtrace.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\xf1\x11\n\x04Span\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07span_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0eparent_span_id\x18\x03 \x01(\t\x12K\n\x0c\x64isplay_name\x18\x04 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableStringB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x31\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x42\n\nattributes\x18\x07 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\x12>\n\x0bstack_trace\x18\x08 \x01(\x0b\x32).google.devtools.cloudtrace.v2.StackTrace\x12\x43\n\x0btime_events\x18\t \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.TimeEvents\x12\x38\n\x05links\x18\n \x01(\x0b\x32).google.devtools.cloudtrace.v2.Span.Links\x12\'\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x01\x12\x44\n\x1bsame_process_as_parent_span\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\x03\xe0\x41\x01\x12:\n\x10\x63hild_span_count\x18\r \x01(\x0b\x32\x1b.google.protobuf.Int32ValueB\x03\xe0\x41\x01\x12\x44\n\tspan_kind\x18\x0e \x01(\x0e\x32,.google.devtools.cloudtrace.v2.Span.SpanKindB\x03\xe0\x41\x01\x1a\xeb\x01\n\nAttributes\x12W\n\rattribute_map\x18\x01 \x03(\x0b\x32@.google.devtools.cloudtrace.v2.Span.Attributes.AttributeMapEntry\x12 \n\x18\x64ropped_attributes_count\x18\x02 \x01(\x05\x1a\x62\n\x11\x41ttributeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.devtools.cloudtrace.v2.AttributeValue:\x02\x38\x01\x1a\xdf\x04\n\tTimeEvent\x12(\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\nannotation\x18\x02 \x01(\x0b\x32\x38.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationH\x00\x12S\n\rmessage_event\x18\x03 \x01(\x0b\x32:.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventH\x00\x1a\x97\x01\n\nAnnotation\x12\x45\n\x0b\x64\x65scription\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x42\n\nattributes\x18\x02 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\x1a\xdf\x01\n\x0cMessageEvent\x12M\n\x04type\x18\x01 \x01(\x0e\x32?.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type\x12\n\n\x02id\x18\x02 \x01(\x03\x12\x1f\n\x17uncompressed_size_bytes\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ompressed_size_bytes\x18\x04 \x01(\x03\"4\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04SENT\x10\x01\x12\x0c\n\x08RECEIVED\x10\x02\x42\x07\n\x05value\x1a\x98\x01\n\nTimeEvents\x12\x41\n\ntime_event\x18\x01 \x03(\x0b\x32-.google.devtools.cloudtrace.v2.Span.TimeEvent\x12!\n\x19\x64ropped_annotations_count\x18\x02 \x01(\x05\x12$\n\x1c\x64ropped_message_events_count\x18\x03 \x01(\x05\x1a\xf7\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\t\x12\x0f\n\x07span_id\x18\x02 \x01(\t\x12;\n\x04type\x18\x03 \x01(\x0e\x32-.google.devtools.cloudtrace.v2.Span.Link.Type\x12\x42\n\nattributes\x18\x04 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43HILD_LINKED_SPAN\x10\x01\x12\x16\n\x12PARENT_LINKED_SPAN\x10\x02\x1a\\\n\x05Links\x12\x36\n\x04link\x18\x01 \x03(\x0b\x32(.google.devtools.cloudtrace.v2.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x02 \x01(\x05\"g\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x0c\n\x08INTERNAL\x10\x01\x12\n\n\x06SERVER\x10\x02\x12\n\n\x06\x43LIENT\x10\x03\x12\x0c\n\x08PRODUCER\x10\x04\x12\x0c\n\x08\x43ONSUMER\x10\x05:S\xea\x41P\n\x1e\x63loudtrace.googleapis.com/Span\x12.projects/{project}/traces/{trace}/spans/{span}\"\x8e\x01\n\x0e\x41ttributeValue\x12H\n\x0cstring_value\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableStringH\x00\x12\x13\n\tint_value\x18\x02 \x01(\x03H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value\"\x89\x05\n\nStackTrace\x12K\n\x0cstack_frames\x18\x01 \x01(\x0b\x32\x35.google.devtools.cloudtrace.v2.StackTrace.StackFrames\x12\x1b\n\x13stack_trace_hash_id\x18\x02 \x01(\x03\x1a\x9e\x03\n\nStackFrame\x12G\n\rfunction_name\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12P\n\x16original_function_name\x18\x02 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x43\n\tfile_name\x18\x03 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x13\n\x0bline_number\x18\x04 \x01(\x03\x12\x15\n\rcolumn_number\x18\x05 \x01(\x03\x12:\n\x0bload_module\x18\x06 \x01(\x0b\x32%.google.devtools.cloudtrace.v2.Module\x12H\n\x0esource_version\x18\x07 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x1ap\n\x0bStackFrames\x12\x43\n\x05\x66rame\x18\x01 \x03(\x0b\x32\x34.google.devtools.cloudtrace.v2.StackTrace.StackFrame\x12\x1c\n\x14\x64ropped_frames_count\x18\x02 \x01(\x05\"\x8e\x01\n\x06Module\x12@\n\x06module\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x42\n\x08\x62uild_id\x18\x02 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\"@\n\x11TruncatableString\x12\r\n\x05value\x18\x01 \x01(\t\x12\x1c\n\x14truncated_byte_count\x18\x02 \x01(\x05\x42\xad\x01\n!com.google.devtools.cloudtrace.v2B\nTraceProtoP\x01Z/cloud.google.com/go/trace/apiv2/tracepb;tracepb\xaa\x02\x15Google.Cloud.Trace.V2\xca\x02\x15Google\\Cloud\\Trace\\V2\xea\x02\x18Google::Cloud::Trace::V2b\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.rpc.Status", "google/rpc/status.proto"], + ["google.protobuf.BoolValue", "google/protobuf/wrappers.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 Trace + module V2 + Span = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span").msgclass + Span::Attributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Attributes").msgclass + Span::TimeEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent").msgclass + Span::TimeEvent::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation").msgclass + Span::TimeEvent::MessageEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent").msgclass + Span::TimeEvent::MessageEvent::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type").enummodule + Span::TimeEvents = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvents").msgclass + Span::Link = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link").msgclass + Span::Link::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link.Type").enummodule + Span::Links = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Links").msgclass + Span::SpanKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.SpanKind").enummodule + AttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.AttributeValue").msgclass + StackTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace").msgclass + StackTrace::StackFrame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrame").msgclass + StackTrace::StackFrames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrames").msgclass + Module = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Module").msgclass + TruncatableString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.TruncatableString").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb new file mode 100644 index 000000000000..5127c0102621 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/devtools/cloudtrace/v2/tracing.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/devtools/cloudtrace/v2/trace_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n+google/devtools/cloudtrace/v2/tracing.proto\x12\x1dgoogle.devtools.cloudtrace.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/devtools/cloudtrace/v2/trace.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x94\x01\n\x16\x42\x61tchWriteSpansRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x37\n\x05spans\x18\x02 \x03(\x0b\x32#.google.devtools.cloudtrace.v2.SpanB\x03\xe0\x41\x02\x32\xba\x03\n\x0cTraceService\x12\xa1\x01\n\x0f\x42\x61tchWriteSpans\x12\x35.google.devtools.cloudtrace.v2.BatchWriteSpansRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\nname,spans\x82\xd3\xe4\x93\x02,\"\'/v2/{name=projects/*}/traces:batchWrite:\x01*\x12\x89\x01\n\nCreateSpan\x12#.google.devtools.cloudtrace.v2.Span\x1a#.google.devtools.cloudtrace.v2.Span\"1\x82\xd3\xe4\x93\x02+\"&/v2/{name=projects/*/traces/*/spans/*}:\x01*\x1az\xca\x41\x19\x63loudtrace.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.appendB\xaf\x01\n!com.google.devtools.cloudtrace.v2B\x0cTracingProtoP\x01Z/cloud.google.com/go/trace/apiv2/tracepb;tracepb\xaa\x02\x15Google.Cloud.Trace.V2\xca\x02\x15Google\\Cloud\\Trace\\V2\xea\x02\x18Google::Cloud::Trace::V2b\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.devtools.cloudtrace.v2.Span", "google/devtools/cloudtrace/v2/trace.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 Trace + module V2 + BatchWriteSpansRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.BatchWriteSpansRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb new file mode 100644 index 000000000000..a6ad28a02fee --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/devtools/cloudtrace/v2/tracing.proto for package 'Google.Cloud.Trace.V2' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/devtools/cloudtrace/v2/tracing_pb' + +module Google + module Cloud + module Trace + module V2 + module TraceService + # Service for collecting and viewing traces and spans within a trace. + # + # A trace is a collection of spans corresponding to a single + # operation or a set of operations in an application. + # + # A span is an individual timed event which forms a node of the trace tree. + # A single trace can contain spans from multiple services. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.devtools.cloudtrace.v2.TraceService' + + # Batch writes new spans to new or existing traces. You cannot update + # existing spans. + rpc :BatchWriteSpans, ::Google::Cloud::Trace::V2::BatchWriteSpansRequest, ::Google::Protobuf::Empty + # Creates a new span. + rpc :CreateSpan, ::Google::Cloud::Trace::V2::Span, ::Google::Cloud::Trace::V2::Span + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md new file mode 100644 index 000000000000..bcb9d2cdc0ae --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Trace V2 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-trace-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb new file mode 100644 index 000000000000..040d6c9b24da --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb @@ -0,0 +1,427 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V2 + # A span represents a single operation within a trace. Spans can be + # nested to form a trace tree. Often, a trace contains a root span + # that describes the end-to-end latency, and one or more subspans for + # its sub-operations. + # + # A trace can also contain multiple root spans, or none at all. + # Spans do not need to be contiguous. There might be + # gaps or overlaps between spans in a trace. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the span in the following format: + # + # * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` + # + # `[TRACE_ID]` is a unique identifier for a trace within a project; + # it is a 32-character hexadecimal encoding of a 16-byte array. It should + # not be zero. + # + # `[SPAN_ID]` is a unique identifier for a span within a trace; it + # is a 16-character hexadecimal encoding of an 8-byte array. It should not + # be zero. + # . + # @!attribute [rw] span_id + # @return [::String] + # Required. The `[SPAN_ID]` portion of the span's resource name. + # @!attribute [rw] parent_span_id + # @return [::String] + # The `[SPAN_ID]` of this span's parent span. If this is a root span, + # then this field must be empty. + # @!attribute [rw] display_name + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # Required. A description of the span's operation (up to 128 bytes). + # Cloud Trace displays the description in the + # Cloud console. + # For example, the display name can be a qualified method name or a file name + # and a line number where the operation is called. A best practice is to use + # the same display name within an application and at the same call point. + # This makes it easier to correlate spans in different traces. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Required. The start time of the span. On the client side, this is the time + # kept by the local machine where the span execution starts. On the server + # side, this is the time when the server's application handler starts + # running. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Required. The end time of the span. On the client side, this is the time + # kept by the local machine where the span execution ends. On the server + # side, this is the time when the server application handler stops running. + # @!attribute [rw] attributes + # @return [::Google::Cloud::Trace::V2::Span::Attributes] + # A set of attributes on the span. You can have up to 32 attributes per + # span. + # @!attribute [rw] stack_trace + # @return [::Google::Cloud::Trace::V2::StackTrace] + # Stack trace captured at the start of the span. + # @!attribute [rw] time_events + # @return [::Google::Cloud::Trace::V2::Span::TimeEvents] + # A set of time events. You can have up to 32 annotations and 128 message + # events per span. + # @!attribute [rw] links + # @return [::Google::Cloud::Trace::V2::Span::Links] + # Links associated with the span. You can have up to 128 links per Span. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Optional. The final status for this span. + # @!attribute [rw] same_process_as_parent_span + # @return [::Google::Protobuf::BoolValue] + # Optional. Set this parameter to indicate whether this span is in + # the same process as its parent. If you do not set this parameter, + # Trace is unable to take advantage of this helpful information. + # @!attribute [rw] child_span_count + # @return [::Google::Protobuf::Int32Value] + # Optional. The number of child spans that were generated while this span + # was active. If set, allows implementation to detect missing child spans. + # @!attribute [rw] span_kind + # @return [::Google::Cloud::Trace::V2::Span::SpanKind] + # Optional. Distinguishes between spans generated in a particular context. + # For example, two spans with the same name may be distinguished using + # `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. + class Span + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A set of attributes as key-value pairs. + # @!attribute [rw] attribute_map + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Trace::V2::AttributeValue}] + # A set of attributes. Each attribute's key can be up to 128 bytes + # long. The value can be a string up to 256 bytes, a signed 64-bit integer, + # or the boolean values `true` or `false`. For example: + # + # "/instance_id": { "string_value": { "value": "my-instance" } } + # "/http/request_bytes": { "int_value": 300 } + # "abc.com/myattribute": { "bool_value": false } + # @!attribute [rw] dropped_attributes_count + # @return [::Integer] + # The number of attributes that were discarded. Attributes can be discarded + # because their keys are too long or because there are too many attributes. + # If this value is 0 then all attributes are valid. + class Attributes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Trace::V2::AttributeValue] + class AttributeMapEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A time-stamped annotation or message event in the Span. + # @!attribute [rw] time + # @return [::Google::Protobuf::Timestamp] + # The timestamp indicating the time the event occurred. + # @!attribute [rw] annotation + # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::Annotation] + # Text annotation with a set of attributes. + # + # Note: The following fields are mutually exclusive: `annotation`, `message_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] message_event + # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::MessageEvent] + # An event describing a message sent/received between Spans. + # + # Note: The following fields are mutually exclusive: `message_event`, `annotation`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TimeEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Text annotation with a set of attributes. + # @!attribute [rw] description + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # A user-supplied message describing the event. The maximum length for + # the description is 256 bytes. + # @!attribute [rw] attributes + # @return [::Google::Cloud::Trace::V2::Span::Attributes] + # A set of attributes on the annotation. You can have up to 4 attributes + # per Annotation. + class Annotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An event describing a message sent/received between Spans. + # @!attribute [rw] type + # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::MessageEvent::Type] + # Type of MessageEvent. Indicates whether the message was sent or + # received. + # @!attribute [rw] id + # @return [::Integer] + # An identifier for the MessageEvent's message that can be used to match + # `SENT` and `RECEIVED` MessageEvents. + # @!attribute [rw] uncompressed_size_bytes + # @return [::Integer] + # The number of uncompressed bytes sent or received. + # @!attribute [rw] compressed_size_bytes + # @return [::Integer] + # The number of compressed bytes sent or received. If missing, the + # compressed size is assumed to be the same size as the uncompressed + # size. + class MessageEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates whether the message was sent or received. + module Type + # Unknown event type. + TYPE_UNSPECIFIED = 0 + + # Indicates a sent message. + SENT = 1 + + # Indicates a received message. + RECEIVED = 2 + end + end + end + + # A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation + # on the span, consisting of either user-supplied key:value pairs, or + # details of a message sent/received between Spans. + # @!attribute [rw] time_event + # @return [::Array<::Google::Cloud::Trace::V2::Span::TimeEvent>] + # A collection of `TimeEvent`s. + # @!attribute [rw] dropped_annotations_count + # @return [::Integer] + # The number of dropped annotations in all the included time events. + # If the value is 0, then no annotations were dropped. + # @!attribute [rw] dropped_message_events_count + # @return [::Integer] + # The number of dropped message events in all the included time events. + # If the value is 0, then no message events were dropped. + class TimeEvents + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A pointer from the current span to another span in the same trace or in a + # different trace. For example, this can be used in batching operations, + # where a single batch handler processes multiple requests from different + # traces or when the handler receives a request from a different project. + # @!attribute [rw] trace_id + # @return [::String] + # The `[TRACE_ID]` for a trace within a project. + # @!attribute [rw] span_id + # @return [::String] + # The `[SPAN_ID]` for a span within a trace. + # @!attribute [rw] type + # @return [::Google::Cloud::Trace::V2::Span::Link::Type] + # The relationship of the current span relative to the linked span. + # @!attribute [rw] attributes + # @return [::Google::Cloud::Trace::V2::Span::Attributes] + # A set of attributes on the link. Up to 32 attributes can be + # specified per link. + class Link + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The relationship of the current span relative to the linked span: child, + # parent, or unspecified. + module Type + # The relationship of the two spans is unknown. + TYPE_UNSPECIFIED = 0 + + # The linked span is a child of the current span. + CHILD_LINKED_SPAN = 1 + + # The linked span is a parent of the current span. + PARENT_LINKED_SPAN = 2 + end + end + + # A collection of links, which are references from this span to a span + # in the same or different trace. + # @!attribute [rw] link + # @return [::Array<::Google::Cloud::Trace::V2::Span::Link>] + # A collection of links. + # @!attribute [rw] dropped_links_count + # @return [::Integer] + # The number of dropped links after the maximum size was enforced. If + # this value is 0, then no links were dropped. + class Links + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Type of span. Can be used to specify additional relationships between spans + # in addition to a parent/child relationship. + module SpanKind + # Unspecified. Do NOT use as default. + # Implementations MAY assume SpanKind.INTERNAL to be default. + SPAN_KIND_UNSPECIFIED = 0 + + # Indicates that the span is used internally. Default value. + INTERNAL = 1 + + # Indicates that the span covers server-side handling of an RPC or other + # remote network request. + SERVER = 2 + + # Indicates that the span covers the client-side wrapper around an RPC or + # other remote request. + CLIENT = 3 + + # Indicates that the span describes producer sending a message to a broker. + # Unlike client and server, there is no direct critical path latency + # relationship between producer and consumer spans (e.g. publishing a + # message to a pubsub service). + PRODUCER = 4 + + # Indicates that the span describes consumer receiving a message from a + # broker. Unlike client and server, there is no direct critical path + # latency relationship between producer and consumer spans (e.g. receiving + # a message from a pubsub service subscription). + CONSUMER = 5 + end + end + + # The allowed types for `[VALUE]` in a `[KEY]:[VALUE]` attribute. + # @!attribute [rw] string_value + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # A string up to 256 bytes long. + # + # Note: The following fields are mutually exclusive: `string_value`, `int_value`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] int_value + # @return [::Integer] + # A 64-bit signed integer. + # + # Note: The following fields are mutually exclusive: `int_value`, `string_value`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # A Boolean value represented by `true` or `false`. + # + # Note: The following fields are mutually exclusive: `bool_value`, `string_value`, `int_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AttributeValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A call stack appearing in a trace. + # @!attribute [rw] stack_frames + # @return [::Google::Cloud::Trace::V2::StackTrace::StackFrames] + # Stack frames in this stack trace. A maximum of 128 frames are allowed. + # @!attribute [rw] stack_trace_hash_id + # @return [::Integer] + # The hash ID is used to conserve network bandwidth for duplicate + # stack traces within a single trace. + # + # Often multiple spans will have identical stack traces. + # The first occurrence of a stack trace should contain both the + # `stackFrame` content and a value in `stackTraceHashId`. + # + # Subsequent spans within the same request can refer + # to that stack trace by only setting `stackTraceHashId`. + class StackTrace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a single stack frame in a stack trace. + # @!attribute [rw] function_name + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # The fully-qualified name that uniquely identifies the function or + # method that is active in this frame (up to 1024 bytes). + # @!attribute [rw] original_function_name + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # An un-mangled function name, if `function_name` is mangled. + # To get information about name mangling, run + # [this search](https://www.google.com/search?q=cxx+name+mangling). + # The name can be fully-qualified (up to 1024 bytes). + # @!attribute [rw] file_name + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # The name of the source file where the function call appears (up to 256 + # bytes). + # @!attribute [rw] line_number + # @return [::Integer] + # The line number in `file_name` where the function call appears. + # @!attribute [rw] column_number + # @return [::Integer] + # The column number where the function call appears, if available. + # This is important in JavaScript because of its anonymous functions. + # @!attribute [rw] load_module + # @return [::Google::Cloud::Trace::V2::Module] + # The binary module from where the code was loaded. + # @!attribute [rw] source_version + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # The version of the deployed source code (up to 128 bytes). + class StackFrame + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection of stack frames, which can be truncated. + # @!attribute [rw] frame + # @return [::Array<::Google::Cloud::Trace::V2::StackTrace::StackFrame>] + # Stack frames in this call stack. + # @!attribute [rw] dropped_frames_count + # @return [::Integer] + # The number of stack frames that were dropped because there + # were too many stack frames. + # If this value is 0, then no stack frames were dropped. + class StackFrames + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Binary module. + # @!attribute [rw] module + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # For example: main binary, kernel modules, and dynamic libraries + # such as libc.so, sharedlib.so (up to 256 bytes). + # @!attribute [rw] build_id + # @return [::Google::Cloud::Trace::V2::TruncatableString] + # A unique identifier for the module, usually a hash of its + # contents (up to 128 bytes). + class Module + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a string that might be shortened to a specified length. + # @!attribute [rw] value + # @return [::String] + # The shortened string. For example, if the original string is 500 + # bytes long and the limit of the string is 128 bytes, then + # `value` contains the first 128 bytes of the 500-byte string. + # + # Truncation always happens on a UTF8 character boundary. If there + # are multi-byte characters in the string, then the length of the + # shortened string might be less than the size limit. + # @!attribute [rw] truncated_byte_count + # @return [::Integer] + # The number of bytes removed from the original string. If this + # value is 0, then the string was not shortened. + class TruncatableString + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb new file mode 100644 index 000000000000..cd7bfb705d2f --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace + module V2 + # The request message for the `BatchWriteSpans` method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the project where the spans belong. The format is + # `projects/[PROJECT_ID]`. + # @!attribute [rw] spans + # @return [::Array<::Google::Cloud::Trace::V2::Span>] + # Required. A list of new spans. The span names must not match existing + # spans, otherwise the results are undefined. + class BatchWriteSpansRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..1b485b0c3456 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile new file mode 100644 index 000000000000..d4b193b35cd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2", path: "../" +else + gem "google-cloud-trace-v2" +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-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json b/owl-bot-staging/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json new file mode 100644 index 000000000000..3f9f5b451203 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json @@ -0,0 +1,95 @@ +{ + "client_library": { + "name": "google-cloud-trace-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.devtools.cloudtrace.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync", + "title": "Snippet for the batch_write_spans call in the TraceService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V2::TraceService::Client#batch_write_spans.", + "file": "trace_service/batch_write_spans.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_write_spans", + "full_name": "::Google::Cloud::Trace::V2::TraceService::Client#batch_write_spans", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Trace::V2::BatchWriteSpansRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TraceService::Client", + "full_name": "::Google::Cloud::Trace::V2::TraceService::Client" + }, + "method": { + "short_name": "BatchWriteSpans", + "full_name": "google.devtools.cloudtrace.v2.TraceService.BatchWriteSpans", + "service": { + "short_name": "TraceService", + "full_name": "google.devtools.cloudtrace.v2.TraceService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "cloudtrace_v2_generated_TraceService_CreateSpan_sync", + "title": "Snippet for the create_span call in the TraceService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V2::TraceService::Client#create_span.", + "file": "trace_service/create_span.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_span", + "full_name": "::Google::Cloud::Trace::V2::TraceService::Client#create_span", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Trace::V2::Span", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Trace::V2::Span", + "client": { + "short_name": "TraceService::Client", + "full_name": "::Google::Cloud::Trace::V2::TraceService::Client" + }, + "method": { + "short_name": "CreateSpan", + "full_name": "google.devtools.cloudtrace.v2.TraceService.CreateSpan", + "service": { + "short_name": "TraceService", + "full_name": "google.devtools.cloudtrace.v2.TraceService" + } + } + }, + "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-trace-v2/snippets/trace_service/batch_write_spans.rb b/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb new file mode 100644 index 000000000000..e643549fe9fa --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync] +require "google/cloud/trace/v2" + +## +# Snippet for the batch_write_spans call in the TraceService 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::Trace::V2::TraceService::Client#batch_write_spans. +# +def batch_write_spans + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V2::TraceService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new + + # Call the batch_write_spans method. + result = client.batch_write_spans request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync] diff --git a/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb b/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb new file mode 100644 index 000000000000..b5360303f20b --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v2_generated_TraceService_CreateSpan_sync] +require "google/cloud/trace/v2" + +## +# Snippet for the create_span call in the TraceService 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::Trace::V2::TraceService::Client#create_span. +# +def create_span + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V2::TraceService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V2::Span.new + + # Call the create_span method. + result = client.create_span request + + # The returned object is of type Google::Cloud::Trace::V2::Span. + p result +end +# [END cloudtrace_v2_generated_TraceService_CreateSpan_sync] diff --git a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb new file mode 100644 index 000000000000..603da3b3b484 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/trace_service" + +class ::Google::Cloud::Trace::V2::TraceService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_span_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.span_path project: "value0", trace: "value1", span: "value2" + assert_equal "projects/value0/traces/value1/spans/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb new file mode 100644 index 000000000000..8660e0c553e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb @@ -0,0 +1,221 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" +require "google/cloud/trace/v2/trace_service/rest" + + +class ::Google::Cloud::Trace::V2::TraceService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_batch_write_spans + # 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" + spans = [{}] + + batch_write_spans_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Trace::V2::TraceService::Rest::ServiceStub.stub :transcode_batch_write_spans_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_write_spans_client_stub do + # Create client + client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_write_spans({ name: name, spans: spans }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_write_spans name: name, spans: spans do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_write_spans ::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_write_spans({ name: name, spans: spans }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_write_spans(::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_write_spans_client_stub.call_count + end + end + end + + def test_create_span + # Create test objects. + client_result = ::Google::Cloud::Trace::V2::Span.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + span_id = "hello world" + parent_span_id = "hello world" + display_name = {} + start_time = {} + end_time = {} + attributes = {} + stack_trace = {} + time_events = {} + links = {} + status = {} + same_process_as_parent_span = {} + child_span_count = {} + span_kind = :SPAN_KIND_UNSPECIFIED + + create_span_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Trace::V2::TraceService::Rest::ServiceStub.stub :transcode_create_span_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_span_client_stub do + # Create client + client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_span name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_span ::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_span(::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_span_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::Trace::V2::TraceService::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::Trace::V2::TraceService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb new file mode 100644 index 000000000000..3e5178e2ec6e --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb @@ -0,0 +1,248 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" +require "google/cloud/trace/v2/trace_service" + +class ::Google::Cloud::Trace::V2::TraceService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_batch_write_spans + # 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" + spans = [{}] + + batch_write_spans_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_write_spans, name + assert_kind_of ::Google::Cloud::Trace::V2::BatchWriteSpansRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::Trace::V2::Span, request["spans"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_write_spans_client_stub do + # Create client + client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_write_spans({ name: name, spans: spans }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_write_spans name: name, spans: spans do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_write_spans ::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_write_spans({ name: name, spans: spans }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_write_spans(::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_write_spans_client_stub.call_rpc_count + end + end + + def test_create_span + # Create GRPC objects. + grpc_response = ::Google::Cloud::Trace::V2::Span.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" + span_id = "hello world" + parent_span_id = "hello world" + display_name = {} + start_time = {} + end_time = {} + attributes = {} + stack_trace = {} + time_events = {} + links = {} + status = {} + same_process_as_parent_span = {} + child_span_count = {} + span_kind = :SPAN_KIND_UNSPECIFIED + + create_span_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_span, name + assert_kind_of ::Google::Cloud::Trace::V2::Span, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["span_id"] + assert_equal "hello world", request["parent_span_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::TruncatableString), request["display_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["end_time"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::Span::Attributes), request["attributes"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::StackTrace), request["stack_trace"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::Span::TimeEvents), request["time_events"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::Span::Links), request["links"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Rpc::Status), request["status"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::BoolValue), request["same_process_as_parent_span"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int32Value), request["child_span_count"] + assert_equal :SPAN_KIND_UNSPECIFIED, request["span_kind"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_span_client_stub do + # Create client + client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_span name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_span ::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_span(::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_span_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::Trace::V2::TraceService::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::Trace::V2::TraceService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Trace::V2::TraceService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-trace-v2/test/helper.rb b/owl-bot-staging/google-cloud-trace-v2/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-trace-v2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-translate-v3/.gitignore b/owl-bot-staging/google-cloud-translate-v3/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/.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-translate-v3/.repo-metadata.json b/owl-bot-staging/google-cloud-translate-v3/.repo-metadata.json new file mode 100644 index 000000000000..550038f3aaea --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "translate.googleapis.com", + "api_shortname": "translate", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest", + "distribution_name": "google-cloud-translate-v3", + "is_cloud": true, + "language": "ruby", + "name": "translate", + "name_pretty": "Cloud Translation V3 API", + "product_documentation": "https://cloud.google.com/translate", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. Note that google-cloud-translate-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-translate instead. See the readme for more details.", + "ruby-cloud-env-prefix": "TRANSLATE", + "ruby-cloud-product-url": "https://cloud.google.com/translate", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-translate-v3/.rubocop.yml b/owl-bot-staging/google-cloud-translate-v3/.rubocop.yml new file mode 100644 index 000000000000..68b485677107 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-translate-v3.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-translate-v3.rb" diff --git a/owl-bot-staging/google-cloud-translate-v3/.toys.rb b/owl-bot-staging/google-cloud-translate-v3/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/.yardopts b/owl-bot-staging/google-cloud-translate-v3/.yardopts new file mode 100644 index 000000000000..6a5acb03bbde --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Translation V3 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-translate-v3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-translate-v3/AUTHENTICATION.md new file mode 100644 index 000000000000..f67deb161865 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-translate-v3 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-translate-v3 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/translate/v3" + +client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/translate/v3" + +::Google::Cloud::Translate::V3::TranslationService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Translate::V3::TranslationService::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-translate-v3 +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/translate/v3" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Translate::V3::TranslationService::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-translate-v3/CHANGELOG.md b/owl-bot-staging/google-cloud-translate-v3/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-translate-v3/Gemfile b/owl-bot-staging/google-cloud-translate-v3/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-translate-v3/LICENSE.md b/owl-bot-staging/google-cloud-translate-v3/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/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-translate-v3/README.md b/owl-bot-staging/google-cloud-translate-v3/README.md new file mode 100644 index 000000000000..99718bb0a50c --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Translation V3 API + +Integrates text translation into your website or application. + +Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. + +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 Translation V3 API. Most users should consider using +the main client gem, +[google-cloud-translate](https://rubygems.org/gems/google-cloud-translate). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-translate-v3 +``` + +## 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/translate.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/translate/v3" + +client = ::Google::Cloud::Translate::V3::TranslationService::Client.new +request = ::Google::Cloud::Translate::V3::TranslateTextRequest.new # (request fields as keyword arguments...) +response = client.translate_text request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/translate) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/translate/v3" +require "logger" + +client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-translate`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-translate-v3`. +_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-translate`. +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-translate-v3`. + +### 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-translate-v3/Rakefile b/owl-bot-staging/google-cloud-translate-v3/Rakefile new file mode 100644 index 000000000000..06aca81cc0ab --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TRANSLATE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TRANSLATE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TRANSLATE_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 TRANSLATE_TEST_PROJECT=test123 TRANSLATE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/translate/v3/translation_service/credentials" + ::Google::Cloud::Translate::V3::TranslationService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TRANSLATE_PROJECT"] = project + ENV["TRANSLATE_TEST_PROJECT"] = project + ENV["TRANSLATE_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-translate-v3 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-translate-v3 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-translate-v3 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-translate-v3 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-translate-v3" + header "google-cloud-translate-v3 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-translate-v3 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-translate-v3 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-translate-v3 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-translate-v3 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-translate-v3/gapic_metadata.json b/owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json new file mode 100644 index 000000000000..e12339b2e4a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json @@ -0,0 +1,208 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.translation.v3", + "libraryPackage": "::Google::Cloud::Translate::V3", + "services": { + "TranslationService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Translate::V3::TranslationService::Client", + "rpcs": { + "TranslateText": { + "methods": [ + "translate_text" + ] + }, + "RomanizeText": { + "methods": [ + "romanize_text" + ] + }, + "DetectLanguage": { + "methods": [ + "detect_language" + ] + }, + "GetSupportedLanguages": { + "methods": [ + "get_supported_languages" + ] + }, + "TranslateDocument": { + "methods": [ + "translate_document" + ] + }, + "BatchTranslateText": { + "methods": [ + "batch_translate_text" + ] + }, + "BatchTranslateDocument": { + "methods": [ + "batch_translate_document" + ] + }, + "CreateGlossary": { + "methods": [ + "create_glossary" + ] + }, + "UpdateGlossary": { + "methods": [ + "update_glossary" + ] + }, + "ListGlossaries": { + "methods": [ + "list_glossaries" + ] + }, + "GetGlossary": { + "methods": [ + "get_glossary" + ] + }, + "DeleteGlossary": { + "methods": [ + "delete_glossary" + ] + }, + "GetGlossaryEntry": { + "methods": [ + "get_glossary_entry" + ] + }, + "ListGlossaryEntries": { + "methods": [ + "list_glossary_entries" + ] + }, + "CreateGlossaryEntry": { + "methods": [ + "create_glossary_entry" + ] + }, + "UpdateGlossaryEntry": { + "methods": [ + "update_glossary_entry" + ] + }, + "DeleteGlossaryEntry": { + "methods": [ + "delete_glossary_entry" + ] + }, + "CreateDataset": { + "methods": [ + "create_dataset" + ] + }, + "GetDataset": { + "methods": [ + "get_dataset" + ] + }, + "ListDatasets": { + "methods": [ + "list_datasets" + ] + }, + "DeleteDataset": { + "methods": [ + "delete_dataset" + ] + }, + "CreateAdaptiveMtDataset": { + "methods": [ + "create_adaptive_mt_dataset" + ] + }, + "DeleteAdaptiveMtDataset": { + "methods": [ + "delete_adaptive_mt_dataset" + ] + }, + "GetAdaptiveMtDataset": { + "methods": [ + "get_adaptive_mt_dataset" + ] + }, + "ListAdaptiveMtDatasets": { + "methods": [ + "list_adaptive_mt_datasets" + ] + }, + "AdaptiveMtTranslate": { + "methods": [ + "adaptive_mt_translate" + ] + }, + "GetAdaptiveMtFile": { + "methods": [ + "get_adaptive_mt_file" + ] + }, + "DeleteAdaptiveMtFile": { + "methods": [ + "delete_adaptive_mt_file" + ] + }, + "ImportAdaptiveMtFile": { + "methods": [ + "import_adaptive_mt_file" + ] + }, + "ListAdaptiveMtFiles": { + "methods": [ + "list_adaptive_mt_files" + ] + }, + "ListAdaptiveMtSentences": { + "methods": [ + "list_adaptive_mt_sentences" + ] + }, + "ImportData": { + "methods": [ + "import_data" + ] + }, + "ExportData": { + "methods": [ + "export_data" + ] + }, + "ListExamples": { + "methods": [ + "list_examples" + ] + }, + "CreateModel": { + "methods": [ + "create_model" + ] + }, + "ListModels": { + "methods": [ + "list_models" + ] + }, + "GetModel": { + "methods": [ + "get_model" + ] + }, + "DeleteModel": { + "methods": [ + "delete_model" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec b/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec new file mode 100644 index 000000000000..d0c7184e0d02 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/translate/v3/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-translate-v3" + gem.version = Google::Cloud::Translate::V3::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. Note that google-cloud-translate-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-translate instead. See the readme for more details." + gem.summary = "Integrates text translation into your website or application." + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb new file mode 100644 index 000000000000..4feb19bf3cb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3" diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb new file mode 100644 index 000000000000..9da4decef7f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service" +require "google/cloud/translate/v3/version" + +module Google + module Cloud + module Translate + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/translate/v3" + # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/translate/v3" + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + module V3 + end + end + end +end + +helper_path = ::File.join __dir__, "v3", "_helpers.rb" +require "google/cloud/translate/v3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb new file mode 100644 index 000000000000..d4d827c8bde8 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/translate/v3/adaptive_mt.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/translate/v3/common_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n+google/cloud/translate/v3/adaptive_mt.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa1\x03\n\x11\x41\x64\x61ptiveMtDataset\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1c\n\x14source_language_code\x18\x03 \x01(\t\x12\x1c\n\x14target_language_code\x18\x04 \x01(\t\x12\x15\n\rexample_count\x18\x05 \x01(\x05\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:u\xea\x41r\n*translate.googleapis.com/AdaptiveMtDataset\x12\x44projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}\"\xad\x01\n\x1e\x43reateAdaptiveMtDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12P\n\x13\x61\x64\x61ptive_mt_dataset\x18\x02 \x01(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x02\"b\n\x1e\x44\x65leteAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"_\n\x1bGetAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"\xa0\x01\n\x1dListAdaptiveMtDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\"\x91\x01\n\x1eListAdaptiveMtDatasetsResponse\x12Q\n\x14\x61\x64\x61ptive_mt_datasets\x18\x01 \x03(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8b\x08\n\x1a\x41\x64\x61ptiveMtTranslateRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x07\x64\x61taset\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x07\x63ontent\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12w\n\x19reference_sentence_config\x18\x06 \x01(\x0b\x32O.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentenceConfigH\x00\x88\x01\x01\x12i\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x46.google.cloud.translation.v3.AdaptiveMtTranslateRequest.GlossaryConfigB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1aI\n\x15ReferenceSentencePair\x12\x17\n\x0fsource_sentence\x18\x01 \x01(\t\x12\x17\n\x0ftarget_sentence\x18\x02 \x01(\t\x1a\x8c\x01\n\x19ReferenceSentencePairList\x12o\n\x18reference_sentence_pairs\x18\x01 \x03(\x0b\x32M.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePair\x1a\xcf\x01\n\x17ReferenceSentenceConfig\x12x\n\x1dreference_sentence_pair_lists\x18\x01 \x03(\x0b\x32Q.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePairList\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1c\n\x14target_language_code\x18\x03 \x01(\t\x1a\x94\x01\n\x0eGlossaryConfig\x12;\n\x08glossary\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1e\x63ontextual_translation_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1c\n\x1a_reference_sentence_configB\x12\n\x10_glossary_config\"5\n\x15\x41\x64\x61ptiveMtTranslation\x12\x1c\n\x0ftranslated_text\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xdb\x01\n\x1b\x41\x64\x61ptiveMtTranslateResponse\x12M\n\x0ctranslations\x18\x01 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslationB\x03\xe0\x41\x03\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Q\n\x15glossary_translations\x18\x04 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslation\"\x94\x03\n\x0e\x41\x64\x61ptiveMtFile\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\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:\xab\x01\xea\x41\xa7\x01\n\'translate.googleapis.com/AdaptiveMtFile\x12[projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}*\x0f\x61\x64\x61ptiveMtFiles2\x0e\x61\x64\x61ptiveMtFile\"Y\n\x18GetAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\\\n\x1b\x44\x65leteAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\xff\x01\n\x1bImportAdaptiveMtFileRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12I\n\x11\x66ile_input_source\x18\x02 \x01(\x0b\x32,.google.cloud.translation.v3.FileInputSourceH\x00\x12G\n\x10gcs_input_source\x18\x03 \x01(\x0b\x32+.google.cloud.translation.v3.GcsInputSourceH\x00\x42\x08\n\x06source\"j\n\x1cImportAdaptiveMtFileResponse\x12J\n\x10\x61\x64\x61ptive_mt_file\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\"\x91\x01\n\x1aListAdaptiveMtFilesRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\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\"\x88\x01\n\x1bListAdaptiveMtFilesResponse\x12K\n\x11\x61\x64\x61ptive_mt_files\x18\x01 \x03(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xd8\x03\n\x12\x41\x64\x61ptiveMtSentence\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+translate.googleapis.com/AdaptiveMtSentence\x12\x1c\n\x0fsource_sentence\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarget_sentence\x18\x03 \x01(\tB\x03\xe0\x41\x02\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:\xd6\x01\xea\x41\xd2\x01\n+translate.googleapis.com/AdaptiveMtSentence\x12zprojects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}*\x13\x61\x64\x61ptiveMtSentences2\x12\x61\x64\x61ptiveMtSentence\"\x88\x01\n\x1eListAdaptiveMtSentencesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x94\x01\n\x1fListAdaptiveMtSentencesResponse\x12S\n\x15\x61\x64\x61ptive_mt_sentences\x18\x01 \x03(\x0b\x32/.google.cloud.translation.v3.AdaptiveMtSentenceB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\xc6\x01\n\x1d\x63om.google.cloud.translate.v3B\x0f\x41\x64\x61ptiveMtProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\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.translation.v3.FileInputSource", "google/cloud/translate/v3/common.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 Translate + module V3 + AdaptiveMtDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtDataset").msgclass + CreateAdaptiveMtDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateAdaptiveMtDatasetRequest").msgclass + DeleteAdaptiveMtDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteAdaptiveMtDatasetRequest").msgclass + GetAdaptiveMtDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetAdaptiveMtDatasetRequest").msgclass + ListAdaptiveMtDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtDatasetsRequest").msgclass + ListAdaptiveMtDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtDatasetsResponse").msgclass + AdaptiveMtTranslateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest").msgclass + AdaptiveMtTranslateRequest::ReferenceSentencePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePair").msgclass + AdaptiveMtTranslateRequest::ReferenceSentencePairList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePairList").msgclass + AdaptiveMtTranslateRequest::ReferenceSentenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentenceConfig").msgclass + AdaptiveMtTranslateRequest::GlossaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.GlossaryConfig").msgclass + AdaptiveMtTranslation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslation").msgclass + AdaptiveMtTranslateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateResponse").msgclass + AdaptiveMtFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtFile").msgclass + GetAdaptiveMtFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetAdaptiveMtFileRequest").msgclass + DeleteAdaptiveMtFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteAdaptiveMtFileRequest").msgclass + ImportAdaptiveMtFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportAdaptiveMtFileRequest").msgclass + ImportAdaptiveMtFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportAdaptiveMtFileResponse").msgclass + ListAdaptiveMtFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtFilesRequest").msgclass + ListAdaptiveMtFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtFilesResponse").msgclass + AdaptiveMtSentence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtSentence").msgclass + ListAdaptiveMtSentencesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtSentencesRequest").msgclass + ListAdaptiveMtSentencesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtSentencesResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb new file mode 100644 index 000000000000..e0f412d2d493 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/translate/v3/automl_translation.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/translate/v3/common_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n2google/cloud/translate/v3/automl_translation.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"u\n\x11ImportDataRequest\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\x0cinput_config\x18\x02 \x01(\x0b\x32/.google.cloud.translation.v3.DatasetInputConfigB\x03\xe0\x41\x02\"\xd2\x01\n\x12\x44\x61tasetInputConfig\x12N\n\x0binput_files\x18\x01 \x03(\x0b\x32\x39.google.cloud.translation.v3.DatasetInputConfig.InputFile\x1al\n\tInputFile\x12\x12\n\x05usage\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\ngcs_source\x18\x03 \x01(\x0b\x32+.google.cloud.translation.v3.GcsInputSourceH\x00\x42\x08\n\x06source\"\xd5\x01\n\x12ImportDataMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"w\n\x11\x45xportDataRequest\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\routput_config\x18\x02 \x01(\x0b\x32\x30.google.cloud.translation.v3.DatasetOutputConfigB\x03\xe0\x41\x02\"r\n\x13\x44\x61tasetOutputConfig\x12L\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x31.google.cloud.translation.v3.GcsOutputDestinationH\x00\x42\r\n\x0b\x64\x65stination\"\xd5\x01\n\x12\x45xportDataMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"N\n\x14\x44\x65leteDatasetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n translate.googleapis.com/Dataset\"\xd8\x01\n\x15\x44\x65leteDatasetMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"K\n\x11GetDatasetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n translate.googleapis.com/Dataset\"\x81\x01\n\x13ListDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\"g\n\x14ListDatasetsResponse\x12\x36\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32$.google.cloud.translation.v3.Dataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8d\x01\n\x14\x43reateDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12:\n\x07\x64\x61taset\x18\x02 \x01(\x0b\x32$.google.cloud.translation.v3.DatasetB\x03\xe0\x41\x02\"\xd8\x01\n\x15\x43reateDatasetMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\x95\x01\n\x13ListExamplesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n translate.googleapis.com/Dataset\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"g\n\x14ListExamplesResponse\x12\x36\n\x08\x65xamples\x18\x01 \x03(\x0b\x32$.google.cloud.translation.v3.Example\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd0\x01\n\x07\x45xample\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0bsource_text\x18\x02 \x01(\t\x12\x13\n\x0btarget_text\x18\x03 \x01(\t\x12\x12\n\x05usage\x18\x04 \x01(\tB\x03\xe0\x41\x03:t\xea\x41q\n translate.googleapis.com/Example\x12Mprojects/{project}/locations/{location}/datasets/{dataset}/examples/{example}\"\xe8\x01\n\x1e\x42\x61tchTransferResourcesResponse\x12g\n\tresponses\x18\x01 \x03(\x0b\x32T.google.cloud.translation.v3.BatchTransferResourcesResponse.TransferResourceResponse\x1a]\n\x18TransferResourceResponse\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0e\n\x06target\x18\x02 \x01(\t\x12!\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\xbc\x03\n\x07\x44\x61taset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1c\n\x14source_language_code\x18\x03 \x01(\t\x12\x1c\n\x14target_language_code\x18\x04 \x01(\t\x12\x1a\n\rexample_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13train_example_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12#\n\x16validate_example_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12test_example_count\x18\x08 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:a\xea\x41^\n translate.googleapis.com/Dataset\x12:projects/{project}/locations/{location}/datasets/{dataset}\"\x87\x01\n\x12\x43reateModelRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x36\n\x05model\x18\x02 \x01(\x0b\x32\".google.cloud.translation.v3.ModelB\x03\xe0\x41\x02\"\xd6\x01\n\x13\x43reateModelMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\x94\x01\n\x11ListModelsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x04 \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\"a\n\x12ListModelsResponse\x12\x32\n\x06models\x18\x01 \x03(\x0b\x32\".google.cloud.translation.v3.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"G\n\x0fGetModelRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1etranslate.googleapis.com/Model\"J\n\x12\x44\x65leteModelRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1etranslate.googleapis.com/Model\"\xd6\x01\n\x13\x44\x65leteModelMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\xb3\x03\n\x05Model\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x03 \x01(\t\x12!\n\x14source_language_code\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12!\n\x14target_language_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13train_example_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12#\n\x16validate_example_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12test_example_count\x18\x0c \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:[\xea\x41X\n\x1etranslate.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}B\xcd\x01\n\x1d\x63om.google.cloud.translate.v3B\x16\x41utoMLTranslationProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\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.translation.v3.GcsInputSource", "google/cloud/translate/v3/common.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.rpc.Status", "google/rpc/status.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 Translate + module V3 + ImportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportDataRequest").msgclass + DatasetInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DatasetInputConfig").msgclass + DatasetInputConfig::InputFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DatasetInputConfig.InputFile").msgclass + ImportDataMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportDataMetadata").msgclass + ExportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ExportDataRequest").msgclass + DatasetOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DatasetOutputConfig").msgclass + ExportDataMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ExportDataMetadata").msgclass + DeleteDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteDatasetRequest").msgclass + DeleteDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteDatasetMetadata").msgclass + GetDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetDatasetRequest").msgclass + ListDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListDatasetsRequest").msgclass + ListDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListDatasetsResponse").msgclass + CreateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateDatasetRequest").msgclass + CreateDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateDatasetMetadata").msgclass + ListExamplesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListExamplesRequest").msgclass + ListExamplesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListExamplesResponse").msgclass + Example = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Example").msgclass + BatchTransferResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTransferResourcesResponse").msgclass + BatchTransferResourcesResponse::TransferResourceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTransferResourcesResponse.TransferResourceResponse").msgclass + Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Dataset").msgclass + CreateModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateModelRequest").msgclass + CreateModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateModelMetadata").msgclass + ListModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListModelsRequest").msgclass + ListModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListModelsResponse").msgclass + GetModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetModelRequest").msgclass + DeleteModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteModelRequest").msgclass + DeleteModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteModelMetadata").msgclass + Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Model").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb new file mode 100644 index 000000000000..780f191863aa --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" + +module Google + module Cloud + module Translate + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/translate/v3/rest" + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + module V3 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Translate"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v3/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb new file mode 100644 index 000000000000..d648a11bc7bc --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/translate/v3/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n&google/cloud/translate/v3/common.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"(\n\x0eGcsInputSource\x12\x16\n\tinput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"Z\n\x0f\x46ileInputSource\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\"6\n\x14GcsOutputDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xf8\x04\n\rGlossaryEntry\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12R\n\nterms_pair\x18\x02 \x01(\x0b\x32<.google.cloud.translation.v3.GlossaryEntry.GlossaryTermsPairH\x00\x12P\n\tterms_set\x18\x03 \x01(\x0b\x32;.google.cloud.translation.v3.GlossaryEntry.GlossaryTermsSetH\x00\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x1a\x93\x01\n\x11GlossaryTermsPair\x12>\n\x0bsource_term\x18\x01 \x01(\x0b\x32).google.cloud.translation.v3.GlossaryTerm\x12>\n\x0btarget_term\x18\x02 \x01(\x0b\x32).google.cloud.translation.v3.GlossaryTerm\x1aL\n\x10GlossaryTermsSet\x12\x38\n\x05terms\x18\x01 \x03(\x0b\x32).google.cloud.translation.v3.GlossaryTerm:\xac\x01\xea\x41\xa8\x01\n&translate.googleapis.com/GlossaryEntry\x12^projects/{project}/locations/{location}/glossaries/{glossary}/glossaryEntries/{glossary_entry}*\x0fglossaryEntries2\rglossaryEntryB\x06\n\x04\x64\x61ta\"3\n\x0cGlossaryTerm\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x0c\n\x04text\x18\x02 \x01(\t*\xc8\x01\n\x0eOperationState\x12\x1f\n\x1bOPERATION_STATE_UNSPECIFIED\x10\x00\x12\x1b\n\x17OPERATION_STATE_RUNNING\x10\x01\x12\x1d\n\x19OPERATION_STATE_SUCCEEDED\x10\x02\x12\x1a\n\x16OPERATION_STATE_FAILED\x10\x03\x12\x1e\n\x1aOPERATION_STATE_CANCELLING\x10\x04\x12\x1d\n\x19OPERATION_STATE_CANCELLED\x10\x05\x42\xc2\x01\n\x1d\x63om.google.cloud.translate.v3B\x0b\x43ommonProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\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 = [ + ] + 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 Translate + module V3 + GcsInputSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsInputSource").msgclass + FileInputSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.FileInputSource").msgclass + GcsOutputDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsOutputDestination").msgclass + GlossaryEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryEntry").msgclass + GlossaryEntry::GlossaryTermsPair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryEntry.GlossaryTermsPair").msgclass + GlossaryEntry::GlossaryTermsSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryEntry.GlossaryTermsSet").msgclass + GlossaryTerm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryTerm").msgclass + OperationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.OperationState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb new file mode 100644 index 000000000000..a65a2908a2bd --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service/rest" +require "google/cloud/translate/v3/bindings_override" +require "google/cloud/translate/v3/version" + +module Google + module Cloud + module Translate + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/translate/v3/rest" + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + module V3 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb new file mode 100644 index 000000000000..95ca52623d45 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/version" + +require "google/cloud/translate/v3/translation_service/credentials" +require "google/cloud/translate/v3/translation_service/paths" +require "google/cloud/translate/v3/translation_service/operations" +require "google/cloud/translate/v3/translation_service/client" +require "google/cloud/translate/v3/translation_service/rest" + +module Google + module Cloud + module Translate + module V3 + ## + # Provides natural language translation operations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/translate/v3/translation_service" + # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/translate/v3/translation_service/rest" + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + module TranslationService + end + end + end + end +end + +helper_path = ::File.join __dir__, "translation_service", "helpers.rb" +require "google/cloud/translate/v3/translation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb new file mode 100644 index 000000000000..98ad81401303 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb @@ -0,0 +1,4614 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Translate + module V3 + module TranslationService + ## + # Client for the TranslationService service. + # + # Provides natural language translation operations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :translation_service_stub + + ## + # Configure the TranslationService Client class. + # + # See {::Google::Cloud::Translate::V3::TranslationService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TranslationService clients + # ::Google::Cloud::Translate::V3::TranslationService::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", "Translate", "V3"] + 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.translate_text.timeout = 600.0 + + default_config.rpcs.detect_language.timeout = 600.0 + + default_config.rpcs.get_supported_languages.timeout = 600.0 + default_config.rpcs.get_supported_languages.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.translate_document.timeout = 600.0 + + default_config.rpcs.batch_translate_text.timeout = 600.0 + + default_config.rpcs.batch_translate_document.timeout = 600.0 + + default_config.rpcs.create_glossary.timeout = 600.0 + + default_config.rpcs.list_glossaries.timeout = 600.0 + default_config.rpcs.list_glossaries.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_glossary.timeout = 600.0 + default_config.rpcs.get_glossary.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_glossary.timeout = 600.0 + default_config.rpcs.delete_glossary.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TranslationService 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::Translate::V3::TranslationService::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 + @translation_service_stub.universe_domain + end + + ## + # Create a new TranslationService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TranslationService 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/translate/v3/translation_service_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 + + @translation_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Translate::V3::TranslationService::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, + logger: @config.logger + ) + + @translation_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @translation_service_stub.endpoint + config.universe_domain = @translation_service_stub.universe_domain + config.logger = @translation_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @translation_service_stub.endpoint + config.universe_domain = @translation_service_stub.universe_domain + config.logger = @translation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Translate::V3::TranslationService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @translation_service_stub.logger + end + + # Service calls + + ## + # Translates input text and returns translated text. + # + # @overload translate_text(request, options = nil) + # Pass arguments to `translate_text` via a request object, either of type + # {::Google::Cloud::Translate::V3::TranslateTextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::TranslateTextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload translate_text(contents: nil, mime_type: nil, source_language_code: nil, target_language_code: nil, parent: nil, model: nil, glossary_config: nil, transliteration_config: nil, labels: nil) + # Pass arguments to `translate_text` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param contents [::Array<::String>] + # Required. The content of the input in string format. + # We recommend the total content be less than 30,000 codepoints. The max + # length of this field is 1024. Use BatchTranslateText for larger text. + # @param mime_type [::String] + # Optional. The format of the source text, for example, "text/html", + # "text/plain". If left blank, the MIME type defaults to "text/html". + # @param source_language_code [::String] + # Optional. The ISO-639 language code of the input text if + # known, for example, "en-US" or "sr-Latn". Supported language codes are + # listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). If the source + # language isn't specified, the API attempts to identify the source language + # automatically and returns the source language within the response. + # @param target_language_code [::String] + # Required. The ISO-639 language code to use for translation of the input + # text, set to one of the language codes listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param parent [::String] + # Required. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}` or + # `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for requests using AutoML models or + # custom glossaries. + # + # Models and glossaries must be within the same region (have same + # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + # @param model [::String] + # Optional. The `model` type requested for this translation. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # - Translation LLM models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, + # + # For global (non-regionalized) requests, use `location-id` `global`. + # For example, + # `projects/{project-number-or-id}/locations/global/models/general/nmt`. + # + # If not provided, the default Google model (NMT) will be used + # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] + # Optional. Glossary to be applied. The glossary must be + # within the same region (have the same location-id) as the model, otherwise + # an INVALID_ARGUMENT (400) error is returned. + # @param transliteration_config [::Google::Cloud::Translate::V3::TransliterationConfig, ::Hash] + # Optional. Transliteration to be applied. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::TranslateTextResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::TranslateTextResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::TranslateTextRequest.new + # + # # Call the translate_text method. + # result = client.translate_text request + # + # # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. + # p result + # + def translate_text request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateTextRequest + + # Converts hash 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.translate_text.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::Translate::V3::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.translate_text.timeout, + metadata: metadata, + retry_policy: @config.rpcs.translate_text.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :translate_text, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Romanize input text written in non-Latin scripts to Latin text. + # + # @overload romanize_text(request, options = nil) + # Pass arguments to `romanize_text` via a request object, either of type + # {::Google::Cloud::Translate::V3::RomanizeTextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::RomanizeTextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload romanize_text(parent: nil, contents: nil, source_language_code: nil) + # Pass arguments to `romanize_text` via keyword arguments. Note that at + # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}` or + # `projects/{project-number-or-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # @param contents [::Array<::String>] + # Required. The content of the input in string format. + # @param source_language_code [::String] + # Optional. The ISO-639 language code of the input text if + # known, for example, "hi" or "zh". Supported language codes are + # listed in [Language + # Support](https://cloud.google.com/translate/docs/languages#roman). If the + # source language isn't specified, the API attempts to identify the source + # language automatically and returns the source language for each content in + # the response. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::RomanizeTextResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::RomanizeTextResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::RomanizeTextRequest.new + # + # # Call the romanize_text method. + # result = client.romanize_text request + # + # # The returned object is of type Google::Cloud::Translate::V3::RomanizeTextResponse. + # p result + # + def romanize_text request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::RomanizeTextRequest + + # Converts hash 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.romanize_text.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::Translate::V3::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.romanize_text.timeout, + metadata: metadata, + retry_policy: @config.rpcs.romanize_text.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :romanize_text, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Detects the language of text within a request. + # + # @overload detect_language(request, options = nil) + # Pass arguments to `detect_language` via a request object, either of type + # {::Google::Cloud::Translate::V3::DetectLanguageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DetectLanguageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload detect_language(parent: nil, model: nil, content: nil, mime_type: nil, labels: nil) + # Pass arguments to `detect_language` via keyword arguments. Note that at + # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}` or + # `projects/{project-number-or-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Only models within the same region (has same location-id) can be used. + # Otherwise an INVALID_ARGUMENT (400) error is returned. + # @param model [::String] + # Optional. The language detection model to be used. + # + # Format: + # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + # + # Only one language detection model is currently supported: + # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + # + # If not specified, the default model is used. + # @param content [::String] + # The content of the input stored as a string. + # @param mime_type [::String] + # Optional. The format of the source text, for example, "text/html", + # "text/plain". If left blank, the MIME type defaults to "text/html". + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::DetectLanguageResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::DetectLanguageResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DetectLanguageRequest.new + # + # # Call the detect_language method. + # result = client.detect_language request + # + # # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. + # p result + # + def detect_language request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DetectLanguageRequest + + # Converts hash 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.detect_language.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::Translate::V3::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.detect_language.timeout, + metadata: metadata, + retry_policy: @config.rpcs.detect_language.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :detect_language, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of supported languages for translation. + # + # @overload get_supported_languages(request, options = nil) + # Pass arguments to `get_supported_languages` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_supported_languages(parent: nil, display_language_code: nil, model: nil) + # Pass arguments to `get_supported_languages` via keyword arguments. Note that at + # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}` or + # `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for AutoML models. + # + # Only models within the same region (have same location-id) can be used, + # otherwise an INVALID_ARGUMENT (400) error is returned. + # @param display_language_code [::String] + # Optional. The language to use to return localized, human readable names + # of supported languages. If missing, then display names are not returned + # in a response. + # @param model [::String] + # Optional. Get supported languages of this model. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # Returns languages supported by the specified model. + # If missing, we get supported languages of Google general NMT model. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::SupportedLanguages] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::SupportedLanguages] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new + # + # # Call the get_supported_languages method. + # result = client.get_supported_languages request + # + # # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. + # p result + # + def get_supported_languages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest + + # Converts hash 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_supported_languages.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::Translate::V3::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.get_supported_languages.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_supported_languages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :get_supported_languages, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translates documents in synchronous mode. + # + # @overload translate_document(request, options = nil) + # Pass arguments to `translate_document` via a request object, either of type + # {::Google::Cloud::Translate::V3::TranslateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::TranslateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload translate_document(parent: nil, source_language_code: nil, target_language_code: nil, document_input_config: nil, document_output_config: nil, model: nil, glossary_config: nil, labels: nil, customized_attribution: nil, is_translate_native_pdf_only: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) + # Pass arguments to `translate_document` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for requests using AutoML models or custom + # glossaries. + # + # Models and glossaries must be within the same region (have the same + # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + # @param source_language_code [::String] + # Optional. The ISO-639 language code of the input document if known, for + # example, "en-US" or "sr-Latn". Supported language codes are listed in + # [Language Support](https://cloud.google.com/translate/docs/languages). If + # the source language isn't specified, the API attempts to identify the + # source language automatically and returns the source language within the + # response. Source language must be specified if the request contains a + # glossary or a custom model. + # @param target_language_code [::String] + # Required. The ISO-639 language code to use for translation of the input + # document, set to one of the language codes listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param document_input_config [::Google::Cloud::Translate::V3::DocumentInputConfig, ::Hash] + # Required. Input configurations. + # @param document_output_config [::Google::Cloud::Translate::V3::DocumentOutputConfig, ::Hash] + # Optional. Output configurations. + # Defines if the output file should be stored within Cloud Storage as well + # as the desired output format. If not provided the translated file will + # only be returned through a byte-stream and its output mime type will be + # the same as the input file's mime type. + # @param model [::String] + # Optional. The `model` type requested for this translation. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If not provided, the default Google model (NMT) will be used for + # translation. + # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] + # Optional. Glossary to be applied. The glossary must be within the same + # region (have the same location-id) as the model, otherwise an + # INVALID_ARGUMENT (400) error is returned. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters (Unicode + # codepoints), can only contain lowercase letters, numeric characters, + # underscores and dashes. International characters are allowed. Label values + # are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # @param customized_attribution [::String] + # Optional. This flag is to support user customized attribution. + # If not provided, the default is `Machine Translated by Google`. + # Customized attribution should follow rules in + # https://cloud.google.com/translate/attribution#attribution_and_logos + # @param is_translate_native_pdf_only [::Boolean] + # Optional. is_translate_native_pdf_only field for external customers. + # If true, the page limit of online native pdf translation is 300 and only + # native pdf pages will be translated. + # @param enable_shadow_removal_native_pdf [::Boolean] + # Optional. If true, use the text removal server to remove the shadow text on + # background image for native pdf translation. + # Shadow removal feature can only be enabled when + # is_translate_native_pdf_only: false && pdf_native_only: false + # @param enable_rotation_correction [::Boolean] + # Optional. If true, enable auto rotation correction in DVS. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::TranslateDocumentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::TranslateDocumentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new + # + # # Call the translate_document method. + # result = client.translate_document request + # + # # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. + # p result + # + def translate_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateDocumentRequest + + # Converts hash 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.translate_document.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::Translate::V3::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.translate_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.translate_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :translate_document, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translates a large volume of text in asynchronous batch mode. + # This function provides real-time output as the inputs are being processed. + # If caller cancels a request, the partial results (for an input file, it's + # all or nothing) may still be available on the specified output location. + # + # This call returns immediately and you can + # use google.longrunning.Operation.name to poll the status of the call. + # + # @overload batch_translate_text(request, options = nil) + # Pass arguments to `batch_translate_text` via a request object, either of type + # {::Google::Cloud::Translate::V3::BatchTranslateTextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::BatchTranslateTextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_translate_text(parent: nil, source_language_code: nil, target_language_codes: nil, models: nil, input_configs: nil, output_config: nil, glossaries: nil, labels: nil) + # Pass arguments to `batch_translate_text` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a call. Must refer to a caller's project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # The `global` location is not supported for batch translation. + # + # Only AutoML Translation models or glossaries within the same region (have + # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + # error is returned. + # @param source_language_code [::String] + # Required. Source language code. Supported language codes are listed in + # [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param target_language_codes [::Array<::String>] + # Required. Specify up to 10 language codes here. Supported language codes + # are listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param models [::Hash{::String => ::String}] + # Optional. The models to use for translation. Map's key is target language + # code. Map's value is model name. Value can be a built-in general model, + # or an AutoML Translation model. + # + # The value format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If the map is empty or a specific model is + # not requested for a language pair, then default google model (nmt) is used. + # @param input_configs [::Array<::Google::Cloud::Translate::V3::InputConfig, ::Hash>] + # Required. Input configurations. + # The total number of files matched should be <= 100. + # The total content size should be <= 100M Unicode codepoints. + # The files must use UTF-8 encoding. + # @param output_config [::Google::Cloud::Translate::V3::OutputConfig, ::Hash] + # Required. Output configuration. + # If 2 input configs match to the same file (that is, same input path), + # we don't generate output for duplicate inputs. + # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] + # Optional. Glossaries to be applied for translation. + # It's keyed by target language code. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new + # + # # Call the batch_translate_text method. + # result = client.batch_translate_text 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 batch_translate_text request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateTextRequest + + # Converts hash 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.batch_translate_text.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::Translate::V3::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.batch_translate_text.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_translate_text.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :batch_translate_text, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translates a large volume of document in asynchronous batch mode. + # This function provides real-time output as the inputs are being processed. + # If caller cancels a request, the partial results (for an input file, it's + # all or nothing) may still be available on the specified output location. + # + # This call returns immediately and you can use + # google.longrunning.Operation.name to poll the status of the call. + # + # @overload batch_translate_document(request, options = nil) + # Pass arguments to `batch_translate_document` via a request object, either of type + # {::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_translate_document(parent: nil, source_language_code: nil, target_language_codes: nil, input_configs: nil, output_config: nil, models: nil, glossaries: nil, format_conversions: nil, customized_attribution: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) + # Pass arguments to `batch_translate_document` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # The `global` location is not supported for batch translation. + # + # Only AutoML Translation models or glossaries within the same region (have + # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + # error is returned. + # @param source_language_code [::String] + # Required. The ISO-639 language code of the input document if known, for + # example, "en-US" or "sr-Latn". Supported language codes are listed in + # [Language Support](https://cloud.google.com/translate/docs/languages). + # @param target_language_codes [::Array<::String>] + # Required. The ISO-639 language code to use for translation of the input + # document. Specify up to 10 language codes here. Supported language codes + # are listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param input_configs [::Array<::Google::Cloud::Translate::V3::BatchDocumentInputConfig, ::Hash>] + # Required. Input configurations. + # The total number of files matched should be <= 100. + # The total content size to translate should be <= 100M Unicode codepoints. + # The files must use UTF-8 encoding. + # @param output_config [::Google::Cloud::Translate::V3::BatchDocumentOutputConfig, ::Hash] + # Required. Output configuration. + # If 2 input configs match to the same file (that is, same input path), + # we don't generate output for duplicate inputs. + # @param models [::Hash{::String => ::String}] + # Optional. The models to use for translation. Map's key is target language + # code. Map's value is the model name. Value can be a built-in general model, + # or an AutoML Translation model. + # + # The value format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If the map is empty or a specific model is + # not requested for a language pair, then default google model (nmt) is used. + # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] + # Optional. Glossaries to be applied. It's keyed by target language code. + # @param format_conversions [::Hash{::String => ::String}] + # Optional. The file format conversion map that is applied to all input + # files. The map key is the original mime_type. The map value is the target + # mime_type of translated documents. + # + # Supported file format conversion includes: + # - `application/pdf` to + # `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + # + # If nothing specified, output files will be in the same format as the + # original file. + # @param customized_attribution [::String] + # Optional. This flag is to support user customized attribution. + # If not provided, the default is `Machine Translated by Google`. + # Customized attribution should follow rules in + # https://cloud.google.com/translate/attribution#attribution_and_logos + # @param enable_shadow_removal_native_pdf [::Boolean] + # Optional. If true, use the text removal server to remove the shadow text on + # background image for native pdf translation. + # Shadow removal feature can only be enabled when + # is_translate_native_pdf_only: false && pdf_native_only: false + # @param enable_rotation_correction [::Boolean] + # Optional. If true, enable auto rotation correction in DVS. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new + # + # # Call the batch_translate_document method. + # result = client.batch_translate_document 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 batch_translate_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest + + # Converts hash 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.batch_translate_document.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::Translate::V3::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.batch_translate_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_translate_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :batch_translate_document, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a glossary and returns the long-running operation. Returns + # NOT_FOUND, if the project doesn't exist. + # + # @overload create_glossary(request, options = nil) + # Pass arguments to `create_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(parent: nil, glossary: nil) + # Pass arguments to `create_glossary` via keyword arguments. Note that at + # least one keyword argument is 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 project name. + # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] + # Required. The glossary to create. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new + # + # # Call the create_glossary method. + # result = client.create_glossary 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_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :create_glossary, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a glossary. A LRO is used since the update can be async if the + # glossary's entry file is updated. + # + # @overload update_glossary(request, options = nil) + # Pass arguments to `update_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::UpdateGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(glossary: nil, update_mask: nil) + # Pass arguments to `update_glossary` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] + # Required. The glossary entry to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. Currently only `display_name` and + # 'input_config' + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::UpdateGlossaryRequest.new + # + # # Call the update_glossary method. + # result = client.update_glossary 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_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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.glossary&.name + header_params["glossary.name"] = request.glossary.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_glossary.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :update_glossary, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + # exist. + # + # @overload list_glossaries(request, options = nil) + # Pass arguments to `list_glossaries` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListGlossariesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListGlossariesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossaries(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_glossaries` via keyword arguments. Note that at + # least one keyword argument is 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 name of the project from which to list all of the glossaries. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer glossaries than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of [ListGlossariesResponse.next_page_token] + # returned from the previous call to `ListGlossaries` method. + # The first page is returned if `page_token`is empty or missing. + # @param filter [::String] + # Optional. Filter specifying constraints of a list operation. + # Specify the constraint by the format of "key=value", where key must be + # "src" or "tgt", and the value must be a valid language code. + # For multiple restrictions, concatenate them by "AND" (uppercase only), + # such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + # here, which means using 'en-US' and 'en' can lead to different results, + # which depends on the language code you used when you create the glossary. + # For the unidirectional glossaries, the "src" and "tgt" add restrictions + # on the source and target language code separately. + # For the equivalent term set glossaries, the "src" and/or "tgt" add + # restrictions on the term set. + # For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + # glossaries which exactly match the source language code as "en-US" and the + # target language code "zh-CN", but all equivalent term set glossaries which + # contain "en-US" and "zh-CN" in their language set will be picked. + # If missing, no filtering is performed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListGlossariesRequest.new + # + # # Call the list_glossaries method. + # result = client.list_glossaries 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::Translate::V3::Glossary. + # p item + # end + # + def list_glossaries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossariesRequest + + # Converts hash 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_glossaries.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::Translate::V3::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_glossaries.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_glossaries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_glossaries, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_glossaries, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + # exist. + # + # @overload get_glossary(request, options = nil) + # Pass arguments to `get_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(name: nil) + # Pass arguments to `get_glossary` via keyword arguments. Note that at + # least one keyword argument is 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 glossary to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::Glossary] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::Glossary] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetGlossaryRequest.new + # + # # Call the get_glossary method. + # result = client.get_glossary request + # + # # The returned object is of type Google::Cloud::Translate::V3::Glossary. + # p result + # + def get_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :get_glossary, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a glossary, or cancels glossary construction + # if the glossary isn't created yet. + # Returns NOT_FOUND, if the glossary doesn't exist. + # + # @overload delete_glossary(request, options = nil) + # Pass arguments to `delete_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(name: nil) + # Pass arguments to `delete_glossary` via keyword arguments. Note that at + # least one keyword argument is 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 glossary to delete. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new + # + # # Call the delete_glossary method. + # result = client.delete_glossary 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_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :delete_glossary, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a single glossary entry by the given id. + # + # @overload get_glossary_entry(request, options = nil) + # Pass arguments to `get_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) + # Pass arguments to `get_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is 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 glossary entry to get + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::GlossaryEntry] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new + # + # # Call the get_glossary_entry method. + # result = client.get_glossary_entry request + # + # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + # p result + # + def get_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :get_glossary_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List the entries for the glossary. + # + # @overload list_glossary_entries(request, options = nil) + # Pass arguments to `list_glossary_entries` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entries(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_glossary_entries` via keyword arguments. Note that at + # least one keyword argument is 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 glossary resource name for listing the glossary's + # entries. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer glossary entries + # than requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # [ListGlossaryEntriesResponse.next_page_token] returned from the previous + # call. The first page is returned if `page_token`is empty or missing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.new + # + # # Call the list_glossary_entries method. + # result = client.list_glossary_entries 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::Translate::V3::GlossaryEntry. + # p item + # end + # + def list_glossary_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest + + # Converts hash 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_glossary_entries.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::Translate::V3::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_glossary_entries.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_glossary_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_glossary_entries, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_glossary_entries, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a glossary entry. + # + # @overload create_glossary_entry(request, options = nil) + # Pass arguments to `create_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(parent: nil, glossary_entry: nil) + # Pass arguments to `create_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is 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 glossary to create the entry under. + # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] + # Required. The glossary entry to create + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::GlossaryEntry] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new + # + # # Call the create_glossary_entry method. + # result = client.create_glossary_entry request + # + # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + # p result + # + def create_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :create_glossary_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a glossary entry. + # + # @overload update_glossary_entry(request, options = nil) + # Pass arguments to `update_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(glossary_entry: nil) + # Pass arguments to `update_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] + # Required. The glossary entry to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::GlossaryEntry] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new + # + # # Call the update_glossary_entry method. + # result = client.update_glossary_entry request + # + # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + # p result + # + def update_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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.glossary_entry&.name + header_params["glossary_entry.name"] = request.glossary_entry.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_glossary_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :update_glossary_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single entry from the glossary + # + # @overload delete_glossary_entry(request, options = nil) + # Pass arguments to `delete_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) + # Pass arguments to `delete_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is 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 glossary entry 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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new + # + # # Call the delete_glossary_entry method. + # result = client.delete_glossary_entry request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :delete_glossary_entry, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Dataset. + # + # @overload create_dataset(request, options = nil) + # Pass arguments to `create_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(parent: nil, dataset: nil) + # Pass arguments to `create_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 project name. + # @param dataset [::Google::Cloud::Translate::V3::Dataset, ::Hash] + # Required. The Dataset to create. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateDatasetRequest.new + # + # # Call the create_dataset method. + # result = client.create_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateDatasetRequest + + # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :create_dataset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Dataset. + # + # @overload get_dataset(request, options = nil) + # Pass arguments to `get_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `get_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 dataset to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::Dataset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::Dataset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetDatasetRequest.new + # + # # Call the get_dataset method. + # result = client.get_dataset request + # + # # The returned object is of type Google::Cloud::Translate::V3::Dataset. + # p result + # + def get_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetDatasetRequest + + # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :get_dataset, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists datasets. + # + # @overload list_datasets(request, options = nil) + # Pass arguments to `list_datasets` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListDatasetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datasets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_datasets` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @param page_size [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @param page_token [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListDatasets call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListDatasetsRequest.new + # + # # Call the list_datasets method. + # result = client.list_datasets 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::Translate::V3::Dataset. + # p item + # end + # + def list_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListDatasetsRequest + + # Converts hash 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_datasets.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::Translate::V3::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_datasets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_datasets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_datasets, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a dataset and all of its contents. + # + # @overload delete_dataset(request, options = nil) + # Pass arguments to `delete_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `delete_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 dataset to delete. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteDatasetRequest.new + # + # # Call the delete_dataset method. + # result = client.delete_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteDatasetRequest + + # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :delete_dataset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an Adaptive MT dataset. + # + # @overload create_adaptive_mt_dataset(request, options = nil) + # Pass arguments to `create_adaptive_mt_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(parent: nil, adaptive_mt_dataset: nil) + # Pass arguments to `create_adaptive_mt_dataset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @param adaptive_mt_dataset [::Google::Cloud::Translate::V3::AdaptiveMtDataset, ::Hash] + # Required. The AdaptiveMtDataset to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new + # + # # Call the create_adaptive_mt_dataset method. + # result = client.create_adaptive_mt_dataset request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. + # p result + # + def create_adaptive_mt_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest + + # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_adaptive_mt_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :create_adaptive_mt_dataset, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an Adaptive MT dataset, including all its entries and associated + # metadata. + # + # @overload delete_adaptive_mt_dataset(request, options = nil) + # Pass arguments to `delete_adaptive_mt_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) + # Pass arguments to `delete_adaptive_mt_dataset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the dataset. In the form of + # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new + # + # # Call the delete_adaptive_mt_dataset method. + # result = client.delete_adaptive_mt_dataset request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_adaptive_mt_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest + + # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_adaptive_mt_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :delete_adaptive_mt_dataset, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the Adaptive MT dataset. + # + # @overload get_adaptive_mt_dataset(request, options = nil) + # Pass arguments to `get_adaptive_mt_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) + # Pass arguments to `get_adaptive_mt_dataset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the dataset. In the form of + # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new + # + # # Call the get_adaptive_mt_dataset method. + # result = client.get_adaptive_mt_dataset request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. + # p result + # + def get_adaptive_mt_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest + + # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_adaptive_mt_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :get_adaptive_mt_dataset, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Adaptive MT datasets for which the caller has read permission. + # + # @overload list_adaptive_mt_datasets(request, options = nil) + # Pass arguments to `list_adaptive_mt_datasets` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_datasets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_adaptive_mt_datasets` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list the Adaptive + # MT datasets. `projects/{project-number-or-id}/locations/{location-id}` + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer results than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtDatasetsResponse.next_page_token returned from the + # previous call to `ListAdaptiveMtDatasets` method. The first page is + # returned if `page_token`is empty or missing. + # @param filter [::String] + # Optional. An expression for filtering the results of the request. + # Filter is not supported yet. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.new + # + # # Call the list_adaptive_mt_datasets method. + # result = client.list_adaptive_mt_datasets 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::Translate::V3::AdaptiveMtDataset. + # p item + # end + # + def list_adaptive_mt_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest + + # Converts hash 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_adaptive_mt_datasets.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::Translate::V3::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_adaptive_mt_datasets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_adaptive_mt_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_adaptive_mt_datasets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_datasets, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translate text using Adaptive MT. + # + # @overload adaptive_mt_translate(request, options = nil) + # Pass arguments to `adaptive_mt_translate` via a request object, either of type + # {::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload adaptive_mt_translate(parent: nil, dataset: nil, content: nil, reference_sentence_config: nil, glossary_config: nil) + # Pass arguments to `adaptive_mt_translate` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # @param dataset [::String] + # Required. The resource name for the dataset to use for adaptive MT. + # `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` + # @param content [::Array<::String>] + # Required. The content of the input in string format. + # @param reference_sentence_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig, ::Hash] + # Configuration for caller provided reference sentences. + # @param glossary_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig, ::Hash] + # Optional. Glossary to be applied. The glossary must be + # within the same region (have the same location-id) as the model, otherwise + # an INVALID_ARGUMENT (400) error is returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new + # + # # Call the adaptive_mt_translate method. + # result = client.adaptive_mt_translate request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse. + # p result + # + def adaptive_mt_translate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest + + # Converts hash 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.adaptive_mt_translate.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::Translate::V3::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.adaptive_mt_translate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.adaptive_mt_translate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :adaptive_mt_translate, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets and AdaptiveMtFile + # + # @overload get_adaptive_mt_file(request, options = nil) + # Pass arguments to `get_adaptive_mt_file` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) + # Pass arguments to `get_adaptive_mt_file` via keyword arguments. Note that at + # least one keyword argument is 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 file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtFile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new + # + # # Call the get_adaptive_mt_file method. + # result = client.get_adaptive_mt_file request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtFile. + # p result + # + def get_adaptive_mt_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest + + # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_adaptive_mt_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :get_adaptive_mt_file, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an AdaptiveMtFile along with its sentences. + # + # @overload delete_adaptive_mt_file(request, options = nil) + # Pass arguments to `delete_adaptive_mt_file` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) + # Pass arguments to `delete_adaptive_mt_file` via keyword arguments. Note that at + # least one keyword argument is 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 file to delete, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new + # + # # Call the delete_adaptive_mt_file method. + # result = client.delete_adaptive_mt_file request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_adaptive_mt_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest + + # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_adaptive_mt_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :delete_adaptive_mt_file, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports an AdaptiveMtFile and adds all of its sentences into the + # AdaptiveMtDataset. + # + # @overload import_adaptive_mt_file(request, options = nil) + # Pass arguments to `import_adaptive_mt_file` via a request object, either of type + # {::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_adaptive_mt_file(parent: nil, file_input_source: nil, gcs_input_source: nil) + # Pass arguments to `import_adaptive_mt_file` via keyword arguments. Note that at + # least one keyword argument is 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 file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}` + # @param file_input_source [::Google::Cloud::Translate::V3::FileInputSource, ::Hash] + # Inline file source. + # + # Note: The following parameters are mutually exclusive: `file_input_source`, `gcs_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] + # Google Cloud Storage file source. + # + # Note: The following parameters are mutually exclusive: `gcs_input_source`, `file_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new + # + # # Call the import_adaptive_mt_file method. + # result = client.import_adaptive_mt_file request + # + # # The returned object is of type Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse. + # p result + # + def import_adaptive_mt_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest + + # Converts hash 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.import_adaptive_mt_file.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::Translate::V3::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.import_adaptive_mt_file.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_adaptive_mt_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :import_adaptive_mt_file, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset. + # + # @overload list_adaptive_mt_files(request, options = nil) + # Pass arguments to `list_adaptive_mt_files` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_files(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_adaptive_mt_files` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list the Adaptive + # MT files. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` + # @param page_size [::Integer] + # Optional. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtFilesResponse.next_page_token returned from the + # previous call to `ListAdaptiveMtFiles` method. The first page is + # returned if `page_token`is empty or missing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.new + # + # # Call the list_adaptive_mt_files method. + # result = client.list_adaptive_mt_files 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::Translate::V3::AdaptiveMtFile. + # p item + # end + # + def list_adaptive_mt_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest + + # Converts hash 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_adaptive_mt_files.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::Translate::V3::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_adaptive_mt_files.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_adaptive_mt_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_adaptive_mt_files, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all AdaptiveMtSentences under a given file/dataset. + # + # @overload list_adaptive_mt_sentences(request, options = nil) + # Pass arguments to `list_adaptive_mt_sentences` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_sentences(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_adaptive_mt_sentences` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list the Adaptive + # MT files. The following format lists all sentences under a file. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # The following format lists all sentences within a dataset. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` + # @param page_size [::Integer] + # @param page_token [::String] + # A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtSentencesRequest.next_page_token returned from the + # previous call to `ListTranslationMemories` method. The first page is + # returned if `page_token` is empty or missing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.new + # + # # Call the list_adaptive_mt_sentences method. + # result = client.list_adaptive_mt_sentences 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::Translate::V3::AdaptiveMtSentence. + # p item + # end + # + def list_adaptive_mt_sentences request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest + + # Converts hash 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_adaptive_mt_sentences.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::Translate::V3::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_adaptive_mt_sentences.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_adaptive_mt_sentences.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_adaptive_mt_sentences, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_sentences, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Import sentence pairs into translation Dataset. + # + # @overload import_data(request, options = nil) + # Pass arguments to `import_data` via a request object, either of type + # {::Google::Cloud::Translate::V3::ImportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ImportDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_data(dataset: nil, input_config: nil) + # Pass arguments to `import_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. Name of the dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @param input_config [::Google::Cloud::Translate::V3::DatasetInputConfig, ::Hash] + # Required. The config for the input content. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ImportDataRequest.new + # + # # Call the import_data method. + # result = client.import_data 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 import_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportDataRequest + + # Converts hash 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.import_data.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::Translate::V3::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.dataset + header_params["dataset"] = request.dataset + 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.import_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :import_data, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports dataset's data to the provided output location. + # + # @overload export_data(request, options = nil) + # Pass arguments to `export_data` via a request object, either of type + # {::Google::Cloud::Translate::V3::ExportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ExportDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_data(dataset: nil, output_config: nil) + # Pass arguments to `export_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. Name of the dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @param output_config [::Google::Cloud::Translate::V3::DatasetOutputConfig, ::Hash] + # Required. The config for the output content. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ExportDataRequest.new + # + # # Call the export_data method. + # result = client.export_data 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 export_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ExportDataRequest + + # Converts hash 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.export_data.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::Translate::V3::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.dataset + header_params["dataset"] = request.dataset + 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.export_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :export_data, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists sentence pairs in the dataset. + # + # @overload list_examples(request, options = nil) + # Pass arguments to `list_examples` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListExamplesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListExamplesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_examples(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_examples` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @param filter [::String] + # Optional. An expression for filtering the examples that will be returned. + # Example filter: + # * `usage=TRAIN` + # @param page_size [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @param page_token [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListExamples call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListExamplesRequest.new + # + # # Call the list_examples method. + # result = client.list_examples 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::Translate::V3::Example. + # p item + # end + # + def list_examples request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListExamplesRequest + + # Converts hash 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_examples.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::Translate::V3::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_examples.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_examples.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_examples, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_examples, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Model. + # + # @overload create_model(request, options = nil) + # Pass arguments to `create_model` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil) + # Pass arguments to `create_model` via keyword arguments. Note that at + # least one keyword argument is 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 project name, in form of + # `projects/{project}/locations/{location}` + # @param model [::Google::Cloud::Translate::V3::Model, ::Hash] + # Required. The Model to create. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateModelRequest.new + # + # # Call the create_model method. + # result = client.create_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateModelRequest + + # Converts hash 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_model.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::Translate::V3::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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :create_model, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists models. + # + # @overload list_models(request, options = nil) + # Pass arguments to `list_models` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_models(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_models` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @param filter [::String] + # Optional. An expression for filtering the models that will be returned. + # Supported filter: + # `dataset_id=${dataset_id}` + # @param page_size [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @param page_token [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListModels call. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListModelsRequest.new + # + # # Call the list_models method. + # result = client.list_models 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::Translate::V3::Model. + # p item + # end + # + def list_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListModelsRequest + + # Converts hash 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_models.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::Translate::V3::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_models.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :list_models, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_models, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a model. + # + # @overload get_model(request, options = nil) + # Pass arguments to `get_model` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `get_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Translate::V3::Model] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Translate::V3::Model] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetModelRequest.new + # + # # Call the get_model method. + # result = client.get_model request + # + # # The returned object is of type Google::Cloud::Translate::V3::Model. + # p result + # + def get_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetModelRequest + + # Converts hash 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_model.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::Translate::V3::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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :get_model, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a model. + # + # @overload delete_model(request, options = nil) + # Pass arguments to `delete_model` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `delete_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to delete. + # + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteModelRequest.new + # + # # Call the delete_model method. + # result = client.delete_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteModelRequest + + # Converts hash 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_model.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::Translate::V3::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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.call_rpc :delete_model, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TranslationService API. + # + # This class represents the configuration for TranslationService, + # 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::Translate::V3::TranslationService::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 + # # translate_text to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Translate::V3::TranslationService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.translate_text.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.translate_text.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TranslationService 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 `translate_text` + # @return [::Gapic::Config::Method] + # + attr_reader :translate_text + ## + # RPC-specific configuration for `romanize_text` + # @return [::Gapic::Config::Method] + # + attr_reader :romanize_text + ## + # RPC-specific configuration for `detect_language` + # @return [::Gapic::Config::Method] + # + attr_reader :detect_language + ## + # RPC-specific configuration for `get_supported_languages` + # @return [::Gapic::Config::Method] + # + attr_reader :get_supported_languages + ## + # RPC-specific configuration for `translate_document` + # @return [::Gapic::Config::Method] + # + attr_reader :translate_document + ## + # RPC-specific configuration for `batch_translate_text` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_translate_text + ## + # RPC-specific configuration for `batch_translate_document` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_translate_document + ## + # RPC-specific configuration for `create_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :create_glossary + ## + # RPC-specific configuration for `update_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :update_glossary + ## + # RPC-specific configuration for `list_glossaries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_glossaries + ## + # RPC-specific configuration for `get_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :get_glossary + ## + # RPC-specific configuration for `delete_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_glossary + ## + # RPC-specific configuration for `get_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :get_glossary_entry + ## + # RPC-specific configuration for `list_glossary_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_glossary_entries + ## + # RPC-specific configuration for `create_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :create_glossary_entry + ## + # RPC-specific configuration for `update_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :update_glossary_entry + ## + # RPC-specific configuration for `delete_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_glossary_entry + ## + # RPC-specific configuration for `create_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset + ## + # RPC-specific configuration for `get_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset + ## + # RPC-specific configuration for `list_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_datasets + ## + # RPC-specific configuration for `delete_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset + ## + # RPC-specific configuration for `create_adaptive_mt_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_adaptive_mt_dataset + ## + # RPC-specific configuration for `delete_adaptive_mt_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_adaptive_mt_dataset + ## + # RPC-specific configuration for `get_adaptive_mt_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_adaptive_mt_dataset + ## + # RPC-specific configuration for `list_adaptive_mt_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_adaptive_mt_datasets + ## + # RPC-specific configuration for `adaptive_mt_translate` + # @return [::Gapic::Config::Method] + # + attr_reader :adaptive_mt_translate + ## + # RPC-specific configuration for `get_adaptive_mt_file` + # @return [::Gapic::Config::Method] + # + attr_reader :get_adaptive_mt_file + ## + # RPC-specific configuration for `delete_adaptive_mt_file` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_adaptive_mt_file + ## + # RPC-specific configuration for `import_adaptive_mt_file` + # @return [::Gapic::Config::Method] + # + attr_reader :import_adaptive_mt_file + ## + # RPC-specific configuration for `list_adaptive_mt_files` + # @return [::Gapic::Config::Method] + # + attr_reader :list_adaptive_mt_files + ## + # RPC-specific configuration for `list_adaptive_mt_sentences` + # @return [::Gapic::Config::Method] + # + attr_reader :list_adaptive_mt_sentences + ## + # RPC-specific configuration for `import_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_data + ## + # RPC-specific configuration for `export_data` + # @return [::Gapic::Config::Method] + # + attr_reader :export_data + ## + # RPC-specific configuration for `list_examples` + # @return [::Gapic::Config::Method] + # + attr_reader :list_examples + ## + # RPC-specific configuration for `create_model` + # @return [::Gapic::Config::Method] + # + attr_reader :create_model + ## + # RPC-specific configuration for `list_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_models + ## + # RPC-specific configuration for `get_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model + ## + # RPC-specific configuration for `delete_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model + + # @private + def initialize parent_rpcs = nil + translate_text_config = parent_rpcs.translate_text if parent_rpcs.respond_to? :translate_text + @translate_text = ::Gapic::Config::Method.new translate_text_config + romanize_text_config = parent_rpcs.romanize_text if parent_rpcs.respond_to? :romanize_text + @romanize_text = ::Gapic::Config::Method.new romanize_text_config + detect_language_config = parent_rpcs.detect_language if parent_rpcs.respond_to? :detect_language + @detect_language = ::Gapic::Config::Method.new detect_language_config + get_supported_languages_config = parent_rpcs.get_supported_languages if parent_rpcs.respond_to? :get_supported_languages + @get_supported_languages = ::Gapic::Config::Method.new get_supported_languages_config + translate_document_config = parent_rpcs.translate_document if parent_rpcs.respond_to? :translate_document + @translate_document = ::Gapic::Config::Method.new translate_document_config + batch_translate_text_config = parent_rpcs.batch_translate_text if parent_rpcs.respond_to? :batch_translate_text + @batch_translate_text = ::Gapic::Config::Method.new batch_translate_text_config + batch_translate_document_config = parent_rpcs.batch_translate_document if parent_rpcs.respond_to? :batch_translate_document + @batch_translate_document = ::Gapic::Config::Method.new batch_translate_document_config + create_glossary_config = parent_rpcs.create_glossary if parent_rpcs.respond_to? :create_glossary + @create_glossary = ::Gapic::Config::Method.new create_glossary_config + update_glossary_config = parent_rpcs.update_glossary if parent_rpcs.respond_to? :update_glossary + @update_glossary = ::Gapic::Config::Method.new update_glossary_config + list_glossaries_config = parent_rpcs.list_glossaries if parent_rpcs.respond_to? :list_glossaries + @list_glossaries = ::Gapic::Config::Method.new list_glossaries_config + get_glossary_config = parent_rpcs.get_glossary if parent_rpcs.respond_to? :get_glossary + @get_glossary = ::Gapic::Config::Method.new get_glossary_config + delete_glossary_config = parent_rpcs.delete_glossary if parent_rpcs.respond_to? :delete_glossary + @delete_glossary = ::Gapic::Config::Method.new delete_glossary_config + get_glossary_entry_config = parent_rpcs.get_glossary_entry if parent_rpcs.respond_to? :get_glossary_entry + @get_glossary_entry = ::Gapic::Config::Method.new get_glossary_entry_config + list_glossary_entries_config = parent_rpcs.list_glossary_entries if parent_rpcs.respond_to? :list_glossary_entries + @list_glossary_entries = ::Gapic::Config::Method.new list_glossary_entries_config + create_glossary_entry_config = parent_rpcs.create_glossary_entry if parent_rpcs.respond_to? :create_glossary_entry + @create_glossary_entry = ::Gapic::Config::Method.new create_glossary_entry_config + update_glossary_entry_config = parent_rpcs.update_glossary_entry if parent_rpcs.respond_to? :update_glossary_entry + @update_glossary_entry = ::Gapic::Config::Method.new update_glossary_entry_config + delete_glossary_entry_config = parent_rpcs.delete_glossary_entry if parent_rpcs.respond_to? :delete_glossary_entry + @delete_glossary_entry = ::Gapic::Config::Method.new delete_glossary_entry_config + create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset + @create_dataset = ::Gapic::Config::Method.new create_dataset_config + get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset + @get_dataset = ::Gapic::Config::Method.new get_dataset_config + list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets + @list_datasets = ::Gapic::Config::Method.new list_datasets_config + delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset + @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config + create_adaptive_mt_dataset_config = parent_rpcs.create_adaptive_mt_dataset if parent_rpcs.respond_to? :create_adaptive_mt_dataset + @create_adaptive_mt_dataset = ::Gapic::Config::Method.new create_adaptive_mt_dataset_config + delete_adaptive_mt_dataset_config = parent_rpcs.delete_adaptive_mt_dataset if parent_rpcs.respond_to? :delete_adaptive_mt_dataset + @delete_adaptive_mt_dataset = ::Gapic::Config::Method.new delete_adaptive_mt_dataset_config + get_adaptive_mt_dataset_config = parent_rpcs.get_adaptive_mt_dataset if parent_rpcs.respond_to? :get_adaptive_mt_dataset + @get_adaptive_mt_dataset = ::Gapic::Config::Method.new get_adaptive_mt_dataset_config + list_adaptive_mt_datasets_config = parent_rpcs.list_adaptive_mt_datasets if parent_rpcs.respond_to? :list_adaptive_mt_datasets + @list_adaptive_mt_datasets = ::Gapic::Config::Method.new list_adaptive_mt_datasets_config + adaptive_mt_translate_config = parent_rpcs.adaptive_mt_translate if parent_rpcs.respond_to? :adaptive_mt_translate + @adaptive_mt_translate = ::Gapic::Config::Method.new adaptive_mt_translate_config + get_adaptive_mt_file_config = parent_rpcs.get_adaptive_mt_file if parent_rpcs.respond_to? :get_adaptive_mt_file + @get_adaptive_mt_file = ::Gapic::Config::Method.new get_adaptive_mt_file_config + delete_adaptive_mt_file_config = parent_rpcs.delete_adaptive_mt_file if parent_rpcs.respond_to? :delete_adaptive_mt_file + @delete_adaptive_mt_file = ::Gapic::Config::Method.new delete_adaptive_mt_file_config + import_adaptive_mt_file_config = parent_rpcs.import_adaptive_mt_file if parent_rpcs.respond_to? :import_adaptive_mt_file + @import_adaptive_mt_file = ::Gapic::Config::Method.new import_adaptive_mt_file_config + list_adaptive_mt_files_config = parent_rpcs.list_adaptive_mt_files if parent_rpcs.respond_to? :list_adaptive_mt_files + @list_adaptive_mt_files = ::Gapic::Config::Method.new list_adaptive_mt_files_config + list_adaptive_mt_sentences_config = parent_rpcs.list_adaptive_mt_sentences if parent_rpcs.respond_to? :list_adaptive_mt_sentences + @list_adaptive_mt_sentences = ::Gapic::Config::Method.new list_adaptive_mt_sentences_config + import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data + @import_data = ::Gapic::Config::Method.new import_data_config + export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data + @export_data = ::Gapic::Config::Method.new export_data_config + list_examples_config = parent_rpcs.list_examples if parent_rpcs.respond_to? :list_examples + @list_examples = ::Gapic::Config::Method.new list_examples_config + create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model + @create_model = ::Gapic::Config::Method.new create_model_config + list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models + @list_models = ::Gapic::Config::Method.new list_models_config + get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model + @get_model = ::Gapic::Config::Method.new get_model_config + delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model + @delete_model = ::Gapic::Config::Method.new delete_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb new file mode 100644 index 000000000000..8cca11bc3a91 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + module TranslationService + # Credentials for the TranslationService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-translation" + ] + self.env_vars = [ + "TRANSLATE_CREDENTIALS", + "TRANSLATE_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "TRANSLATE_CREDENTIALS_JSON", + "TRANSLATE_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-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb new file mode 100644 index 000000000000..6bd74364f287 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb @@ -0,0 +1,849 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + module TranslationService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TranslationService 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 TranslationService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::Translate::V3::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? + throw :response, 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::Translate::V3::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? + throw :response, 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::Translate::V3::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? + 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::Translate::V3::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? + 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::Translate::V3::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.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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb new file mode 100644 index 000000000000..1f51c2c96070 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + module TranslationService + # Path helper methods for the TranslationService API. + module Paths + ## + # Create a fully-qualified AdaptiveMtDataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # + # @return [::String] + def adaptive_mt_dataset_path project:, location:, dataset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/adaptiveMtDatasets/#{dataset}" + end + + ## + # Create a fully-qualified AdaptiveMtFile resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # @param file [String] + # + # @return [::String] + def adaptive_mt_file_path project:, location:, dataset:, file: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" + + "projects/#{project}/locations/#{location}/adaptiveMtDatasets/#{dataset}/adaptiveMtFiles/#{file}" + end + + ## + # Create a fully-qualified Dataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/datasets/{dataset}` + # + # @param project [String] + # @param location [String] + # @param dataset [String] + # + # @return [::String] + def dataset_path project:, location:, dataset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/datasets/#{dataset}" + end + + ## + # Create a fully-qualified Glossary resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/glossaries/{glossary}` + # + # @param project [String] + # @param location [String] + # @param glossary [String] + # + # @return [::String] + def glossary_path project:, location:, glossary: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/glossaries/#{glossary}" + end + + ## + # Create a fully-qualified GlossaryEntry resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/glossaries/{glossary}/glossaryEntries/{glossary_entry}` + # + # @param project [String] + # @param location [String] + # @param glossary [String] + # @param glossary_entry [String] + # + # @return [::String] + def glossary_entry_path project:, location:, glossary:, glossary_entry: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "glossary cannot contain /" if glossary.to_s.include? "/" + + "projects/#{project}/locations/#{location}/glossaries/#{glossary}/glossaryEntries/#{glossary_entry}" + 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 Model resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/models/{model}` + # + # @param project [String] + # @param location [String] + # @param model [String] + # + # @return [::String] + def model_path project:, location:, model: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/models/#{model}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb new file mode 100644 index 000000000000..7aa1906ff964 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/version" +require "google/cloud/translate/v3/bindings_override" + +require "google/cloud/translate/v3/translation_service/credentials" +require "google/cloud/translate/v3/translation_service/paths" +require "google/cloud/translate/v3/translation_service/rest/operations" +require "google/cloud/translate/v3/translation_service/rest/client" + +module Google + module Cloud + module Translate + module V3 + ## + # Provides natural language translation operations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/translate/v3/translation_service/rest" + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + module TranslationService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/translate/v3/translation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb new file mode 100644 index 000000000000..bd67b608db1b --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb @@ -0,0 +1,4313 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" +require "google/cloud/translate/v3/translation_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Translate + module V3 + module TranslationService + module Rest + ## + # REST client for the TranslationService service. + # + # Provides natural language translation operations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :translation_service_stub + + ## + # Configure the TranslationService Client class. + # + # See {::Google::Cloud::Translate::V3::TranslationService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all TranslationService clients + # ::Google::Cloud::Translate::V3::TranslationService::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", "Translate", "V3"] + 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.translate_text.timeout = 600.0 + + default_config.rpcs.detect_language.timeout = 600.0 + + default_config.rpcs.get_supported_languages.timeout = 600.0 + default_config.rpcs.get_supported_languages.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.translate_document.timeout = 600.0 + + default_config.rpcs.batch_translate_text.timeout = 600.0 + + default_config.rpcs.batch_translate_document.timeout = 600.0 + + default_config.rpcs.create_glossary.timeout = 600.0 + + default_config.rpcs.list_glossaries.timeout = 600.0 + default_config.rpcs.list_glossaries.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_glossary.timeout = 600.0 + default_config.rpcs.get_glossary.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_glossary.timeout = 600.0 + default_config.rpcs.delete_glossary.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the TranslationService 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::Translate::V3::TranslationService::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 + @translation_service_stub.universe_domain + end + + ## + # Create a new TranslationService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the TranslationService 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::Translate::V3::TranslationService::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 + + @translation_service_stub = ::Google::Cloud::Translate::V3::TranslationService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @translation_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @translation_service_stub.endpoint + config.universe_domain = @translation_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @translation_service_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @translation_service_stub.endpoint + config.universe_domain = @translation_service_stub.universe_domain + config.logger = @translation_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Translate::V3::TranslationService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @translation_service_stub.logger + end + + # Service calls + + ## + # Translates input text and returns translated text. + # + # @overload translate_text(request, options = nil) + # Pass arguments to `translate_text` via a request object, either of type + # {::Google::Cloud::Translate::V3::TranslateTextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::TranslateTextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload translate_text(contents: nil, mime_type: nil, source_language_code: nil, target_language_code: nil, parent: nil, model: nil, glossary_config: nil, transliteration_config: nil, labels: nil) + # Pass arguments to `translate_text` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param contents [::Array<::String>] + # Required. The content of the input in string format. + # We recommend the total content be less than 30,000 codepoints. The max + # length of this field is 1024. Use BatchTranslateText for larger text. + # @param mime_type [::String] + # Optional. The format of the source text, for example, "text/html", + # "text/plain". If left blank, the MIME type defaults to "text/html". + # @param source_language_code [::String] + # Optional. The ISO-639 language code of the input text if + # known, for example, "en-US" or "sr-Latn". Supported language codes are + # listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). If the source + # language isn't specified, the API attempts to identify the source language + # automatically and returns the source language within the response. + # @param target_language_code [::String] + # Required. The ISO-639 language code to use for translation of the input + # text, set to one of the language codes listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param parent [::String] + # Required. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}` or + # `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for requests using AutoML models or + # custom glossaries. + # + # Models and glossaries must be within the same region (have same + # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + # @param model [::String] + # Optional. The `model` type requested for this translation. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # - Translation LLM models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, + # + # For global (non-regionalized) requests, use `location-id` `global`. + # For example, + # `projects/{project-number-or-id}/locations/global/models/general/nmt`. + # + # If not provided, the default Google model (NMT) will be used + # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] + # Optional. Glossary to be applied. The glossary must be + # within the same region (have the same location-id) as the model, otherwise + # an INVALID_ARGUMENT (400) error is returned. + # @param transliteration_config [::Google::Cloud::Translate::V3::TransliterationConfig, ::Hash] + # Optional. Transliteration to be applied. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::TranslateTextResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::TranslateTextResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::TranslateTextRequest.new + # + # # Call the translate_text method. + # result = client.translate_text request + # + # # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. + # p result + # + def translate_text request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateTextRequest + + # Converts hash 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.translate_text.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::Translate::V3::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.translate_text.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.translate_text.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.translate_text request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Romanize input text written in non-Latin scripts to Latin text. + # + # @overload romanize_text(request, options = nil) + # Pass arguments to `romanize_text` via a request object, either of type + # {::Google::Cloud::Translate::V3::RomanizeTextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::RomanizeTextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload romanize_text(parent: nil, contents: nil, source_language_code: nil) + # Pass arguments to `romanize_text` via keyword arguments. Note that at + # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}` or + # `projects/{project-number-or-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # @param contents [::Array<::String>] + # Required. The content of the input in string format. + # @param source_language_code [::String] + # Optional. The ISO-639 language code of the input text if + # known, for example, "hi" or "zh". Supported language codes are + # listed in [Language + # Support](https://cloud.google.com/translate/docs/languages#roman). If the + # source language isn't specified, the API attempts to identify the source + # language automatically and returns the source language for each content in + # the response. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::RomanizeTextResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::RomanizeTextResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::RomanizeTextRequest.new + # + # # Call the romanize_text method. + # result = client.romanize_text request + # + # # The returned object is of type Google::Cloud::Translate::V3::RomanizeTextResponse. + # p result + # + def romanize_text request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::RomanizeTextRequest + + # Converts hash 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.romanize_text.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::Translate::V3::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.romanize_text.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.romanize_text.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.romanize_text request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Detects the language of text within a request. + # + # @overload detect_language(request, options = nil) + # Pass arguments to `detect_language` via a request object, either of type + # {::Google::Cloud::Translate::V3::DetectLanguageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DetectLanguageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload detect_language(parent: nil, model: nil, content: nil, mime_type: nil, labels: nil) + # Pass arguments to `detect_language` via keyword arguments. Note that at + # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}` or + # `projects/{project-number-or-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Only models within the same region (has same location-id) can be used. + # Otherwise an INVALID_ARGUMENT (400) error is returned. + # @param model [::String] + # Optional. The language detection model to be used. + # + # Format: + # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + # + # Only one language detection model is currently supported: + # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + # + # If not specified, the default model is used. + # @param content [::String] + # The content of the input stored as a string. + # @param mime_type [::String] + # Optional. The format of the source text, for example, "text/html", + # "text/plain". If left blank, the MIME type defaults to "text/html". + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::DetectLanguageResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::DetectLanguageResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DetectLanguageRequest.new + # + # # Call the detect_language method. + # result = client.detect_language request + # + # # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. + # p result + # + def detect_language request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DetectLanguageRequest + + # Converts hash 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.detect_language.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::Translate::V3::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.detect_language.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.detect_language.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.detect_language request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of supported languages for translation. + # + # @overload get_supported_languages(request, options = nil) + # Pass arguments to `get_supported_languages` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_supported_languages(parent: nil, display_language_code: nil, model: nil) + # Pass arguments to `get_supported_languages` via keyword arguments. Note that at + # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}` or + # `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for AutoML models. + # + # Only models within the same region (have same location-id) can be used, + # otherwise an INVALID_ARGUMENT (400) error is returned. + # @param display_language_code [::String] + # Optional. The language to use to return localized, human readable names + # of supported languages. If missing, then display names are not returned + # in a response. + # @param model [::String] + # Optional. Get supported languages of this model. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # Returns languages supported by the specified model. + # If missing, we get supported languages of Google general NMT model. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::SupportedLanguages] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::SupportedLanguages] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new + # + # # Call the get_supported_languages method. + # result = client.get_supported_languages request + # + # # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. + # p result + # + def get_supported_languages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest + + # Converts hash 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_supported_languages.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::Translate::V3::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_supported_languages.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_supported_languages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.get_supported_languages request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translates documents in synchronous mode. + # + # @overload translate_document(request, options = nil) + # Pass arguments to `translate_document` via a request object, either of type + # {::Google::Cloud::Translate::V3::TranslateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::TranslateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload translate_document(parent: nil, source_language_code: nil, target_language_code: nil, document_input_config: nil, document_output_config: nil, model: nil, glossary_config: nil, labels: nil, customized_attribution: nil, is_translate_native_pdf_only: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) + # Pass arguments to `translate_document` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for requests using AutoML models or custom + # glossaries. + # + # Models and glossaries must be within the same region (have the same + # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + # @param source_language_code [::String] + # Optional. The ISO-639 language code of the input document if known, for + # example, "en-US" or "sr-Latn". Supported language codes are listed in + # [Language Support](https://cloud.google.com/translate/docs/languages). If + # the source language isn't specified, the API attempts to identify the + # source language automatically and returns the source language within the + # response. Source language must be specified if the request contains a + # glossary or a custom model. + # @param target_language_code [::String] + # Required. The ISO-639 language code to use for translation of the input + # document, set to one of the language codes listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param document_input_config [::Google::Cloud::Translate::V3::DocumentInputConfig, ::Hash] + # Required. Input configurations. + # @param document_output_config [::Google::Cloud::Translate::V3::DocumentOutputConfig, ::Hash] + # Optional. Output configurations. + # Defines if the output file should be stored within Cloud Storage as well + # as the desired output format. If not provided the translated file will + # only be returned through a byte-stream and its output mime type will be + # the same as the input file's mime type. + # @param model [::String] + # Optional. The `model` type requested for this translation. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If not provided, the default Google model (NMT) will be used for + # translation. + # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] + # Optional. Glossary to be applied. The glossary must be within the same + # region (have the same location-id) as the model, otherwise an + # INVALID_ARGUMENT (400) error is returned. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters (Unicode + # codepoints), can only contain lowercase letters, numeric characters, + # underscores and dashes. International characters are allowed. Label values + # are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # @param customized_attribution [::String] + # Optional. This flag is to support user customized attribution. + # If not provided, the default is `Machine Translated by Google`. + # Customized attribution should follow rules in + # https://cloud.google.com/translate/attribution#attribution_and_logos + # @param is_translate_native_pdf_only [::Boolean] + # Optional. is_translate_native_pdf_only field for external customers. + # If true, the page limit of online native pdf translation is 300 and only + # native pdf pages will be translated. + # @param enable_shadow_removal_native_pdf [::Boolean] + # Optional. If true, use the text removal server to remove the shadow text on + # background image for native pdf translation. + # Shadow removal feature can only be enabled when + # is_translate_native_pdf_only: false && pdf_native_only: false + # @param enable_rotation_correction [::Boolean] + # Optional. If true, enable auto rotation correction in DVS. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::TranslateDocumentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::TranslateDocumentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new + # + # # Call the translate_document method. + # result = client.translate_document request + # + # # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. + # p result + # + def translate_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateDocumentRequest + + # Converts hash 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.translate_document.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::Translate::V3::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.translate_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.translate_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.translate_document request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translates a large volume of text in asynchronous batch mode. + # This function provides real-time output as the inputs are being processed. + # If caller cancels a request, the partial results (for an input file, it's + # all or nothing) may still be available on the specified output location. + # + # This call returns immediately and you can + # use google.longrunning.Operation.name to poll the status of the call. + # + # @overload batch_translate_text(request, options = nil) + # Pass arguments to `batch_translate_text` via a request object, either of type + # {::Google::Cloud::Translate::V3::BatchTranslateTextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::BatchTranslateTextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_translate_text(parent: nil, source_language_code: nil, target_language_codes: nil, models: nil, input_configs: nil, output_config: nil, glossaries: nil, labels: nil) + # Pass arguments to `batch_translate_text` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a call. Must refer to a caller's project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # The `global` location is not supported for batch translation. + # + # Only AutoML Translation models or glossaries within the same region (have + # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + # error is returned. + # @param source_language_code [::String] + # Required. Source language code. Supported language codes are listed in + # [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param target_language_codes [::Array<::String>] + # Required. Specify up to 10 language codes here. Supported language codes + # are listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param models [::Hash{::String => ::String}] + # Optional. The models to use for translation. Map's key is target language + # code. Map's value is model name. Value can be a built-in general model, + # or an AutoML Translation model. + # + # The value format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If the map is empty or a specific model is + # not requested for a language pair, then default google model (nmt) is used. + # @param input_configs [::Array<::Google::Cloud::Translate::V3::InputConfig, ::Hash>] + # Required. Input configurations. + # The total number of files matched should be <= 100. + # The total content size should be <= 100M Unicode codepoints. + # The files must use UTF-8 encoding. + # @param output_config [::Google::Cloud::Translate::V3::OutputConfig, ::Hash] + # Required. Output configuration. + # If 2 input configs match to the same file (that is, same input path), + # we don't generate output for duplicate inputs. + # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] + # Optional. Glossaries to be applied for translation. + # It's keyed by target language code. + # @param labels [::Hash{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new + # + # # Call the batch_translate_text method. + # result = client.batch_translate_text 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 batch_translate_text request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateTextRequest + + # Converts hash 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.batch_translate_text.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::Translate::V3::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.batch_translate_text.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_translate_text.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.batch_translate_text request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translates a large volume of document in asynchronous batch mode. + # This function provides real-time output as the inputs are being processed. + # If caller cancels a request, the partial results (for an input file, it's + # all or nothing) may still be available on the specified output location. + # + # This call returns immediately and you can use + # google.longrunning.Operation.name to poll the status of the call. + # + # @overload batch_translate_document(request, options = nil) + # Pass arguments to `batch_translate_document` via a request object, either of type + # {::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_translate_document(parent: nil, source_language_code: nil, target_language_codes: nil, input_configs: nil, output_config: nil, models: nil, glossaries: nil, format_conversions: nil, customized_attribution: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) + # Pass arguments to `batch_translate_document` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # The `global` location is not supported for batch translation. + # + # Only AutoML Translation models or glossaries within the same region (have + # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + # error is returned. + # @param source_language_code [::String] + # Required. The ISO-639 language code of the input document if known, for + # example, "en-US" or "sr-Latn". Supported language codes are listed in + # [Language Support](https://cloud.google.com/translate/docs/languages). + # @param target_language_codes [::Array<::String>] + # Required. The ISO-639 language code to use for translation of the input + # document. Specify up to 10 language codes here. Supported language codes + # are listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @param input_configs [::Array<::Google::Cloud::Translate::V3::BatchDocumentInputConfig, ::Hash>] + # Required. Input configurations. + # The total number of files matched should be <= 100. + # The total content size to translate should be <= 100M Unicode codepoints. + # The files must use UTF-8 encoding. + # @param output_config [::Google::Cloud::Translate::V3::BatchDocumentOutputConfig, ::Hash] + # Required. Output configuration. + # If 2 input configs match to the same file (that is, same input path), + # we don't generate output for duplicate inputs. + # @param models [::Hash{::String => ::String}] + # Optional. The models to use for translation. Map's key is target language + # code. Map's value is the model name. Value can be a built-in general model, + # or an AutoML Translation model. + # + # The value format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If the map is empty or a specific model is + # not requested for a language pair, then default google model (nmt) is used. + # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] + # Optional. Glossaries to be applied. It's keyed by target language code. + # @param format_conversions [::Hash{::String => ::String}] + # Optional. The file format conversion map that is applied to all input + # files. The map key is the original mime_type. The map value is the target + # mime_type of translated documents. + # + # Supported file format conversion includes: + # - `application/pdf` to + # `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + # + # If nothing specified, output files will be in the same format as the + # original file. + # @param customized_attribution [::String] + # Optional. This flag is to support user customized attribution. + # If not provided, the default is `Machine Translated by Google`. + # Customized attribution should follow rules in + # https://cloud.google.com/translate/attribution#attribution_and_logos + # @param enable_shadow_removal_native_pdf [::Boolean] + # Optional. If true, use the text removal server to remove the shadow text on + # background image for native pdf translation. + # Shadow removal feature can only be enabled when + # is_translate_native_pdf_only: false && pdf_native_only: false + # @param enable_rotation_correction [::Boolean] + # Optional. If true, enable auto rotation correction in DVS. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new + # + # # Call the batch_translate_document method. + # result = client.batch_translate_document 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 batch_translate_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest + + # Converts hash 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.batch_translate_document.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::Translate::V3::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.batch_translate_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_translate_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.batch_translate_document request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a glossary and returns the long-running operation. Returns + # NOT_FOUND, if the project doesn't exist. + # + # @overload create_glossary(request, options = nil) + # Pass arguments to `create_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(parent: nil, glossary: nil) + # Pass arguments to `create_glossary` via keyword arguments. Note that at + # least one keyword argument is 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 project name. + # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] + # Required. The glossary to create. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new + # + # # Call the create_glossary method. + # result = client.create_glossary 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_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.create_glossary request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a glossary. A LRO is used since the update can be async if the + # glossary's entry file is updated. + # + # @overload update_glossary(request, options = nil) + # Pass arguments to `update_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::UpdateGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(glossary: nil, update_mask: nil) + # Pass arguments to `update_glossary` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] + # Required. The glossary entry to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. Currently only `display_name` and + # 'input_config' + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::UpdateGlossaryRequest.new + # + # # Call the update_glossary method. + # result = client.update_glossary 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_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.update_glossary request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + # exist. + # + # @overload list_glossaries(request, options = nil) + # Pass arguments to `list_glossaries` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListGlossariesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListGlossariesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossaries(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_glossaries` via keyword arguments. Note that at + # least one keyword argument is 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 name of the project from which to list all of the glossaries. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer glossaries than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of [ListGlossariesResponse.next_page_token] + # returned from the previous call to `ListGlossaries` method. + # The first page is returned if `page_token`is empty or missing. + # @param filter [::String] + # Optional. Filter specifying constraints of a list operation. + # Specify the constraint by the format of "key=value", where key must be + # "src" or "tgt", and the value must be a valid language code. + # For multiple restrictions, concatenate them by "AND" (uppercase only), + # such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + # here, which means using 'en-US' and 'en' can lead to different results, + # which depends on the language code you used when you create the glossary. + # For the unidirectional glossaries, the "src" and "tgt" add restrictions + # on the source and target language code separately. + # For the equivalent term set glossaries, the "src" and/or "tgt" add + # restrictions on the term set. + # For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + # glossaries which exactly match the source language code as "en-US" and the + # target language code "zh-CN", but all equivalent term set glossaries which + # contain "en-US" and "zh-CN" in their language set will be picked. + # If missing, no filtering is performed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListGlossariesRequest.new + # + # # Call the list_glossaries method. + # result = client.list_glossaries 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::Translate::V3::Glossary. + # p item + # end + # + def list_glossaries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossariesRequest + + # Converts hash 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_glossaries.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::Translate::V3::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_glossaries.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_glossaries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_glossaries request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_glossaries, "glossaries", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + # exist. + # + # @overload get_glossary(request, options = nil) + # Pass arguments to `get_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(name: nil) + # Pass arguments to `get_glossary` via keyword arguments. Note that at + # least one keyword argument is 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 glossary to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::Glossary] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::Glossary] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetGlossaryRequest.new + # + # # Call the get_glossary method. + # result = client.get_glossary request + # + # # The returned object is of type Google::Cloud::Translate::V3::Glossary. + # p result + # + def get_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.get_glossary request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a glossary, or cancels glossary construction + # if the glossary isn't created yet. + # Returns NOT_FOUND, if the glossary doesn't exist. + # + # @overload delete_glossary(request, options = nil) + # Pass arguments to `delete_glossary` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteGlossaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary(name: nil) + # Pass arguments to `delete_glossary` via keyword arguments. Note that at + # least one keyword argument is 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 glossary to delete. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new + # + # # Call the delete_glossary method. + # result = client.delete_glossary 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_glossary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryRequest + + # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_glossary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.delete_glossary request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a single glossary entry by the given id. + # + # @overload get_glossary_entry(request, options = nil) + # Pass arguments to `get_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) + # Pass arguments to `get_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is 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 glossary entry to get + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new + # + # # Call the get_glossary_entry method. + # result = client.get_glossary_entry request + # + # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + # p result + # + def get_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.get_glossary_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List the entries for the glossary. + # + # @overload list_glossary_entries(request, options = nil) + # Pass arguments to `list_glossary_entries` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entries(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_glossary_entries` via keyword arguments. Note that at + # least one keyword argument is 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 glossary resource name for listing the glossary's + # entries. + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer glossary entries + # than requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # [ListGlossaryEntriesResponse.next_page_token] returned from the previous + # call. The first page is returned if `page_token`is empty or missing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.new + # + # # Call the list_glossary_entries method. + # result = client.list_glossary_entries 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::Translate::V3::GlossaryEntry. + # p item + # end + # + def list_glossary_entries request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest + + # Converts hash 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_glossary_entries.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::Translate::V3::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_glossary_entries.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_glossary_entries.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_glossary_entries request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_glossary_entries, "glossary_entries", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a glossary entry. + # + # @overload create_glossary_entry(request, options = nil) + # Pass arguments to `create_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(parent: nil, glossary_entry: nil) + # Pass arguments to `create_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is 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 glossary to create the entry under. + # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] + # Required. The glossary entry to create + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new + # + # # Call the create_glossary_entry method. + # result = client.create_glossary_entry request + # + # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + # p result + # + def create_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.create_glossary_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a glossary entry. + # + # @overload update_glossary_entry(request, options = nil) + # Pass arguments to `update_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(glossary_entry: nil) + # Pass arguments to `update_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] + # Required. The glossary entry to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new + # + # # Call the update_glossary_entry method. + # result = client.update_glossary_entry request + # + # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + # p result + # + def update_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.update_glossary_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single entry from the glossary + # + # @overload delete_glossary_entry(request, options = nil) + # Pass arguments to `delete_glossary_entry` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) + # Pass arguments to `delete_glossary_entry` via keyword arguments. Note that at + # least one keyword argument is 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 glossary entry 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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new + # + # # Call the delete_glossary_entry method. + # result = client.delete_glossary_entry request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_glossary_entry request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest + + # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_glossary_entry.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.delete_glossary_entry request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Dataset. + # + # @overload create_dataset(request, options = nil) + # Pass arguments to `create_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(parent: nil, dataset: nil) + # Pass arguments to `create_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 project name. + # @param dataset [::Google::Cloud::Translate::V3::Dataset, ::Hash] + # Required. The Dataset to create. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateDatasetRequest.new + # + # # Call the create_dataset method. + # result = client.create_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateDatasetRequest + + # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.create_dataset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a Dataset. + # + # @overload get_dataset(request, options = nil) + # Pass arguments to `get_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `get_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 dataset to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::Dataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::Dataset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetDatasetRequest.new + # + # # Call the get_dataset method. + # result = client.get_dataset request + # + # # The returned object is of type Google::Cloud::Translate::V3::Dataset. + # p result + # + def get_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetDatasetRequest + + # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.get_dataset request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists datasets. + # + # @overload list_datasets(request, options = nil) + # Pass arguments to `list_datasets` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListDatasetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datasets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_datasets` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @param page_size [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @param page_token [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListDatasets call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListDatasetsRequest.new + # + # # Call the list_datasets method. + # result = client.list_datasets 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::Translate::V3::Dataset. + # p item + # end + # + def list_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListDatasetsRequest + + # Converts hash 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_datasets.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::Translate::V3::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_datasets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_datasets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_datasets, "datasets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a dataset and all of its contents. + # + # @overload delete_dataset(request, options = nil) + # Pass arguments to `delete_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `delete_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 dataset to delete. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteDatasetRequest.new + # + # # Call the delete_dataset method. + # result = client.delete_dataset 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_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteDatasetRequest + + # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.delete_dataset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an Adaptive MT dataset. + # + # @overload create_adaptive_mt_dataset(request, options = nil) + # Pass arguments to `create_adaptive_mt_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(parent: nil, adaptive_mt_dataset: nil) + # Pass arguments to `create_adaptive_mt_dataset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @param adaptive_mt_dataset [::Google::Cloud::Translate::V3::AdaptiveMtDataset, ::Hash] + # Required. The AdaptiveMtDataset to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new + # + # # Call the create_adaptive_mt_dataset method. + # result = client.create_adaptive_mt_dataset request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. + # p result + # + def create_adaptive_mt_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest + + # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_adaptive_mt_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.create_adaptive_mt_dataset request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an Adaptive MT dataset, including all its entries and associated + # metadata. + # + # @overload delete_adaptive_mt_dataset(request, options = nil) + # Pass arguments to `delete_adaptive_mt_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) + # Pass arguments to `delete_adaptive_mt_dataset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the dataset. In the form of + # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new + # + # # Call the delete_adaptive_mt_dataset method. + # result = client.delete_adaptive_mt_dataset request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_adaptive_mt_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest + + # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_adaptive_mt_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.delete_adaptive_mt_dataset request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the Adaptive MT dataset. + # + # @overload get_adaptive_mt_dataset(request, options = nil) + # Pass arguments to `get_adaptive_mt_dataset` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) + # Pass arguments to `get_adaptive_mt_dataset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the dataset. In the form of + # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new + # + # # Call the get_adaptive_mt_dataset method. + # result = client.get_adaptive_mt_dataset request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. + # p result + # + def get_adaptive_mt_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest + + # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_adaptive_mt_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.get_adaptive_mt_dataset request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all Adaptive MT datasets for which the caller has read permission. + # + # @overload list_adaptive_mt_datasets(request, options = nil) + # Pass arguments to `list_adaptive_mt_datasets` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_datasets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_adaptive_mt_datasets` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list the Adaptive + # MT datasets. `projects/{project-number-or-id}/locations/{location-id}` + # @param page_size [::Integer] + # Optional. Requested page size. The server may return fewer results than + # requested. If unspecified, the server picks an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtDatasetsResponse.next_page_token returned from the + # previous call to `ListAdaptiveMtDatasets` method. The first page is + # returned if `page_token`is empty or missing. + # @param filter [::String] + # Optional. An expression for filtering the results of the request. + # Filter is not supported yet. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.new + # + # # Call the list_adaptive_mt_datasets method. + # result = client.list_adaptive_mt_datasets 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::Translate::V3::AdaptiveMtDataset. + # p item + # end + # + def list_adaptive_mt_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest + + # Converts hash 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_adaptive_mt_datasets.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::Translate::V3::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_adaptive_mt_datasets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_adaptive_mt_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_adaptive_mt_datasets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_datasets, "adaptive_mt_datasets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Translate text using Adaptive MT. + # + # @overload adaptive_mt_translate(request, options = nil) + # Pass arguments to `adaptive_mt_translate` via a request object, either of type + # {::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload adaptive_mt_translate(parent: nil, dataset: nil, content: nil, reference_sentence_config: nil, glossary_config: nil) + # Pass arguments to `adaptive_mt_translate` via keyword arguments. Note that at + # least one keyword argument is 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. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # @param dataset [::String] + # Required. The resource name for the dataset to use for adaptive MT. + # `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` + # @param content [::Array<::String>] + # Required. The content of the input in string format. + # @param reference_sentence_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig, ::Hash] + # Configuration for caller provided reference sentences. + # @param glossary_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig, ::Hash] + # Optional. Glossary to be applied. The glossary must be + # within the same region (have the same location-id) as the model, otherwise + # an INVALID_ARGUMENT (400) error is returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new + # + # # Call the adaptive_mt_translate method. + # result = client.adaptive_mt_translate request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse. + # p result + # + def adaptive_mt_translate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest + + # Converts hash 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.adaptive_mt_translate.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::Translate::V3::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.adaptive_mt_translate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.adaptive_mt_translate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.adaptive_mt_translate request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets and AdaptiveMtFile + # + # @overload get_adaptive_mt_file(request, options = nil) + # Pass arguments to `get_adaptive_mt_file` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) + # Pass arguments to `get_adaptive_mt_file` via keyword arguments. Note that at + # least one keyword argument is 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 file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtFile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new + # + # # Call the get_adaptive_mt_file method. + # result = client.get_adaptive_mt_file request + # + # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtFile. + # p result + # + def get_adaptive_mt_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest + + # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_adaptive_mt_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.get_adaptive_mt_file request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an AdaptiveMtFile along with its sentences. + # + # @overload delete_adaptive_mt_file(request, options = nil) + # Pass arguments to `delete_adaptive_mt_file` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) + # Pass arguments to `delete_adaptive_mt_file` via keyword arguments. Note that at + # least one keyword argument is 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 file to delete, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new + # + # # Call the delete_adaptive_mt_file method. + # result = client.delete_adaptive_mt_file request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_adaptive_mt_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest + + # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_adaptive_mt_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.delete_adaptive_mt_file request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports an AdaptiveMtFile and adds all of its sentences into the + # AdaptiveMtDataset. + # + # @overload import_adaptive_mt_file(request, options = nil) + # Pass arguments to `import_adaptive_mt_file` via a request object, either of type + # {::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_adaptive_mt_file(parent: nil, file_input_source: nil, gcs_input_source: nil) + # Pass arguments to `import_adaptive_mt_file` via keyword arguments. Note that at + # least one keyword argument is 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 file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}` + # @param file_input_source [::Google::Cloud::Translate::V3::FileInputSource, ::Hash] + # Inline file source. + # + # Note: The following parameters are mutually exclusive: `file_input_source`, `gcs_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] + # Google Cloud Storage file source. + # + # Note: The following parameters are mutually exclusive: `gcs_input_source`, `file_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new + # + # # Call the import_adaptive_mt_file method. + # result = client.import_adaptive_mt_file request + # + # # The returned object is of type Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse. + # p result + # + def import_adaptive_mt_file request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest + + # Converts hash 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.import_adaptive_mt_file.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::Translate::V3::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.import_adaptive_mt_file.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_adaptive_mt_file.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.import_adaptive_mt_file request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset. + # + # @overload list_adaptive_mt_files(request, options = nil) + # Pass arguments to `list_adaptive_mt_files` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_files(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_adaptive_mt_files` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list the Adaptive + # MT files. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` + # @param page_size [::Integer] + # Optional. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtFilesResponse.next_page_token returned from the + # previous call to `ListAdaptiveMtFiles` method. The first page is + # returned if `page_token`is empty or missing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.new + # + # # Call the list_adaptive_mt_files method. + # result = client.list_adaptive_mt_files 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::Translate::V3::AdaptiveMtFile. + # p item + # end + # + def list_adaptive_mt_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest + + # Converts hash 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_adaptive_mt_files.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::Translate::V3::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_adaptive_mt_files.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_adaptive_mt_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_adaptive_mt_files request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, "adaptive_mt_files", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all AdaptiveMtSentences under a given file/dataset. + # + # @overload list_adaptive_mt_sentences(request, options = nil) + # Pass arguments to `list_adaptive_mt_sentences` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_adaptive_mt_sentences(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_adaptive_mt_sentences` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list the Adaptive + # MT files. The following format lists all sentences under a file. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # The following format lists all sentences within a dataset. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` + # @param page_size [::Integer] + # @param page_token [::String] + # A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtSentencesRequest.next_page_token returned from the + # previous call to `ListTranslationMemories` method. The first page is + # returned if `page_token` is empty or missing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.new + # + # # Call the list_adaptive_mt_sentences method. + # result = client.list_adaptive_mt_sentences 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::Translate::V3::AdaptiveMtSentence. + # p item + # end + # + def list_adaptive_mt_sentences request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest + + # Converts hash 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_adaptive_mt_sentences.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::Translate::V3::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_adaptive_mt_sentences.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_adaptive_mt_sentences.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_adaptive_mt_sentences request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_sentences, "adaptive_mt_sentences", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Import sentence pairs into translation Dataset. + # + # @overload import_data(request, options = nil) + # Pass arguments to `import_data` via a request object, either of type + # {::Google::Cloud::Translate::V3::ImportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ImportDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_data(dataset: nil, input_config: nil) + # Pass arguments to `import_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. Name of the dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @param input_config [::Google::Cloud::Translate::V3::DatasetInputConfig, ::Hash] + # Required. The config for the input content. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ImportDataRequest.new + # + # # Call the import_data method. + # result = client.import_data 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 import_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportDataRequest + + # Converts hash 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.import_data.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::Translate::V3::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.import_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.import_data request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports dataset's data to the provided output location. + # + # @overload export_data(request, options = nil) + # Pass arguments to `export_data` via a request object, either of type + # {::Google::Cloud::Translate::V3::ExportDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ExportDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_data(dataset: nil, output_config: nil) + # Pass arguments to `export_data` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dataset [::String] + # Required. Name of the dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @param output_config [::Google::Cloud::Translate::V3::DatasetOutputConfig, ::Hash] + # Required. The config for the output content. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ExportDataRequest.new + # + # # Call the export_data method. + # result = client.export_data 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 export_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ExportDataRequest + + # Converts hash 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.export_data.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::Translate::V3::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.export_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.export_data request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists sentence pairs in the dataset. + # + # @overload list_examples(request, options = nil) + # Pass arguments to `list_examples` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListExamplesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListExamplesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_examples(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_examples` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @param filter [::String] + # Optional. An expression for filtering the examples that will be returned. + # Example filter: + # * `usage=TRAIN` + # @param page_size [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @param page_token [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListExamples call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListExamplesRequest.new + # + # # Call the list_examples method. + # result = client.list_examples 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::Translate::V3::Example. + # p item + # end + # + def list_examples request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListExamplesRequest + + # Converts hash 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_examples.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::Translate::V3::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_examples.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_examples.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_examples request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_examples, "examples", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Model. + # + # @overload create_model(request, options = nil) + # Pass arguments to `create_model` via a request object, either of type + # {::Google::Cloud::Translate::V3::CreateModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::CreateModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil) + # Pass arguments to `create_model` via keyword arguments. Note that at + # least one keyword argument is 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 project name, in form of + # `projects/{project}/locations/{location}` + # @param model [::Google::Cloud::Translate::V3::Model, ::Hash] + # Required. The Model to create. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::CreateModelRequest.new + # + # # Call the create_model method. + # result = client.create_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateModelRequest + + # Converts hash 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_model.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::Translate::V3::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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.create_model request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists models. + # + # @overload list_models(request, options = nil) + # Pass arguments to `list_models` via a request object, either of type + # {::Google::Cloud::Translate::V3::ListModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::ListModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_models(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_models` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @param filter [::String] + # Optional. An expression for filtering the models that will be returned. + # Supported filter: + # `dataset_id=${dataset_id}` + # @param page_size [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @param page_token [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListModels call. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::ListModelsRequest.new + # + # # Call the list_models method. + # result = client.list_models 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::Translate::V3::Model. + # p item + # end + # + def list_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListModelsRequest + + # Converts hash 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_models.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::Translate::V3::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_models.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.list_models request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_models, "models", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a model. + # + # @overload get_model(request, options = nil) + # Pass arguments to `get_model` via a request object, either of type + # {::Google::Cloud::Translate::V3::GetModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::GetModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `get_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Translate::V3::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::Model] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::GetModelRequest.new + # + # # Call the get_model method. + # result = client.get_model request + # + # # The returned object is of type Google::Cloud::Translate::V3::Model. + # p result + # + def get_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetModelRequest + + # Converts hash 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_model.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::Translate::V3::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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.get_model request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a model. + # + # @overload delete_model(request, options = nil) + # Pass arguments to `delete_model` via a request object, either of type + # {::Google::Cloud::Translate::V3::DeleteModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Translate::V3::DeleteModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `delete_model` via keyword arguments. Note that at + # least one keyword argument is 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 model to delete. + # @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/translate/v3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Translate::V3::DeleteModelRequest.new + # + # # Call the delete_model method. + # result = client.delete_model 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_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteModelRequest + + # Converts hash 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_model.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::Translate::V3::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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @translation_service_stub.delete_model request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the TranslationService REST API. + # + # This class represents the configuration for TranslationService 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::Translate::V3::TranslationService::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 + # # translate_text to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.translate_text.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.translate_text.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 TranslationService 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 `translate_text` + # @return [::Gapic::Config::Method] + # + attr_reader :translate_text + ## + # RPC-specific configuration for `romanize_text` + # @return [::Gapic::Config::Method] + # + attr_reader :romanize_text + ## + # RPC-specific configuration for `detect_language` + # @return [::Gapic::Config::Method] + # + attr_reader :detect_language + ## + # RPC-specific configuration for `get_supported_languages` + # @return [::Gapic::Config::Method] + # + attr_reader :get_supported_languages + ## + # RPC-specific configuration for `translate_document` + # @return [::Gapic::Config::Method] + # + attr_reader :translate_document + ## + # RPC-specific configuration for `batch_translate_text` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_translate_text + ## + # RPC-specific configuration for `batch_translate_document` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_translate_document + ## + # RPC-specific configuration for `create_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :create_glossary + ## + # RPC-specific configuration for `update_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :update_glossary + ## + # RPC-specific configuration for `list_glossaries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_glossaries + ## + # RPC-specific configuration for `get_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :get_glossary + ## + # RPC-specific configuration for `delete_glossary` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_glossary + ## + # RPC-specific configuration for `get_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :get_glossary_entry + ## + # RPC-specific configuration for `list_glossary_entries` + # @return [::Gapic::Config::Method] + # + attr_reader :list_glossary_entries + ## + # RPC-specific configuration for `create_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :create_glossary_entry + ## + # RPC-specific configuration for `update_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :update_glossary_entry + ## + # RPC-specific configuration for `delete_glossary_entry` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_glossary_entry + ## + # RPC-specific configuration for `create_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dataset + ## + # RPC-specific configuration for `get_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dataset + ## + # RPC-specific configuration for `list_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_datasets + ## + # RPC-specific configuration for `delete_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dataset + ## + # RPC-specific configuration for `create_adaptive_mt_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_adaptive_mt_dataset + ## + # RPC-specific configuration for `delete_adaptive_mt_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_adaptive_mt_dataset + ## + # RPC-specific configuration for `get_adaptive_mt_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_adaptive_mt_dataset + ## + # RPC-specific configuration for `list_adaptive_mt_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_adaptive_mt_datasets + ## + # RPC-specific configuration for `adaptive_mt_translate` + # @return [::Gapic::Config::Method] + # + attr_reader :adaptive_mt_translate + ## + # RPC-specific configuration for `get_adaptive_mt_file` + # @return [::Gapic::Config::Method] + # + attr_reader :get_adaptive_mt_file + ## + # RPC-specific configuration for `delete_adaptive_mt_file` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_adaptive_mt_file + ## + # RPC-specific configuration for `import_adaptive_mt_file` + # @return [::Gapic::Config::Method] + # + attr_reader :import_adaptive_mt_file + ## + # RPC-specific configuration for `list_adaptive_mt_files` + # @return [::Gapic::Config::Method] + # + attr_reader :list_adaptive_mt_files + ## + # RPC-specific configuration for `list_adaptive_mt_sentences` + # @return [::Gapic::Config::Method] + # + attr_reader :list_adaptive_mt_sentences + ## + # RPC-specific configuration for `import_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_data + ## + # RPC-specific configuration for `export_data` + # @return [::Gapic::Config::Method] + # + attr_reader :export_data + ## + # RPC-specific configuration for `list_examples` + # @return [::Gapic::Config::Method] + # + attr_reader :list_examples + ## + # RPC-specific configuration for `create_model` + # @return [::Gapic::Config::Method] + # + attr_reader :create_model + ## + # RPC-specific configuration for `list_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_models + ## + # RPC-specific configuration for `get_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_model + ## + # RPC-specific configuration for `delete_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_model + + # @private + def initialize parent_rpcs = nil + translate_text_config = parent_rpcs.translate_text if parent_rpcs.respond_to? :translate_text + @translate_text = ::Gapic::Config::Method.new translate_text_config + romanize_text_config = parent_rpcs.romanize_text if parent_rpcs.respond_to? :romanize_text + @romanize_text = ::Gapic::Config::Method.new romanize_text_config + detect_language_config = parent_rpcs.detect_language if parent_rpcs.respond_to? :detect_language + @detect_language = ::Gapic::Config::Method.new detect_language_config + get_supported_languages_config = parent_rpcs.get_supported_languages if parent_rpcs.respond_to? :get_supported_languages + @get_supported_languages = ::Gapic::Config::Method.new get_supported_languages_config + translate_document_config = parent_rpcs.translate_document if parent_rpcs.respond_to? :translate_document + @translate_document = ::Gapic::Config::Method.new translate_document_config + batch_translate_text_config = parent_rpcs.batch_translate_text if parent_rpcs.respond_to? :batch_translate_text + @batch_translate_text = ::Gapic::Config::Method.new batch_translate_text_config + batch_translate_document_config = parent_rpcs.batch_translate_document if parent_rpcs.respond_to? :batch_translate_document + @batch_translate_document = ::Gapic::Config::Method.new batch_translate_document_config + create_glossary_config = parent_rpcs.create_glossary if parent_rpcs.respond_to? :create_glossary + @create_glossary = ::Gapic::Config::Method.new create_glossary_config + update_glossary_config = parent_rpcs.update_glossary if parent_rpcs.respond_to? :update_glossary + @update_glossary = ::Gapic::Config::Method.new update_glossary_config + list_glossaries_config = parent_rpcs.list_glossaries if parent_rpcs.respond_to? :list_glossaries + @list_glossaries = ::Gapic::Config::Method.new list_glossaries_config + get_glossary_config = parent_rpcs.get_glossary if parent_rpcs.respond_to? :get_glossary + @get_glossary = ::Gapic::Config::Method.new get_glossary_config + delete_glossary_config = parent_rpcs.delete_glossary if parent_rpcs.respond_to? :delete_glossary + @delete_glossary = ::Gapic::Config::Method.new delete_glossary_config + get_glossary_entry_config = parent_rpcs.get_glossary_entry if parent_rpcs.respond_to? :get_glossary_entry + @get_glossary_entry = ::Gapic::Config::Method.new get_glossary_entry_config + list_glossary_entries_config = parent_rpcs.list_glossary_entries if parent_rpcs.respond_to? :list_glossary_entries + @list_glossary_entries = ::Gapic::Config::Method.new list_glossary_entries_config + create_glossary_entry_config = parent_rpcs.create_glossary_entry if parent_rpcs.respond_to? :create_glossary_entry + @create_glossary_entry = ::Gapic::Config::Method.new create_glossary_entry_config + update_glossary_entry_config = parent_rpcs.update_glossary_entry if parent_rpcs.respond_to? :update_glossary_entry + @update_glossary_entry = ::Gapic::Config::Method.new update_glossary_entry_config + delete_glossary_entry_config = parent_rpcs.delete_glossary_entry if parent_rpcs.respond_to? :delete_glossary_entry + @delete_glossary_entry = ::Gapic::Config::Method.new delete_glossary_entry_config + create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset + @create_dataset = ::Gapic::Config::Method.new create_dataset_config + get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset + @get_dataset = ::Gapic::Config::Method.new get_dataset_config + list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets + @list_datasets = ::Gapic::Config::Method.new list_datasets_config + delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset + @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config + create_adaptive_mt_dataset_config = parent_rpcs.create_adaptive_mt_dataset if parent_rpcs.respond_to? :create_adaptive_mt_dataset + @create_adaptive_mt_dataset = ::Gapic::Config::Method.new create_adaptive_mt_dataset_config + delete_adaptive_mt_dataset_config = parent_rpcs.delete_adaptive_mt_dataset if parent_rpcs.respond_to? :delete_adaptive_mt_dataset + @delete_adaptive_mt_dataset = ::Gapic::Config::Method.new delete_adaptive_mt_dataset_config + get_adaptive_mt_dataset_config = parent_rpcs.get_adaptive_mt_dataset if parent_rpcs.respond_to? :get_adaptive_mt_dataset + @get_adaptive_mt_dataset = ::Gapic::Config::Method.new get_adaptive_mt_dataset_config + list_adaptive_mt_datasets_config = parent_rpcs.list_adaptive_mt_datasets if parent_rpcs.respond_to? :list_adaptive_mt_datasets + @list_adaptive_mt_datasets = ::Gapic::Config::Method.new list_adaptive_mt_datasets_config + adaptive_mt_translate_config = parent_rpcs.adaptive_mt_translate if parent_rpcs.respond_to? :adaptive_mt_translate + @adaptive_mt_translate = ::Gapic::Config::Method.new adaptive_mt_translate_config + get_adaptive_mt_file_config = parent_rpcs.get_adaptive_mt_file if parent_rpcs.respond_to? :get_adaptive_mt_file + @get_adaptive_mt_file = ::Gapic::Config::Method.new get_adaptive_mt_file_config + delete_adaptive_mt_file_config = parent_rpcs.delete_adaptive_mt_file if parent_rpcs.respond_to? :delete_adaptive_mt_file + @delete_adaptive_mt_file = ::Gapic::Config::Method.new delete_adaptive_mt_file_config + import_adaptive_mt_file_config = parent_rpcs.import_adaptive_mt_file if parent_rpcs.respond_to? :import_adaptive_mt_file + @import_adaptive_mt_file = ::Gapic::Config::Method.new import_adaptive_mt_file_config + list_adaptive_mt_files_config = parent_rpcs.list_adaptive_mt_files if parent_rpcs.respond_to? :list_adaptive_mt_files + @list_adaptive_mt_files = ::Gapic::Config::Method.new list_adaptive_mt_files_config + list_adaptive_mt_sentences_config = parent_rpcs.list_adaptive_mt_sentences if parent_rpcs.respond_to? :list_adaptive_mt_sentences + @list_adaptive_mt_sentences = ::Gapic::Config::Method.new list_adaptive_mt_sentences_config + import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data + @import_data = ::Gapic::Config::Method.new import_data_config + export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data + @export_data = ::Gapic::Config::Method.new export_data_config + list_examples_config = parent_rpcs.list_examples if parent_rpcs.respond_to? :list_examples + @list_examples = ::Gapic::Config::Method.new list_examples_config + create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model + @create_model = ::Gapic::Config::Method.new create_model_config + list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models + @list_models = ::Gapic::Config::Method.new list_models_config + get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model + @get_model = ::Gapic::Config::Method.new get_model_config + delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model + @delete_model = ::Gapic::Config::Method.new delete_model_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb new file mode 100644 index 000000000000..fe150ccbe903 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb @@ -0,0 +1,1093 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + module TranslationService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the TranslationService 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 TranslationService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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::Translate::V3::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? + throw :response, 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::Translate::V3::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? + throw :response, 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::Translate::V3::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? + 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::Translate::V3::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? + end + rescue ::Gapic::Rest::Error => 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 [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::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 + call_metadata = @config.rpcs.wait_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::Translate::V3::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.wait_operation.timeout, + metadata: call_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.wait_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "translate.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 + ## + # 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 + + ## + # @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, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # 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 wait_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_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, + method_name: "wait_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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: "/v3/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v3/{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: "/v3/{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: "/v3/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the wait_operation REST call + # + # @param request_pb [::Google::Longrunning::WaitOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_wait_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{name}:wait", + body: "*", + 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-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb new file mode 100644 index 000000000000..2bee326ee72a --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb @@ -0,0 +1,2454 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" + +module Google + module Cloud + module Translate + module V3 + module TranslationService + module Rest + ## + # REST service stub for the TranslationService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the translate_text REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::TranslateTextRequest] + # 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::Translate::V3::TranslateTextResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::TranslateTextResponse] + # A result object deserialized from the server's reply + def translate_text request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_translate_text_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, + method_name: "translate_text", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::TranslateTextResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the romanize_text REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::RomanizeTextRequest] + # 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::Translate::V3::RomanizeTextResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::RomanizeTextResponse] + # A result object deserialized from the server's reply + def romanize_text request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_romanize_text_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, + method_name: "romanize_text", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::RomanizeTextResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the detect_language REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DetectLanguageRequest] + # 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::Translate::V3::DetectLanguageResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::DetectLanguageResponse] + # A result object deserialized from the server's reply + def detect_language request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_detect_language_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, + method_name: "detect_language", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::DetectLanguageResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_supported_languages REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest] + # 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::Translate::V3::SupportedLanguages] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::SupportedLanguages] + # A result object deserialized from the server's reply + def get_supported_languages request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_supported_languages_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, + method_name: "get_supported_languages", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::SupportedLanguages.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the translate_document REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::TranslateDocumentRequest] + # 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::Translate::V3::TranslateDocumentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::TranslateDocumentResponse] + # A result object deserialized from the server's reply + def translate_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_translate_document_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, + method_name: "translate_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_translate_text REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateTextRequest] + # 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 batch_translate_text request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_translate_text_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, + method_name: "batch_translate_text", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_translate_document REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest] + # 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 batch_translate_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_translate_document_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, + method_name: "batch_translate_document", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryRequest] + # 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_glossary request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_glossary_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, + method_name: "create_glossary", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryRequest] + # 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_glossary request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_glossary_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, + method_name: "update_glossary", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_glossaries REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListGlossariesRequest] + # 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::Translate::V3::ListGlossariesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListGlossariesResponse] + # A result object deserialized from the server's reply + def list_glossaries request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_glossaries_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, + method_name: "list_glossaries", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListGlossariesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryRequest] + # 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::Translate::V3::Glossary] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::Glossary] + # A result object deserialized from the server's reply + def get_glossary request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_glossary_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, + method_name: "get_glossary", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::Glossary.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryRequest] + # 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_glossary request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_glossary_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, + method_name: "delete_glossary", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest] + # 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::Translate::V3::GlossaryEntry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # A result object deserialized from the server's reply + def get_glossary_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_glossary_entry_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, + method_name: "get_glossary_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::GlossaryEntry.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_glossary_entries REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest] + # 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::Translate::V3::ListGlossaryEntriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse] + # A result object deserialized from the server's reply + def list_glossary_entries request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_glossary_entries_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, + method_name: "list_glossary_entries", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest] + # 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::Translate::V3::GlossaryEntry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # A result object deserialized from the server's reply + def create_glossary_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_glossary_entry_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, + method_name: "create_glossary_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::GlossaryEntry.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest] + # 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::Translate::V3::GlossaryEntry] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # A result object deserialized from the server's reply + def update_glossary_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_glossary_entry_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, + method_name: "update_glossary_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::GlossaryEntry.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest] + # 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_glossary_entry request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_glossary_entry_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, + method_name: "delete_glossary_entry", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateDatasetRequest] + # 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_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_dataset_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, + method_name: "create_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetDatasetRequest] + # 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::Translate::V3::Dataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::Dataset] + # A result object deserialized from the server's reply + def get_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_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, + method_name: "get_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::Dataset.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_datasets REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListDatasetsRequest] + # 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::Translate::V3::ListDatasetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListDatasetsResponse] + # A result object deserialized from the server's reply + def list_datasets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_datasets_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, + method_name: "list_datasets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListDatasetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteDatasetRequest] + # 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_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_dataset_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, + method_name: "delete_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_adaptive_mt_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest] + # 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::Translate::V3::AdaptiveMtDataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # A result object deserialized from the server's reply + def create_adaptive_mt_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_adaptive_mt_dataset_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, + method_name: "create_adaptive_mt_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_adaptive_mt_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest] + # 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_adaptive_mt_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_adaptive_mt_dataset_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, + method_name: "delete_adaptive_mt_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_adaptive_mt_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest] + # 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::Translate::V3::AdaptiveMtDataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # A result object deserialized from the server's reply + def get_adaptive_mt_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_adaptive_mt_dataset_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, + method_name: "get_adaptive_mt_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_adaptive_mt_datasets REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest] + # 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::Translate::V3::ListAdaptiveMtDatasetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse] + # A result object deserialized from the server's reply + def list_adaptive_mt_datasets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_adaptive_mt_datasets_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, + method_name: "list_adaptive_mt_datasets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the adaptive_mt_translate REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest] + # 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::Translate::V3::AdaptiveMtTranslateResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] + # A result object deserialized from the server's reply + def adaptive_mt_translate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_adaptive_mt_translate_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, + method_name: "adaptive_mt_translate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_adaptive_mt_file REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest] + # 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::Translate::V3::AdaptiveMtFile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] + # A result object deserialized from the server's reply + def get_adaptive_mt_file request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_adaptive_mt_file_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, + method_name: "get_adaptive_mt_file", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::AdaptiveMtFile.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_adaptive_mt_file REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest] + # 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_adaptive_mt_file request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_adaptive_mt_file_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, + method_name: "delete_adaptive_mt_file", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_adaptive_mt_file REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest] + # 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::Translate::V3::ImportAdaptiveMtFileResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] + # A result object deserialized from the server's reply + def import_adaptive_mt_file request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_adaptive_mt_file_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, + method_name: "import_adaptive_mt_file", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_adaptive_mt_files REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest] + # 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::Translate::V3::ListAdaptiveMtFilesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse] + # A result object deserialized from the server's reply + def list_adaptive_mt_files request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_adaptive_mt_files_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, + method_name: "list_adaptive_mt_files", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_adaptive_mt_sentences REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest] + # 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::Translate::V3::ListAdaptiveMtSentencesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse] + # A result object deserialized from the server's reply + def list_adaptive_mt_sentences request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_adaptive_mt_sentences_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, + method_name: "list_adaptive_mt_sentences", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_data REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ImportDataRequest] + # 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 import_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_data_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, + method_name: "import_data", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_data REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ExportDataRequest] + # 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 export_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_data_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, + method_name: "export_data", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_examples REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListExamplesRequest] + # 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::Translate::V3::ListExamplesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListExamplesResponse] + # A result object deserialized from the server's reply + def list_examples request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_examples_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, + method_name: "list_examples", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListExamplesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_model REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateModelRequest] + # 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_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_model_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, + method_name: "create_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_models REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListModelsRequest] + # 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::Translate::V3::ListModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::ListModelsResponse] + # A result object deserialized from the server's reply + def list_models request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_models_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, + method_name: "list_models", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::ListModelsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_model REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetModelRequest] + # 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::Translate::V3::Model] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Translate::V3::Model] + # A result object deserialized from the server's reply + def get_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_model_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, + method_name: "get_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Translate::V3::Model.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_model REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteModelRequest] + # 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_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_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, + method_name: "delete_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the translate_text REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::TranslateTextRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_translate_text_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:translateText", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:translateText", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the romanize_text REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::RomanizeTextRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_romanize_text_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:romanizeText", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:romanizeText", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the detect_language REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DetectLanguageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_detect_language_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:detectLanguage", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:detectLanguage", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_supported_languages REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest] + # 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_supported_languages_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/supportedLanguages", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/supportedLanguages", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the translate_document REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::TranslateDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_translate_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:translateDocument", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_translate_text REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateTextRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_translate_text_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:batchTranslateText", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_translate_document REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_translate_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:batchTranslateDocument", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryRequest] + # 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_glossary_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/glossaries", + body: "glossary", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryRequest] + # 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_glossary_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{glossary.name}", + body: "glossary", + matches: [ + ["glossary.name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_glossaries REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListGlossariesRequest] + # 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_glossaries_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/glossaries", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryRequest] + # 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_glossary_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_glossary REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryRequest] + # 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_glossary_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest] + # 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_glossary_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_glossary_entries REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest] + # 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_glossary_entries_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/glossaryEntries", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest] + # 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_glossary_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/glossaryEntries", + body: "glossary_entry", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest] + # 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_glossary_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3/{glossary_entry.name}", + body: "glossary_entry", + matches: [ + ["glossary_entry.name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_glossary_entry REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest] + # 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_glossary_entry_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/datasets", + body: "dataset", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_datasets REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListDatasetsRequest] + # 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_datasets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/datasets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_adaptive_mt_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest] + # 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_adaptive_mt_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/adaptiveMtDatasets", + body: "adaptive_mt_dataset", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_adaptive_mt_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest] + # 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_adaptive_mt_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_adaptive_mt_dataset REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest] + # 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_adaptive_mt_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_adaptive_mt_datasets REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest] + # 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_adaptive_mt_datasets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/adaptiveMtDatasets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the adaptive_mt_translate REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_adaptive_mt_translate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:adaptiveMtTranslate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_adaptive_mt_file REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest] + # 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_adaptive_mt_file_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/adaptiveMtFiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_adaptive_mt_file REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest] + # 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_adaptive_mt_file_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/adaptiveMtFiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_adaptive_mt_file REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_adaptive_mt_file_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}:importAdaptiveMtFile", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_adaptive_mt_files REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest] + # 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_adaptive_mt_files_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/adaptiveMtFiles", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_adaptive_mt_sentences REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest] + # 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_adaptive_mt_sentences_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/adaptiveMtSentences", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/adaptiveMtFiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/adaptiveMtSentences", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_data REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ImportDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{dataset}:importData", + body: "*", + matches: [ + ["dataset", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_data REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ExportDataRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{dataset}:exportData", + body: "*", + matches: [ + ["dataset", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_examples REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListExamplesRequest] + # 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_examples_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/examples", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_model REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::CreateModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3/{parent}/models", + body: "model", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_models REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::ListModelsRequest] + # 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_models_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{parent}/models", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_model REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::GetModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_model REST call + # + # @param request_pb [::Google::Cloud::Translate::V3::DeleteModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb new file mode 100644 index 000000000000..06eda86109d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/translate/v3/translation_service.proto + +require 'google/protobuf' + +require 'google/cloud/translate/v3/adaptive_mt_pb' +require 'google/cloud/translate/v3/automl_translation_pb' +require 'google/cloud/translate/v3/common_pb' +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n3google/cloud/translate/v3/translation_service.proto\x12\x1bgoogle.cloud.translation.v3\x1a+google/cloud/translate/v3/adaptive_mt.proto\x1a\x32google/cloud/translate/v3/automl_translation.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"7\n\x15TransliterationConfig\x12\x1e\n\x16\x65nable_transliteration\x18\x01 \x01(\x08\"\x8e\x04\n\x14TranslateTextRequest\x12\x15\n\x08\x63ontents\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14source_language_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14target_language_code\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x08 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfigB\x03\xe0\x41\x01\x12W\n\x16transliteration_config\x18\r \x01(\x0b\x32\x32.google.cloud.translation.v3.TransliterationConfigB\x03\xe0\x41\x01\x12R\n\x06labels\x18\n \x03(\x0b\x32=.google.cloud.translation.v3.TranslateTextRequest.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\"\xa0\x01\n\x15TranslateTextResponse\x12>\n\x0ctranslations\x18\x01 \x03(\x0b\x32(.google.cloud.translation.v3.Translation\x12G\n\x15glossary_translations\x18\x03 \x03(\x0b\x32(.google.cloud.translation.v3.Translation\"\xa8\x01\n\x0bTranslation\x12\x17\n\x0ftranslated_text\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x04 \x01(\t\x12Q\n\x0fglossary_config\x18\x03 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig\"\x8a\x01\n\x13RomanizeTextRequest\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x15\n\x08\x63ontents\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\"F\n\x0cRomanization\x12\x16\n\x0eromanized_text\x18\x01 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x02 \x01(\t\"X\n\x14RomanizeTextResponse\x12@\n\rromanizations\x18\x01 \x03(\x0b\x32).google.cloud.translation.v3.Romanization\"\x9f\x02\n\x15\x44\x65tectLanguageRequest\x12\x39\n\x06parent\x18\x05 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x07\x63ontent\x18\x01 \x01(\tH\x00\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12S\n\x06labels\x18\x06 \x03(\x0b\x32>.google.cloud.translation.v3.DetectLanguageRequest.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\x42\x08\n\x06source\"=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\"Z\n\x16\x44\x65tectLanguageResponse\x12@\n\tlanguages\x18\x01 \x03(\x0b\x32-.google.cloud.translation.v3.DetectedLanguage\"\x91\x01\n\x1cGetSupportedLanguagesRequest\x12\x39\n\x06parent\x18\x03 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\"\n\x15\x64isplay_language_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x02 \x01(\tB\x03\xe0\x41\x01\"W\n\x12SupportedLanguages\x12\x41\n\tlanguages\x18\x01 \x03(\x0b\x32..google.cloud.translation.v3.SupportedLanguage\"p\n\x11SupportedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x16\n\x0esupport_source\x18\x03 \x01(\x08\x12\x16\n\x0esupport_target\x18\x04 \x01(\x08\"#\n\tGcsSource\x12\x16\n\tinput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"m\n\x0bInputConfig\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12<\n\ngcs_source\x18\x02 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source\"0\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\"e\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination\"\x83\x01\n\x13\x44ocumentInputConfig\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12<\n\ngcs_source\x18\x02 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x12\x11\n\tmime_type\x18\x04 \x01(\tB\x08\n\x06source\"\x8a\x01\n\x14\x44ocumentOutputConfig\x12K\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.GcsDestinationB\x03\xe0\x41\x01H\x00\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x42\r\n\x0b\x64\x65stination\"\xbe\x05\n\x18TranslateDocumentRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14target_language_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12T\n\x15\x64ocument_input_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.translation.v3.DocumentInputConfigB\x03\xe0\x41\x02\x12V\n\x16\x64ocument_output_config\x18\x05 \x01(\x0b\x32\x31.google.cloud.translation.v3.DocumentOutputConfigB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfigB\x03\xe0\x41\x01\x12V\n\x06labels\x18\x08 \x03(\x0b\x32\x41.google.cloud.translation.v3.TranslateDocumentRequest.LabelsEntryB\x03\xe0\x41\x01\x12#\n\x16\x63ustomized_attribution\x18\n \x01(\tB\x03\xe0\x41\x01\x12)\n\x1cis_translate_native_pdf_only\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12-\n enable_shadow_removal_native_pdf\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_rotation_correction\x18\r \x01(\x08\x42\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\"e\n\x13\x44ocumentTranslation\x12\x1b\n\x13\x62yte_stream_outputs\x18\x01 \x03(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x03 \x01(\t\"\xa6\x02\n\x19TranslateDocumentResponse\x12N\n\x14\x64ocument_translation\x18\x01 \x01(\x0b\x32\x30.google.cloud.translation.v3.DocumentTranslation\x12W\n\x1dglossary_document_translation\x18\x02 \x01(\x0b\x32\x30.google.cloud.translation.v3.DocumentTranslation\x12\r\n\x05model\x18\x03 \x01(\t\x12Q\n\x0fglossary_config\x18\x04 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig\"\x88\x06\n\x19\x42\x61tchTranslateTextRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15target_language_codes\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12W\n\x06models\x18\x04 \x03(\x0b\x32\x42.google.cloud.translation.v3.BatchTranslateTextRequest.ModelsEntryB\x03\xe0\x41\x01\x12\x44\n\rinput_configs\x18\x05 \x03(\x0b\x32(.google.cloud.translation.v3.InputConfigB\x03\xe0\x41\x02\x12\x45\n\routput_config\x18\x06 \x01(\x0b\x32).google.cloud.translation.v3.OutputConfigB\x03\xe0\x41\x02\x12_\n\nglossaries\x18\x07 \x03(\x0b\x32\x46.google.cloud.translation.v3.BatchTranslateTextRequest.GlossariesEntryB\x03\xe0\x41\x01\x12W\n\x06labels\x18\t \x03(\x0b\x32\x42.google.cloud.translation.v3.BatchTranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ak\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xce\x02\n\x16\x42\x61tchTranslateMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.translation.v3.BatchTranslateMetadata.State\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12\x18\n\x10total_characters\x18\x04 \x01(\x03\x12/\n\x0bsubmit_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xcb\x01\n\x16\x42\x61tchTranslateResponse\x12\x18\n\x10total_characters\x18\x01 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12/\n\x0bsubmit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"]\n\x13GlossaryInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source\"\x9a\x05\n\x08Glossary\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\rlanguage_pair\x18\x03 \x01(\x0b\x32\x36.google.cloud.translation.v3.Glossary.LanguageCodePairH\x00\x12T\n\x12language_codes_set\x18\x04 \x01(\x0b\x32\x36.google.cloud.translation.v3.Glossary.LanguageCodesSetH\x00\x12\x46\n\x0cinput_config\x18\x05 \x01(\x0b\x32\x30.google.cloud.translation.v3.GlossaryInputConfig\x12\x18\n\x0b\x65ntry_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0bsubmit_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\t \x01(\tB\x03\xe0\x41\x01\x1aN\n\x10LanguageCodePair\x12\x1c\n\x14source_language_code\x18\x01 \x01(\t\x12\x1c\n\x14target_language_code\x18\x02 \x01(\t\x1a*\n\x10LanguageCodesSet\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t:e\xea\x41\x62\n!translate.googleapis.com/Glossary\x12=projects/{project}/locations/{location}/glossaries/{glossary}B\x0b\n\tlanguages\"\x90\x01\n\x15\x43reateGlossaryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x08glossary\x18\x02 \x01(\x0b\x32%.google.cloud.translation.v3.GlossaryB\x03\xe0\x41\x02\"\x86\x01\n\x15UpdateGlossaryRequest\x12<\n\x08glossary\x18\x01 \x01(\x0b\x32%.google.cloud.translation.v3.GlossaryB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"M\n\x12GetGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\"P\n\x15\x44\x65leteGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\"\x98\x01\n\x15ListGlossariesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\"l\n\x16ListGlossariesResponse\x12\x39\n\nglossaries\x18\x01 \x03(\x0b\x32%.google.cloud.translation.v3.Glossary\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x17GetGlossaryEntryRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&translate.googleapis.com/GlossaryEntry\"Z\n\x1a\x44\x65leteGlossaryEntryRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&translate.googleapis.com/GlossaryEntry\"\x88\x01\n\x1aListGlossaryEntriesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\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\"\x86\x01\n\x1bListGlossaryEntriesResponse\x12I\n\x10glossary_entries\x18\x01 \x03(\x0b\x32*.google.cloud.translation.v3.GlossaryEntryB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x1a\x43reateGlossaryEntryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12G\n\x0eglossary_entry\x18\x02 \x01(\x0b\x32*.google.cloud.translation.v3.GlossaryEntryB\x03\xe0\x41\x02\"e\n\x1aUpdateGlossaryEntryRequest\x12G\n\x0eglossary_entry\x18\x01 \x01(\x0b\x32*.google.cloud.translation.v3.GlossaryEntryB\x03\xe0\x41\x02\"\x88\x02\n\x16\x43reateGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.CreateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xb3\x02\n\x16UpdateGlossaryMetadata\x12\x37\n\x08glossary\x18\x01 \x01(\x0b\x32%.google.cloud.translation.v3.Glossary\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.UpdateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\x88\x02\n\x16\x44\x65leteGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.DeleteGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\x85\x01\n\x16\x44\x65leteGlossaryResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd1\x07\n\x1d\x42\x61tchTranslateDocumentRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15target_language_codes\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12Q\n\rinput_configs\x18\x04 \x03(\x0b\x32\x35.google.cloud.translation.v3.BatchDocumentInputConfigB\x03\xe0\x41\x02\x12R\n\routput_config\x18\x05 \x01(\x0b\x32\x36.google.cloud.translation.v3.BatchDocumentOutputConfigB\x03\xe0\x41\x02\x12[\n\x06models\x18\x06 \x03(\x0b\x32\x46.google.cloud.translation.v3.BatchTranslateDocumentRequest.ModelsEntryB\x03\xe0\x41\x01\x12\x63\n\nglossaries\x18\x07 \x03(\x0b\x32J.google.cloud.translation.v3.BatchTranslateDocumentRequest.GlossariesEntryB\x03\xe0\x41\x01\x12r\n\x12\x66ormat_conversions\x18\x08 \x03(\x0b\x32Q.google.cloud.translation.v3.BatchTranslateDocumentRequest.FormatConversionsEntryB\x03\xe0\x41\x01\x12#\n\x16\x63ustomized_attribution\x18\n \x01(\tB\x03\xe0\x41\x01\x12-\n enable_shadow_removal_native_pdf\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_rotation_correction\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ak\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig:\x02\x38\x01\x1a\x38\n\x16\x46ormatConversionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"b\n\x18\x42\x61tchDocumentInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source\"r\n\x19\x42\x61tchDocumentOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination\"\xd9\x02\n\x1e\x42\x61tchTranslateDocumentResponse\x12\x13\n\x0btotal_pages\x18\x01 \x01(\x03\x12\x18\n\x10translated_pages\x18\x02 \x01(\x03\x12\x14\n\x0c\x66\x61iled_pages\x18\x03 \x01(\x03\x12\x1c\n\x14total_billable_pages\x18\x04 \x01(\x03\x12\x18\n\x10total_characters\x18\x05 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x06 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x07 \x01(\x03\x12!\n\x19total_billable_characters\x18\x08 \x01(\x03\x12/\n\x0bsubmit_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe4\x03\n\x1e\x42\x61tchTranslateDocumentMetadata\x12P\n\x05state\x18\x01 \x01(\x0e\x32\x41.google.cloud.translation.v3.BatchTranslateDocumentMetadata.State\x12\x13\n\x0btotal_pages\x18\x02 \x01(\x03\x12\x18\n\x10translated_pages\x18\x03 \x01(\x03\x12\x14\n\x0c\x66\x61iled_pages\x18\x04 \x01(\x03\x12\x1c\n\x14total_billable_pages\x18\x05 \x01(\x03\x12\x18\n\x10total_characters\x18\x06 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x07 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x08 \x01(\x03\x12!\n\x19total_billable_characters\x18\t \x01(\x03\x12/\n\x0bsubmit_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xa1\x01\n\x1bTranslateTextGlossaryConfig\x12;\n\x08glossary\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1e\x63ontextual_translation_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x32\xbd\x43\n\x12TranslationService\x12\xd4\x02\n\rTranslateText\x12\x31.google.cloud.translation.v3.TranslateTextRequest\x1a\x32.google.cloud.translation.v3.TranslateTextResponse\"\xdb\x01\xda\x41$parent,target_language_code,contents\xda\x41Iparent,model,mime_type,source_language_code,target_language_code,contents\x82\xd3\xe4\x93\x02\x62\"1/v3/{parent=projects/*/locations/*}:translateText:\x01*Z*\"%/v3/{parent=projects/*}:translateText:\x01*\x12\xed\x01\n\x0cRomanizeText\x12\x30.google.cloud.translation.v3.RomanizeTextRequest\x1a\x31.google.cloud.translation.v3.RomanizeTextResponse\"x\xda\x41\x0fparent,contents\x82\xd3\xe4\x93\x02`\"0/v3/{parent=projects/*/locations/*}:romanizeText:\x01*Z)\"$/v3/{parent=projects/*}:romanizeText:\x01*\x12\x87\x02\n\x0e\x44\x65tectLanguage\x12\x32.google.cloud.translation.v3.DetectLanguageRequest\x1a\x33.google.cloud.translation.v3.DetectLanguageResponse\"\x8b\x01\xda\x41\x1eparent,model,mime_type,content\x82\xd3\xe4\x93\x02\x64\"2/v3/{parent=projects/*/locations/*}:detectLanguage:\x01*Z+\"&/v3/{parent=projects/*}:detectLanguage:\x01*\x12\x97\x02\n\x15GetSupportedLanguages\x12\x39.google.cloud.translation.v3.GetSupportedLanguagesRequest\x1a/.google.cloud.translation.v3.SupportedLanguages\"\x91\x01\xda\x41\"parent,model,display_language_code\x82\xd3\xe4\x93\x02\x66\x12\x36/v3/{parent=projects/*/locations/*}/supportedLanguagesZ,\x12*/v3/{parent=projects/*}/supportedLanguages\x12\xc4\x01\n\x11TranslateDocument\x12\x35.google.cloud.translation.v3.TranslateDocumentRequest\x1a\x36.google.cloud.translation.v3.TranslateDocumentResponse\"@\x82\xd3\xe4\x93\x02:\"5/v3/{parent=projects/*/locations/*}:translateDocument:\x01*\x12\xe1\x01\n\x12\x42\x61tchTranslateText\x12\x36.google.cloud.translation.v3.BatchTranslateTextRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41\x30\n\x16\x42\x61tchTranslateResponse\x12\x16\x42\x61tchTranslateMetadata\x82\xd3\xe4\x93\x02;\"6/v3/{parent=projects/*/locations/*}:batchTranslateText:\x01*\x12\xce\x02\n\x16\x42\x61tchTranslateDocument\x12:.google.cloud.translation.v3.BatchTranslateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x01\xca\x41@\n\x1e\x42\x61tchTranslateDocumentResponse\x12\x1e\x42\x61tchTranslateDocumentMetadata\xda\x41Mparent,source_language_code,target_language_codes,input_configs,output_config\x82\xd3\xe4\x93\x02?\":/v3/{parent=projects/*/locations/*}:batchTranslateDocument:\x01*\x12\xdc\x01\n\x0e\x43reateGlossary\x12\x32.google.cloud.translation.v3.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41\"\n\x08Glossary\x12\x16\x43reateGlossaryMetadata\xda\x41\x0fparent,glossary\x82\xd3\xe4\x93\x02:\"./v3/{parent=projects/*/locations/*}/glossaries:\x08glossary\x12\xeb\x01\n\x0eUpdateGlossary\x12\x32.google.cloud.translation.v3.UpdateGlossaryRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\"\n\x08Glossary\x12\x16UpdateGlossaryMetadata\xda\x41\x14glossary,update_mask\x82\xd3\xe4\x93\x02\x43\x32\x37/v3/{glossary.name=projects/*/locations/*/glossaries/*}:\x08glossary\x12\xba\x01\n\x0eListGlossaries\x12\x32.google.cloud.translation.v3.ListGlossariesRequest\x1a\x33.google.cloud.translation.v3.ListGlossariesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v3/{parent=projects/*/locations/*}/glossaries\x12\xa4\x01\n\x0bGetGlossary\x12/.google.cloud.translation.v3.GetGlossaryRequest\x1a%.google.cloud.translation.v3.Glossary\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v3/{name=projects/*/locations/*/glossaries/*}\x12\xd5\x01\n\x0e\x44\x65leteGlossary\x12\x32.google.cloud.translation.v3.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x30\n\x16\x44\x65leteGlossaryResponse\x12\x16\x44\x65leteGlossaryMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v3/{name=projects/*/locations/*/glossaries/*}\x12\xc5\x01\n\x10GetGlossaryEntry\x12\x34.google.cloud.translation.v3.GetGlossaryEntryRequest\x1a*.google.cloud.translation.v3.GlossaryEntry\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42\x12@/v3/{name=projects/*/locations/*/glossaries/*/glossaryEntries/*}\x12\xdb\x01\n\x13ListGlossaryEntries\x12\x37.google.cloud.translation.v3.ListGlossaryEntriesRequest\x1a\x38.google.cloud.translation.v3.ListGlossaryEntriesResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v3/{parent=projects/*/locations/*/glossaries/*}/glossaryEntries\x12\xec\x01\n\x13\x43reateGlossaryEntry\x12\x37.google.cloud.translation.v3.CreateGlossaryEntryRequest\x1a*.google.cloud.translation.v3.GlossaryEntry\"p\xda\x41\x15parent,glossary_entry\x82\xd3\xe4\x93\x02R\"@/v3/{parent=projects/*/locations/*/glossaries/*}/glossaryEntries:\x0eglossary_entry\x12\xf4\x01\n\x13UpdateGlossaryEntry\x12\x37.google.cloud.translation.v3.UpdateGlossaryEntryRequest\x1a*.google.cloud.translation.v3.GlossaryEntry\"x\xda\x41\x0eglossary_entry\x82\xd3\xe4\x93\x02\x61\x32O/v3/{glossary_entry.name=projects/*/locations/*/glossaries/*/glossaryEntries/*}:\x0eglossary_entry\x12\xb7\x01\n\x13\x44\x65leteGlossaryEntry\x12\x37.google.cloud.translation.v3.DeleteGlossaryEntryRequest\x1a\x16.google.protobuf.Empty\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42*@/v3/{name=projects/*/locations/*/glossaries/*/glossaryEntries/*}\x12\xd4\x01\n\rCreateDataset\x12\x31.google.cloud.translation.v3.CreateDatasetRequest\x1a\x1d.google.longrunning.Operation\"q\xca\x41 \n\x07\x44\x61taset\x12\x15\x43reateDatasetMetadata\xda\x41\x0eparent,dataset\x82\xd3\xe4\x93\x02\x37\",/v3/{parent=projects/*/locations/*}/datasets:\x07\x64\x61taset\x12\x9f\x01\n\nGetDataset\x12..google.cloud.translation.v3.GetDatasetRequest\x1a$.google.cloud.translation.v3.Dataset\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v3/{name=projects/*/locations/*/datasets/*}\x12\xb2\x01\n\x0cListDatasets\x12\x30.google.cloud.translation.v3.ListDatasetsRequest\x1a\x31.google.cloud.translation.v3.ListDatasetsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v3/{parent=projects/*/locations/*}/datasets\x12\xcf\x01\n\rDeleteDataset\x12\x31.google.cloud.translation.v3.DeleteDatasetRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41.\n\x15google.protobuf.Empty\x12\x15\x44\x65leteDatasetMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v3/{name=projects/*/locations/*/datasets/*}\x12\xf8\x01\n\x17\x43reateAdaptiveMtDataset\x12;.google.cloud.translation.v3.CreateAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"p\xda\x41\x1aparent,adaptive_mt_dataset\x82\xd3\xe4\x93\x02M\"6/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets:\x13\x61\x64\x61ptive_mt_dataset\x12\xb5\x01\n\x17\x44\x65leteAdaptiveMtDataset\x12;.google.cloud.translation.v3.DeleteAdaptiveMtDatasetRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\x12\xc7\x01\n\x14GetAdaptiveMtDataset\x12\x38.google.cloud.translation.v3.GetAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\x12\xda\x01\n\x16ListAdaptiveMtDatasets\x12:.google.cloud.translation.v3.ListAdaptiveMtDatasetsRequest\x1a;.google.cloud.translation.v3.ListAdaptiveMtDatasetsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets\x12\xdd\x01\n\x13\x41\x64\x61ptiveMtTranslate\x12\x37.google.cloud.translation.v3.AdaptiveMtTranslateRequest\x1a\x38.google.cloud.translation.v3.AdaptiveMtTranslateResponse\"S\xda\x41\x0eparent,content\x82\xd3\xe4\x93\x02<\"7/v3/{parent=projects/*/locations/*}:adaptiveMtTranslate:\x01*\x12\xd0\x01\n\x11GetAdaptiveMtFile\x12\x35.google.cloud.translation.v3.GetAdaptiveMtFileRequest\x1a+.google.cloud.translation.v3.AdaptiveMtFile\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\x12H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\x12\xc1\x01\n\x14\x44\x65leteAdaptiveMtFile\x12\x38.google.cloud.translation.v3.DeleteAdaptiveMtFileRequest\x1a\x16.google.protobuf.Empty\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J*H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\x12\xee\x01\n\x14ImportAdaptiveMtFile\x12\x38.google.cloud.translation.v3.ImportAdaptiveMtFileRequest\x1a\x39.google.cloud.translation.v3.ImportAdaptiveMtFileResponse\"a\xda\x41\x06parent\x82\xd3\xe4\x93\x02R\"M/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}:importAdaptiveMtFile:\x01*\x12\xe3\x01\n\x13ListAdaptiveMtFiles\x12\x37.google.cloud.translation.v3.ListAdaptiveMtFilesRequest\x1a\x38.google.cloud.translation.v3.ListAdaptiveMtFilesResponse\"Y\xda\x41\x06parent\x82\xd3\xe4\x93\x02J\x12H/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtFiles\x12\xd7\x02\n\x17ListAdaptiveMtSentences\x12;.google.cloud.translation.v3.ListAdaptiveMtSentencesRequest\x1a<.google.cloud.translation.v3.ListAdaptiveMtSentencesResponse\"\xc0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb0\x01\x12^/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}/adaptiveMtSentencesZN\x12L/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtSentences\x12\xe8\x01\n\nImportData\x12..google.cloud.translation.v3.ImportDataRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41+\n\x15google.protobuf.Empty\x12\x12ImportDataMetadata\xda\x41\x14\x64\x61taset,input_config\x82\xd3\xe4\x93\x02?\":/v3/{dataset=projects/*/locations/*/datasets/*}:importData:\x01*\x12\xe9\x01\n\nExportData\x12..google.cloud.translation.v3.ExportDataRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41+\n\x15google.protobuf.Empty\x12\x12\x45xportDataMetadata\xda\x41\x15\x64\x61taset,output_config\x82\xd3\xe4\x93\x02?\":/v3/{dataset=projects/*/locations/*/datasets/*}:exportData:\x01*\x12\xbd\x01\n\x0cListExamples\x12\x30.google.cloud.translation.v3.ListExamplesRequest\x1a\x31.google.cloud.translation.v3.ListExamplesResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/datasets/*}/examples\x12\xc6\x01\n\x0b\x43reateModel\x12/.google.cloud.translation.v3.CreateModelRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41\x1c\n\x05Model\x12\x13\x43reateModelMetadata\xda\x41\x0cparent,model\x82\xd3\xe4\x93\x02\x33\"*/v3/{parent=projects/*/locations/*}/models:\x05model\x12\xaa\x01\n\nListModels\x12..google.cloud.translation.v3.ListModelsRequest\x1a/.google.cloud.translation.v3.ListModelsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v3/{parent=projects/*/locations/*}/models\x12\x97\x01\n\x08GetModel\x12,.google.cloud.translation.v3.GetModelRequest\x1a\".google.cloud.translation.v3.Model\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/locations/*/models/*}\x12\xc7\x01\n\x0b\x44\x65leteModel\x12/.google.cloud.translation.v3.DeleteModelRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41,\n\x15google.protobuf.Empty\x12\x13\x44\x65leteModelMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/locations/*/models/*}\x1a~\xca\x41\x18translate.googleapis.com\xd2\x41`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translationB\xd6\x01\n\x1d\x63om.google.cloud.translate.v3B\x17TranslationServiceProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xa2\x02\x05\x43TRL3\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3P\x00P\x01P\x02\x62\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"], + ["google.cloud.translation.v3.GlossaryEntry", "google/cloud/translate/v3/common.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 Translate + module V3 + TransliterationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TransliterationConfig").msgclass + TranslateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextRequest").msgclass + TranslateTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextResponse").msgclass + Translation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Translation").msgclass + RomanizeTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.RomanizeTextRequest").msgclass + Romanization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Romanization").msgclass + RomanizeTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.RomanizeTextResponse").msgclass + DetectLanguageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectLanguageRequest").msgclass + DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectedLanguage").msgclass + DetectLanguageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectLanguageResponse").msgclass + GetSupportedLanguagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetSupportedLanguagesRequest").msgclass + SupportedLanguages = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.SupportedLanguages").msgclass + SupportedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.SupportedLanguage").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsSource").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.InputConfig").msgclass + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsDestination").msgclass + OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.OutputConfig").msgclass + DocumentInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DocumentInputConfig").msgclass + DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DocumentOutputConfig").msgclass + TranslateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateDocumentRequest").msgclass + DocumentTranslation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DocumentTranslation").msgclass + TranslateDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateDocumentResponse").msgclass + BatchTranslateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateTextRequest").msgclass + BatchTranslateMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateMetadata").msgclass + BatchTranslateMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateMetadata.State").enummodule + BatchTranslateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateResponse").msgclass + GlossaryInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryInputConfig").msgclass + Glossary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary").msgclass + Glossary::LanguageCodePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary.LanguageCodePair").msgclass + Glossary::LanguageCodesSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary.LanguageCodesSet").msgclass + CreateGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryRequest").msgclass + UpdateGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryRequest").msgclass + GetGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetGlossaryRequest").msgclass + DeleteGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryRequest").msgclass + ListGlossariesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossariesRequest").msgclass + ListGlossariesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossariesResponse").msgclass + GetGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetGlossaryEntryRequest").msgclass + DeleteGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryEntryRequest").msgclass + ListGlossaryEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossaryEntriesRequest").msgclass + ListGlossaryEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossaryEntriesResponse").msgclass + CreateGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryEntryRequest").msgclass + UpdateGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryEntryRequest").msgclass + CreateGlossaryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryMetadata").msgclass + CreateGlossaryMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryMetadata.State").enummodule + UpdateGlossaryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryMetadata").msgclass + UpdateGlossaryMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryMetadata.State").enummodule + DeleteGlossaryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryMetadata").msgclass + DeleteGlossaryMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryMetadata.State").enummodule + DeleteGlossaryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryResponse").msgclass + BatchTranslateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentRequest").msgclass + BatchDocumentInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchDocumentInputConfig").msgclass + BatchDocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchDocumentOutputConfig").msgclass + BatchTranslateDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentResponse").msgclass + BatchTranslateDocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentMetadata").msgclass + BatchTranslateDocumentMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentMetadata.State").enummodule + TranslateTextGlossaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextGlossaryConfig").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb new file mode 100644 index 000000000000..d7dd9d8ae961 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb @@ -0,0 +1,141 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/translate/v3/translation_service.proto for package 'Google.Cloud.Translate.V3' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/translate/v3/translation_service_pb' + +module Google + module Cloud + module Translate + module V3 + module TranslationService + # Proto file for the Cloud Translation API (v3 GA). + # + # Provides natural language translation operations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.translation.v3.TranslationService' + + # Translates input text and returns translated text. + rpc :TranslateText, ::Google::Cloud::Translate::V3::TranslateTextRequest, ::Google::Cloud::Translate::V3::TranslateTextResponse + # Romanize input text written in non-Latin scripts to Latin text. + rpc :RomanizeText, ::Google::Cloud::Translate::V3::RomanizeTextRequest, ::Google::Cloud::Translate::V3::RomanizeTextResponse + # Detects the language of text within a request. + rpc :DetectLanguage, ::Google::Cloud::Translate::V3::DetectLanguageRequest, ::Google::Cloud::Translate::V3::DetectLanguageResponse + # Returns a list of supported languages for translation. + rpc :GetSupportedLanguages, ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, ::Google::Cloud::Translate::V3::SupportedLanguages + # Translates documents in synchronous mode. + rpc :TranslateDocument, ::Google::Cloud::Translate::V3::TranslateDocumentRequest, ::Google::Cloud::Translate::V3::TranslateDocumentResponse + # Translates a large volume of text in asynchronous batch mode. + # This function provides real-time output as the inputs are being processed. + # If caller cancels a request, the partial results (for an input file, it's + # all or nothing) may still be available on the specified output location. + # + # This call returns immediately and you can + # use google.longrunning.Operation.name to poll the status of the call. + rpc :BatchTranslateText, ::Google::Cloud::Translate::V3::BatchTranslateTextRequest, ::Google::Longrunning::Operation + # Translates a large volume of document in asynchronous batch mode. + # This function provides real-time output as the inputs are being processed. + # If caller cancels a request, the partial results (for an input file, it's + # all or nothing) may still be available on the specified output location. + # + # This call returns immediately and you can use + # google.longrunning.Operation.name to poll the status of the call. + rpc :BatchTranslateDocument, ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, ::Google::Longrunning::Operation + # Creates a glossary and returns the long-running operation. Returns + # NOT_FOUND, if the project doesn't exist. + rpc :CreateGlossary, ::Google::Cloud::Translate::V3::CreateGlossaryRequest, ::Google::Longrunning::Operation + # Updates a glossary. A LRO is used since the update can be async if the + # glossary's entry file is updated. + rpc :UpdateGlossary, ::Google::Cloud::Translate::V3::UpdateGlossaryRequest, ::Google::Longrunning::Operation + # Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't + # exist. + rpc :ListGlossaries, ::Google::Cloud::Translate::V3::ListGlossariesRequest, ::Google::Cloud::Translate::V3::ListGlossariesResponse + # Gets a glossary. Returns NOT_FOUND, if the glossary doesn't + # exist. + rpc :GetGlossary, ::Google::Cloud::Translate::V3::GetGlossaryRequest, ::Google::Cloud::Translate::V3::Glossary + # Deletes a glossary, or cancels glossary construction + # if the glossary isn't created yet. + # Returns NOT_FOUND, if the glossary doesn't exist. + rpc :DeleteGlossary, ::Google::Cloud::Translate::V3::DeleteGlossaryRequest, ::Google::Longrunning::Operation + # Gets a single glossary entry by the given id. + rpc :GetGlossaryEntry, ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, ::Google::Cloud::Translate::V3::GlossaryEntry + # List the entries for the glossary. + rpc :ListGlossaryEntries, ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse + # Creates a glossary entry. + rpc :CreateGlossaryEntry, ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, ::Google::Cloud::Translate::V3::GlossaryEntry + # Updates a glossary entry. + rpc :UpdateGlossaryEntry, ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, ::Google::Cloud::Translate::V3::GlossaryEntry + # Deletes a single entry from the glossary + rpc :DeleteGlossaryEntry, ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, ::Google::Protobuf::Empty + # Creates a Dataset. + rpc :CreateDataset, ::Google::Cloud::Translate::V3::CreateDatasetRequest, ::Google::Longrunning::Operation + # Gets a Dataset. + rpc :GetDataset, ::Google::Cloud::Translate::V3::GetDatasetRequest, ::Google::Cloud::Translate::V3::Dataset + # Lists datasets. + rpc :ListDatasets, ::Google::Cloud::Translate::V3::ListDatasetsRequest, ::Google::Cloud::Translate::V3::ListDatasetsResponse + # Deletes a dataset and all of its contents. + rpc :DeleteDataset, ::Google::Cloud::Translate::V3::DeleteDatasetRequest, ::Google::Longrunning::Operation + # Creates an Adaptive MT dataset. + rpc :CreateAdaptiveMtDataset, ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, ::Google::Cloud::Translate::V3::AdaptiveMtDataset + # Deletes an Adaptive MT dataset, including all its entries and associated + # metadata. + rpc :DeleteAdaptiveMtDataset, ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, ::Google::Protobuf::Empty + # Gets the Adaptive MT dataset. + rpc :GetAdaptiveMtDataset, ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, ::Google::Cloud::Translate::V3::AdaptiveMtDataset + # Lists all Adaptive MT datasets for which the caller has read permission. + rpc :ListAdaptiveMtDatasets, ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse + # Translate text using Adaptive MT. + rpc :AdaptiveMtTranslate, ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse + # Gets and AdaptiveMtFile + rpc :GetAdaptiveMtFile, ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, ::Google::Cloud::Translate::V3::AdaptiveMtFile + # Deletes an AdaptiveMtFile along with its sentences. + rpc :DeleteAdaptiveMtFile, ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, ::Google::Protobuf::Empty + # Imports an AdaptiveMtFile and adds all of its sentences into the + # AdaptiveMtDataset. + rpc :ImportAdaptiveMtFile, ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse + # Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset. + rpc :ListAdaptiveMtFiles, ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse + # Lists all AdaptiveMtSentences under a given file/dataset. + rpc :ListAdaptiveMtSentences, ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse + # Import sentence pairs into translation Dataset. + rpc :ImportData, ::Google::Cloud::Translate::V3::ImportDataRequest, ::Google::Longrunning::Operation + # Exports dataset's data to the provided output location. + rpc :ExportData, ::Google::Cloud::Translate::V3::ExportDataRequest, ::Google::Longrunning::Operation + # Lists sentence pairs in the dataset. + rpc :ListExamples, ::Google::Cloud::Translate::V3::ListExamplesRequest, ::Google::Cloud::Translate::V3::ListExamplesResponse + # Creates a Model. + rpc :CreateModel, ::Google::Cloud::Translate::V3::CreateModelRequest, ::Google::Longrunning::Operation + # Lists models. + rpc :ListModels, ::Google::Cloud::Translate::V3::ListModelsRequest, ::Google::Cloud::Translate::V3::ListModelsResponse + # Gets a model. + rpc :GetModel, ::Google::Cloud::Translate::V3::GetModelRequest, ::Google::Cloud::Translate::V3::Model + # Deletes a model. + rpc :DeleteModel, ::Google::Cloud::Translate::V3::DeleteModelRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb new file mode 100644 index 000000000000..dacb619abd34 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md b/owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md new file mode 100644 index 000000000000..4a5eb6a2d169 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Translation V3 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-translate-v3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb new file mode 100644 index 000000000000..9c20fdd4d804 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb @@ -0,0 +1,405 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + # An Adaptive MT Dataset. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the dataset, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset_id}` + # @!attribute [rw] display_name + # @return [::String] + # The name of the dataset to show in the interface. The name can be + # up to 32 characters long and can consist only of ASCII Latin letters A-Z + # and a-z, underscores (_), and ASCII digits 0-9. + # @!attribute [rw] source_language_code + # @return [::String] + # The BCP-47 language code of the source language. + # @!attribute [rw] target_language_code + # @return [::String] + # The BCP-47 language code of the target language. + # @!attribute [rw] example_count + # @return [::Integer] + # The number of examples in the dataset. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this dataset was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this dataset was last updated. + class AdaptiveMtDataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + #  Request message for creating an AdaptiveMtDataset. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @!attribute [rw] adaptive_mt_dataset + # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] + # Required. The AdaptiveMtDataset to be created. + class CreateAdaptiveMtDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting an AdaptiveMtDataset. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the dataset. In the form of + # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` + class DeleteAdaptiveMtDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting an Adaptive MT dataset. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the dataset. In the form of + # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` + class GetAdaptiveMtDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing all Adaptive MT datasets that the requestor has + # access to. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project from which to list the Adaptive + # MT datasets. `projects/{project-number-or-id}/locations/{location-id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server may return fewer results than + # requested. If unspecified, the server picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtDatasetsResponse.next_page_token returned from the + # previous call to `ListAdaptiveMtDatasets` method. The first page is + # returned if `page_token`is empty or missing. + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the results of the request. + # Filter is not supported yet. + class ListAdaptiveMtDatasetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of AdaptiveMtDatasets. + # @!attribute [r] adaptive_mt_datasets + # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] + # Output only. A list of Adaptive MT datasets. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token to retrieve a page of results. Pass this value in the + # [ListAdaptiveMtDatasetsRequest.page_token] field in the subsequent call to + # `ListAdaptiveMtDatasets` method to retrieve the next page of results. + class ListAdaptiveMtDatasetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for sending an AdaptiveMt translation query. + # @!attribute [rw] parent + # @return [::String] + # Required. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # @!attribute [rw] dataset + # @return [::String] + # Required. The resource name for the dataset to use for adaptive MT. + # `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` + # @!attribute [rw] content + # @return [::Array<::String>] + # Required. The content of the input in string format. + # @!attribute [rw] reference_sentence_config + # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig] + # Configuration for caller provided reference sentences. + # @!attribute [rw] glossary_config + # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig] + # Optional. Glossary to be applied. The glossary must be + # within the same region (have the same location-id) as the model, otherwise + # an INVALID_ARGUMENT (400) error is returned. + class AdaptiveMtTranslateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A pair of sentences used as reference in source and target languages. + # @!attribute [rw] source_sentence + # @return [::String] + # Source sentence in the sentence pair. + # @!attribute [rw] target_sentence + # @return [::String] + # Target sentence in the sentence pair. + class ReferenceSentencePair + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of reference sentence pairs. + # @!attribute [rw] reference_sentence_pairs + # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentencePair>] + # Reference sentence pairs. + class ReferenceSentencePairList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message of caller-provided reference configuration. + # @!attribute [rw] reference_sentence_pair_lists + # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentencePairList>] + # Reference sentences pair lists. Each list will be used as the references + # to translate the sentence under "content" field at the corresponding + # index. Length of the list is required to be equal to the length of + # "content" field. + # @!attribute [rw] source_language_code + # @return [::String] + # Source language code. + # @!attribute [rw] target_language_code + # @return [::String] + # Target language code. + class ReferenceSentenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configures which glossary is used for a specific target language and + # defines + # options for applying that glossary. + # @!attribute [rw] glossary + # @return [::String] + # Required. The `glossary` to be applied for this translation. + # + # The format depends on the glossary: + # + # - User-provided custom glossary: + # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` + # @!attribute [rw] ignore_case + # @return [::Boolean] + # Optional. Indicates match is case insensitive. The default value is + # `false` if missing. + # @!attribute [rw] contextual_translation_enabled + # @return [::Boolean] + # Optional. If set to true, the glossary will be used for contextual + # translation. + class GlossaryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # An AdaptiveMt translation. + # @!attribute [r] translated_text + # @return [::String] + # Output only. The translated text. + class AdaptiveMtTranslation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AdaptiveMtTranslate response. + # @!attribute [r] translations + # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslation>] + # Output only. The translation. + # @!attribute [r] language_code + # @return [::String] + # Output only. The translation's language code. + # @!attribute [rw] glossary_translations + # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslation>] + # Text translation response if a glossary is provided in the request. This + # could be the same as 'translation' above if no terms apply. + class AdaptiveMtTranslateResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AdaptiveMtFile. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # @!attribute [rw] display_name + # @return [::String] + # The file's display name. + # @!attribute [rw] entry_count + # @return [::Integer] + # The number of entries that the file contains. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this file was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this file was last updated. + class AdaptiveMtFile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for getting an AdaptiveMtFile. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + class GetAdaptiveMtFileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for deleting an AdaptiveMt file. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the file to delete, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + class DeleteAdaptiveMtFileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for importing an AdaptiveMt file along with its sentences. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}` + # @!attribute [rw] file_input_source + # @return [::Google::Cloud::Translate::V3::FileInputSource] + # Inline file source. + # + # Note: The following fields are mutually exclusive: `file_input_source`, `gcs_input_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_input_source + # @return [::Google::Cloud::Translate::V3::GcsInputSource] + # Google Cloud Storage file source. + # + # Note: The following fields are mutually exclusive: `gcs_input_source`, `file_input_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ImportAdaptiveMtFileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for importing an AdaptiveMtFile + # @!attribute [r] adaptive_mt_file + # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] + # Output only. The Adaptive MT file that was imported. + class ImportAdaptiveMtFileResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to list all AdaptiveMt files under a given dataset. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project from which to list the Adaptive + # MT files. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtFilesResponse.next_page_token returned from the + # previous call to `ListAdaptiveMtFiles` method. The first page is + # returned if `page_token`is empty or missing. + class ListAdaptiveMtFilesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for listing all AdaptiveMt files under a given dataset. + # @!attribute [r] adaptive_mt_files + # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtFile>] + # Output only. The Adaptive MT files. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token to retrieve a page of results. Pass this value in the + # ListAdaptiveMtFilesRequest.page_token field in the subsequent call to + # `ListAdaptiveMtFiles` method to retrieve the next page of results. + class ListAdaptiveMtFilesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An AdaptiveMt sentence entry. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the file, in form of + # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}` + # @!attribute [rw] source_sentence + # @return [::String] + # Required. The source sentence. + # @!attribute [rw] target_sentence + # @return [::String] + # Required. The target sentence. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this sentence was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this sentence was last updated. + class AdaptiveMtSentence + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request for listing Adaptive MT sentences from a Dataset/File. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project from which to list the Adaptive + # MT files. The following format lists all sentences under a file. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` + # The following format lists all sentences within a dataset. + # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` + # @!attribute [rw] page_size + # @return [::Integer] + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # Typically, this is the value of + # ListAdaptiveMtSentencesRequest.next_page_token returned from the + # previous call to `ListTranslationMemories` method. The first page is + # returned if `page_token` is empty or missing. + class ListAdaptiveMtSentencesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List AdaptiveMt sentences response. + # @!attribute [r] adaptive_mt_sentences + # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] + # Output only. The list of AdaptiveMtSentences. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. + class ListAdaptiveMtSentencesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb new file mode 100644 index 000000000000..0c1912d9abd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb @@ -0,0 +1,487 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + # Request message for ImportData. + # @!attribute [rw] dataset + # @return [::String] + # Required. Name of the dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @!attribute [rw] input_config + # @return [::Google::Cloud::Translate::V3::DatasetInputConfig] + # Required. The config for the input content. + class ImportDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input configuration for datasets. + # @!attribute [rw] input_files + # @return [::Array<::Google::Cloud::Translate::V3::DatasetInputConfig::InputFile>] + # Files containing the sentence pairs to be imported to the dataset. + class DatasetInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An input file. + # @!attribute [rw] usage + # @return [::String] + # Optional. Usage of the file contents. Options are TRAIN|VALIDATION|TEST, + # or UNASSIGNED (by default) for auto split. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Translate::V3::GcsInputSource] + # Google Cloud Storage file source. + class InputFile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata of import data operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::OperationState] + # The current state of the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Only populated when operation doesn't succeed. + class ImportDataMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ExportData. + # @!attribute [rw] dataset + # @return [::String] + # Required. Name of the dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @!attribute [rw] output_config + # @return [::Google::Cloud::Translate::V3::DatasetOutputConfig] + # Required. The config for the output content. + class ExportDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configuration for datasets. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Translate::V3::GcsOutputDestination] + # Google Cloud Storage destination to write the output. + class DatasetOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of export data operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::OperationState] + # The current state of the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Only populated when operation doesn't succeed. + class ExportDataMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteDataset. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the dataset to delete. + class DeleteDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of delete dataset operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::OperationState] + # The current state of the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Only populated when operation doesn't succeed. + class DeleteDatasetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetDataset. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the dataset to retrieve. + class GetDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListDatasets. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListDatasets call. + class ListDatasetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListDatasets. + # @!attribute [rw] datasets + # @return [::Array<::Google::Cloud::Translate::V3::Dataset>] + # The datasets read. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass this token to the page_token field in the ListDatasetsRequest to + # obtain the corresponding page. + class ListDatasetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateDataset. + # @!attribute [rw] parent + # @return [::String] + # Required. The project name. + # @!attribute [rw] dataset + # @return [::Google::Cloud::Translate::V3::Dataset] + # Required. The Dataset to create. + class CreateDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of create dataset operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::OperationState] + # The current state of the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Only populated when operation doesn't succeed. + class CreateDatasetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListExamples. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent dataset. In form of + # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the examples that will be returned. + # Example filter: + # * `usage=TRAIN` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListExamples call. + class ListExamplesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListExamples. + # @!attribute [rw] examples + # @return [::Array<::Google::Cloud::Translate::V3::Example>] + # The sentence pairs. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass this token to the page_token field in the ListExamplesRequest to + # obtain the corresponding page. + class ListExamplesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A sentence pair. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the example, in form of + # `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}` + # @!attribute [rw] source_text + # @return [::String] + # Sentence in source language. + # @!attribute [rw] target_text + # @return [::String] + # Sentence in target language. + # @!attribute [r] usage + # @return [::String] + # Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST. + class Example + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for BatchTransferResources. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Translate::V3::BatchTransferResourcesResponse::TransferResourceResponse>] + # Responses of the transfer for individual resources. + class BatchTransferResourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Transfer response for a single resource. + # @!attribute [rw] source + # @return [::String] + # Full name of the resource to transfer as specified in the request. + # @!attribute [rw] target + # @return [::String] + # Full name of the new resource successfully transferred from the source + # hosted by Translation API. Target will be empty if the transfer failed. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result in case of failure. + class TransferResourceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A dataset that hosts the examples (sentence pairs) used for translation + # models. + # @!attribute [rw] name + # @return [::String] + # The resource name of the dataset, in form of + # `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}` + # @!attribute [rw] display_name + # @return [::String] + # The name of the dataset to show in the interface. The name can be + # up to 32 characters long and can consist only of ASCII Latin letters A-Z + # and a-z, underscores (_), and ASCII digits 0-9. + # @!attribute [rw] source_language_code + # @return [::String] + # The BCP-47 language code of the source language. + # @!attribute [rw] target_language_code + # @return [::String] + # The BCP-47 language code of the target language. + # @!attribute [r] example_count + # @return [::Integer] + # Output only. The number of examples in the dataset. + # @!attribute [r] train_example_count + # @return [::Integer] + # Output only. Number of training examples (sentence pairs). + # @!attribute [r] validate_example_count + # @return [::Integer] + # Output only. Number of validation examples (sentence pairs). + # @!attribute [r] test_example_count + # @return [::Integer] + # Output only. Number of test examples (sentence pairs). + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this dataset was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this dataset was last updated. + class Dataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateModel. + # @!attribute [rw] parent + # @return [::String] + # Required. The project name, in form of + # `projects/{project}/locations/{location}` + # @!attribute [rw] model + # @return [::Google::Cloud::Translate::V3::Model] + # Required. The Model to create. + class CreateModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of create model operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::OperationState] + # The current state of the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Only populated when operation doesn't succeed. + class CreateModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListModels. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the parent project. In form of + # `projects/{project-number-or-id}/locations/{location-id}` + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the models that will be returned. + # Supported filter: + # `dataset_id=${dataset_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server can return fewer results than + # requested. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results for the server to return. + # Typically obtained from next_page_token field in the response of a + # ListModels call. + class ListModelsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListModels. + # @!attribute [rw] models + # @return [::Array<::Google::Cloud::Translate::V3::Model>] + # The models read. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass this token to the page_token field in the ListModelsRequest to + # obtain the corresponding page. + class ListModelsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetModel. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the model to retrieve. + class GetModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteModel. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the model to delete. + class DeleteModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of delete model operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::OperationState] + # The current state of the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The last update time of the operation. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Only populated when operation doesn't succeed. + class DeleteModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A trained translation model. + # @!attribute [rw] name + # @return [::String] + # The resource name of the model, in form of + # `projects/{project-number-or-id}/locations/{location_id}/models/{model_id}` + # @!attribute [rw] display_name + # @return [::String] + # The name of the model to show in the interface. The name can be + # up to 32 characters long and can consist only of ASCII Latin letters A-Z + # and a-z, underscores (_), and ASCII digits 0-9. + # @!attribute [rw] dataset + # @return [::String] + # The dataset from which the model is trained, in form of + # `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}` + # @!attribute [r] source_language_code + # @return [::String] + # Output only. The BCP-47 language code of the source language. + # @!attribute [r] target_language_code + # @return [::String] + # Output only. The BCP-47 language code of the target language. + # @!attribute [r] train_example_count + # @return [::Integer] + # Output only. Number of examples (sentence pairs) used to train the model. + # @!attribute [r] validate_example_count + # @return [::Integer] + # Output only. Number of examples (sentence pairs) used to validate the + # model. + # @!attribute [r] test_example_count + # @return [::Integer] + # Output only. Number of examples (sentence pairs) used to test the model. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the model resource was created, which is also + # when the training started. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when this model was last updated. + class Model + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb new file mode 100644 index 000000000000..2309b07edac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + # The Google Cloud Storage location for the input content. + # @!attribute [rw] input_uri + # @return [::String] + # Required. Source data URI. For example, `gs://my_bucket/my_object`. + class GcsInputSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An inlined file. + # @!attribute [rw] mime_type + # @return [::String] + # Required. The file's mime type. + # @!attribute [rw] content + # @return [::String] + # Required. The file's byte contents. + # @!attribute [rw] display_name + # @return [::String] + # Required. The file's display name. + class FileInputSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location for the output content. + # @!attribute [rw] output_uri_prefix + # @return [::String] + # Required. Google Cloud Storage URI to output directory. For example, + # `gs://bucket/directory`. The requesting user must have write permission to + # the bucket. The directory will be created if it doesn't exist. + class GcsOutputDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a single entry in a glossary. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the entry. + # Format: + # `projects/*/locations/*/glossaries/*/glossaryEntries/*` + # @!attribute [rw] terms_pair + # @return [::Google::Cloud::Translate::V3::GlossaryEntry::GlossaryTermsPair] + # Used for an unidirectional glossary. + # + # Note: The following fields are mutually exclusive: `terms_pair`, `terms_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] terms_set + # @return [::Google::Cloud::Translate::V3::GlossaryEntry::GlossaryTermsSet] + # Used for an equivalent term sets glossary. + # + # Note: The following fields are mutually exclusive: `terms_set`, `terms_pair`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] description + # @return [::String] + # Describes the glossary entry. + class GlossaryEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a single entry for an unidirectional glossary. + # @!attribute [rw] source_term + # @return [::Google::Cloud::Translate::V3::GlossaryTerm] + # The source term is the term that will get match in the text, + # @!attribute [rw] target_term + # @return [::Google::Cloud::Translate::V3::GlossaryTerm] + # The term that will replace the match source term. + class GlossaryTermsPair + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a single entry for an equivalent term set glossary. This is used + # for equivalent term sets where each term can be replaced by the other terms + # in the set. + # @!attribute [rw] terms + # @return [::Array<::Google::Cloud::Translate::V3::GlossaryTerm>] + # Each term in the set represents a term that can be replaced by the other + # terms. + class GlossaryTermsSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents a single glossary term + # @!attribute [rw] language_code + # @return [::String] + # The language for this glossary term. + # @!attribute [rw] text + # @return [::String] + # The text for the glossary term. + class GlossaryTerm + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible states of long running operations. + module OperationState + # Invalid. + OPERATION_STATE_UNSPECIFIED = 0 + + # Request is being processed. + OPERATION_STATE_RUNNING = 1 + + # The operation was successful. + OPERATION_STATE_SUCCEEDED = 2 + + # Failed to process operation. + OPERATION_STATE_FAILED = 3 + + # Request is in the process of being canceled after caller invoked + # longrunning.Operations.CancelOperation on the request id. + OPERATION_STATE_CANCELLING = 4 + + # The operation request was successfully canceled. + OPERATION_STATE_CANCELLED = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb new file mode 100644 index 000000000000..314073d5ff59 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb @@ -0,0 +1,1657 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + module V3 + # Configures transliteration feature on top of translation. + # @!attribute [rw] enable_transliteration + # @return [::Boolean] + # If true, source text in romanized form can be translated to the target + # language. + class TransliterationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for synchronous translation. + # @!attribute [rw] contents + # @return [::Array<::String>] + # Required. The content of the input in string format. + # We recommend the total content be less than 30,000 codepoints. The max + # length of this field is 1024. Use BatchTranslateText for larger text. + # @!attribute [rw] mime_type + # @return [::String] + # Optional. The format of the source text, for example, "text/html", + # "text/plain". If left blank, the MIME type defaults to "text/html". + # @!attribute [rw] source_language_code + # @return [::String] + # Optional. The ISO-639 language code of the input text if + # known, for example, "en-US" or "sr-Latn". Supported language codes are + # listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). If the source + # language isn't specified, the API attempts to identify the source language + # automatically and returns the source language within the response. + # @!attribute [rw] target_language_code + # @return [::String] + # Required. The ISO-639 language code to use for translation of the input + # text, set to one of the language codes listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @!attribute [rw] parent + # @return [::String] + # Required. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}` or + # `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for requests using AutoML models or + # custom glossaries. + # + # Models and glossaries must be within the same region (have same + # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + # @!attribute [rw] model + # @return [::String] + # Optional. The `model` type requested for this translation. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # - Translation LLM models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, + # + # For global (non-regionalized) requests, use `location-id` `global`. + # For example, + # `projects/{project-number-or-id}/locations/global/models/general/nmt`. + # + # If not provided, the default Google model (NMT) will be used + # @!attribute [rw] glossary_config + # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] + # Optional. Glossary to be applied. The glossary must be + # within the same region (have the same location-id) as the model, otherwise + # an INVALID_ARGUMENT (400) error is returned. + # @!attribute [rw] transliteration_config + # @return [::Google::Cloud::Translate::V3::TransliterationConfig] + # Optional. Transliteration to be applied. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + class TranslateTextRequest + 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 + + # @!attribute [rw] translations + # @return [::Array<::Google::Cloud::Translate::V3::Translation>] + # Text translation responses with no glossary applied. + # This field has the same length as + # {::Google::Cloud::Translate::V3::TranslateTextRequest#contents `contents`}. + # @!attribute [rw] glossary_translations + # @return [::Array<::Google::Cloud::Translate::V3::Translation>] + # Text translation responses if a glossary is provided in the request. + # This can be the same as + # {::Google::Cloud::Translate::V3::TranslateTextResponse#translations `translations`} + # if no terms apply. This field has the same length as + # {::Google::Cloud::Translate::V3::TranslateTextRequest#contents `contents`}. + class TranslateTextResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single translation response. + # @!attribute [rw] translated_text + # @return [::String] + # Text translated into the target language. + # If an error occurs during translation, this field might be excluded from + # the response. + # @!attribute [rw] model + # @return [::String] + # Only present when `model` is present in the request. + # `model` here is normalized to have project number. + # + # For example: + # If the `model` requested in TranslationTextRequest is + # `projects/{project-id}/locations/{location-id}/models/general/nmt` then + # `model` here would be normalized to + # `projects/{project-number}/locations/{location-id}/models/general/nmt`. + # @!attribute [rw] detected_language_code + # @return [::String] + # The ISO-639 language code of source text in the initial request, detected + # automatically, if no source language was passed within the initial + # request. If the source language was passed, auto-detection of the language + # does not occur and this field is empty. + # @!attribute [rw] glossary_config + # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] + # The `glossary_config` used for this translation. + class Translation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for synchronous romanization. + # @!attribute [rw] parent + # @return [::String] + # Required. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}` or + # `projects/{project-number-or-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # @!attribute [rw] contents + # @return [::Array<::String>] + # Required. The content of the input in string format. + # @!attribute [rw] source_language_code + # @return [::String] + # Optional. The ISO-639 language code of the input text if + # known, for example, "hi" or "zh". Supported language codes are + # listed in [Language + # Support](https://cloud.google.com/translate/docs/languages#roman). If the + # source language isn't specified, the API attempts to identify the source + # language automatically and returns the source language for each content in + # the response. + class RomanizeTextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single romanization response. + # @!attribute [rw] romanized_text + # @return [::String] + # Romanized text. + # If an error occurs during romanization, this field might be excluded from + # the response. + # @!attribute [rw] detected_language_code + # @return [::String] + # The ISO-639 language code of source text in the initial request, detected + # automatically, if no source language was passed within the initial + # request. If the source language was passed, auto-detection of the language + # does not occur and this field is empty. + class Romanization + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for synchronous romanization. + # @!attribute [rw] romanizations + # @return [::Array<::Google::Cloud::Translate::V3::Romanization>] + # Text romanization responses. + # This field has the same length as + # {::Google::Cloud::Translate::V3::RomanizeTextRequest#contents `contents`}. + class RomanizeTextResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for language detection. + # @!attribute [rw] parent + # @return [::String] + # Required. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}` or + # `projects/{project-number-or-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Only models within the same region (has same location-id) can be used. + # Otherwise an INVALID_ARGUMENT (400) error is returned. + # @!attribute [rw] model + # @return [::String] + # Optional. The language detection model to be used. + # + # Format: + # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` + # + # Only one language detection model is currently supported: + # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. + # + # If not specified, the default model is used. + # @!attribute [rw] content + # @return [::String] + # The content of the input stored as a string. + # @!attribute [rw] mime_type + # @return [::String] + # Optional. The format of the source text, for example, "text/html", + # "text/plain". If left blank, the MIME type defaults to "text/html". + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + class DetectLanguageRequest + 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 response message for language detection. + # @!attribute [rw] language_code + # @return [::String] + # The ISO-639 language code of the source content in the request, detected + # automatically. + # @!attribute [rw] confidence + # @return [::Float] + # The confidence of the detection result for this language. + class DetectedLanguage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for language detection. + # @!attribute [rw] languages + # @return [::Array<::Google::Cloud::Translate::V3::DetectedLanguage>] + # The most probable language detected by the Translation API. For each + # request, the Translation API will always return only one result. + class DetectLanguageResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for discovering supported languages. + # @!attribute [rw] parent + # @return [::String] + # Required. Project or location to make a call. Must refer to a caller's + # project. + # + # Format: `projects/{project-number-or-id}` or + # `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for AutoML models. + # + # Only models within the same region (have same location-id) can be used, + # otherwise an INVALID_ARGUMENT (400) error is returned. + # @!attribute [rw] display_language_code + # @return [::String] + # Optional. The language to use to return localized, human readable names + # of supported languages. If missing, then display names are not returned + # in a response. + # @!attribute [rw] model + # @return [::String] + # Optional. Get supported languages of this model. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # Returns languages supported by the specified model. + # If missing, we get supported languages of Google general NMT model. + class GetSupportedLanguagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for discovering supported languages. + # @!attribute [rw] languages + # @return [::Array<::Google::Cloud::Translate::V3::SupportedLanguage>] + # A list of supported language responses. This list contains an entry + # for each language the Translation API supports. + class SupportedLanguages + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single supported language response corresponds to information related + # to one supported language. + # @!attribute [rw] language_code + # @return [::String] + # Supported language code, generally consisting of its ISO 639-1 + # identifier, for example, 'en', 'ja'. In certain cases, ISO-639 codes + # including language and region identifiers are returned (for example, + # 'zh-TW' and 'zh-CN'). + # @!attribute [rw] display_name + # @return [::String] + # Human-readable name of the language localized in the display language + # specified in the request. + # @!attribute [rw] support_source + # @return [::Boolean] + # Can be used as a source language. + # @!attribute [rw] support_target + # @return [::Boolean] + # Can be used as a target language. + class SupportedLanguage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location for the input content. + # @!attribute [rw] input_uri + # @return [::String] + # Required. Source data URI. For example, `gs://my_bucket/my_object`. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input configuration for BatchTranslateText request. + # @!attribute [rw] mime_type + # @return [::String] + # Optional. Can be "text/plain" or "text/html". + # For `.tsv`, "text/html" is used if mime_type is missing. + # For `.html`, this field must be "text/html" or empty. + # For `.txt`, this field must be "text/plain" or empty. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Translate::V3::GcsSource] + # Required. Google Cloud Storage location for the source input. + # This can be a single file (for example, + # `gs://translation-test/input.tsv`) or a wildcard (for example, + # `gs://translation-test/*`). If a file extension is `.tsv`, it can + # contain either one or two columns. The first column (optional) is the id + # of the text request. If the first column is missing, we use the row + # number (0-based) from the input file as the ID in the output file. The + # second column is the actual text to be + # translated. We recommend each row be <= 10K Unicode codepoints, + # otherwise an error might be returned. + # Note that the input tsv must be RFC 4180 compliant. + # + # You could use https://github.com/Clever/csvlint to check potential + # formatting errors in your tsv file. + # csvlint --delimiter='\t' your_input_file.tsv + # + # The other supported file extensions are `.txt` or `.html`, which is + # treated as a single large chunk of text. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location for the output content. + # @!attribute [rw] output_uri_prefix + # @return [::String] + # Required. The bucket used in 'output_uri_prefix' must exist and there must + # be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with + # "/" and start with "gs://". One 'output_uri_prefix' can only be used by one + # batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error + # is returned. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configuration for BatchTranslateText request. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Translate::V3::GcsDestination] + # Google Cloud Storage destination for output content. + # For every single input file (for example, gs://a/b/c.[extension]), we + # generate at most 2 * n output files. (n is the # of target_language_codes + # in the BatchTranslateTextRequest). + # + # Output files (tsv) generated are compliant with RFC 4180 except that + # record delimiters are '\n' instead of '\r\n'. We don't provide any way to + # change record delimiters. + # + # While the input files are being processed, we write/update an index file + # 'index.csv' under 'output_uri_prefix' (for example, + # gs://translation-test/index.csv) The index file is generated/updated as + # new files are being translated. The format is: + # + # input_file,target_language_code,translations_file,errors_file, + # glossary_translations_file,glossary_errors_file + # + # input_file is one file we matched using gcs_source.input_uri. + # target_language_code is provided in the request. + # translations_file contains the translations. (details provided below) + # errors_file contains the errors during processing of the file. (details + # below). Both translations_file and errors_file could be empty + # strings if we have no content to output. + # glossary_translations_file and glossary_errors_file are always empty + # strings if the input_file is tsv. They could also be empty if we have no + # content to output. + # + # Once a row is present in index.csv, the input/output matching never + # changes. Callers should also expect all the content in input_file are + # processed and ready to be consumed (that is, no partial output file is + # written). + # + # Since index.csv will be keeping updated during the process, please make + # sure there is no custom retention policy applied on the output bucket + # that may avoid file updating. + # (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) + # + # The format of translations_file (for target language code 'trg') is: + # `gs://translation_test/a_b_c_'trg'_translations.[extension]` + # + # If the input file extension is tsv, the output has the following + # columns: + # Column 1: ID of the request provided in the input, if it's not + # provided in the input, then the input row number is used (0-based). + # Column 2: source sentence. + # Column 3: translation without applying a glossary. Empty string if there + # is an error. + # Column 4 (only present if a glossary is provided in the request): + # translation after applying the glossary. Empty string if there is an + # error applying the glossary. Could be same string as column 3 if there is + # no glossary applied. + # + # If input file extension is a txt or html, the translation is directly + # written to the output file. If glossary is requested, a separate + # glossary_translations_file has format of + # `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` + # + # The format of errors file (for target language code 'trg') is: + # `gs://translation_test/a_b_c_'trg'_errors.[extension]` + # + # If the input file extension is tsv, errors_file contains the following: + # Column 1: ID of the request provided in the input, if it's not + # provided in the input, then the input row number is used (0-based). + # Column 2: source sentence. + # Column 3: Error detail for the translation. Could be empty. + # Column 4 (only present if a glossary is provided in the request): + # Error when applying the glossary. + # + # If the input file extension is txt or html, glossary_error_file will be + # generated that contains error details. glossary_error_file has format of + # `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A document translation request input config. + # @!attribute [rw] content + # @return [::String] + # Document's content represented as a stream of bytes. + # + # Note: The following fields are mutually exclusive: `content`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Translate::V3::GcsSource] + # Google Cloud Storage location. This must be a single file. + # For example: gs://example_bucket/example_file.pdf + # + # Note: The following fields are mutually exclusive: `gcs_source`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] mime_type + # @return [::String] + # Specifies the input document's mime_type. + # + # If not specified it will be determined using the file extension for + # gcs_source provided files. For a file provided through bytes content the + # mime_type must be provided. + # Currently supported mime types are: + # - application/pdf + # - application/vnd.openxmlformats-officedocument.wordprocessingml.document + # - application/vnd.openxmlformats-officedocument.presentationml.presentation + # - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + class DocumentInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A document translation request output config. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Translate::V3::GcsDestination] + # Optional. Google Cloud Storage destination for the translation output, + # e.g., `gs://my_bucket/my_directory/`. + # + # The destination directory provided does not have to be empty, but the + # bucket must exist. If a file with the same name as the output file + # already exists in the destination an error will be returned. + # + # For a DocumentInputConfig.contents provided document, the output file + # will have the name "output_[trg]_translations.[ext]", where + # - [trg] corresponds to the translated file's language code, + # - [ext] corresponds to the translated file's extension according to its + # mime type. + # + # + # For a DocumentInputConfig.gcs_uri provided document, the output file will + # have a name according to its URI. For example: an input file with URI: + # `gs://a/b/c.[extension]` stored in a gcs_destination bucket with name + # "my_bucket" will have an output URI: + # `gs://my_bucket/a_b_c_[trg]_translations.[ext]`, where + # - [trg] corresponds to the translated file's language code, + # - [ext] corresponds to the translated file's extension according to its + # mime type. + # + # + # If the document was directly provided through the request, then the + # output document will have the format: + # `gs://my_bucket/translated_document_[trg]_translations.[ext]`, where + # - [trg] corresponds to the translated file's language code, + # - [ext] corresponds to the translated file's extension according to its + # mime type. + # + # If a glossary was provided, then the output URI for the glossary + # translation will be equal to the default output URI but have + # `glossary_translations` instead of `translations`. For the previous + # example, its glossary URI would be: + # `gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]`. + # + # Thus the max number of output files will be 2 (Translated document, + # Glossary translated document). + # + # Callers should expect no partial outputs. If there is any error during + # document translation, no output will be stored in the Cloud Storage + # bucket. + # @!attribute [rw] mime_type + # @return [::String] + # Optional. Specifies the translated document's mime_type. + # If not specified, the translated file's mime type will be the same as the + # input file's mime type. + # Currently only support the output mime type to be the same as input mime + # type. + # - application/pdf + # - application/vnd.openxmlformats-officedocument.wordprocessingml.document + # - application/vnd.openxmlformats-officedocument.presentationml.presentation + # - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + class DocumentOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A document translation request. + # @!attribute [rw] parent + # @return [::String] + # Required. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # For global calls, use `projects/{project-number-or-id}/locations/global` or + # `projects/{project-number-or-id}`. + # + # Non-global location is required for requests using AutoML models or custom + # glossaries. + # + # Models and glossaries must be within the same region (have the same + # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. + # @!attribute [rw] source_language_code + # @return [::String] + # Optional. The ISO-639 language code of the input document if known, for + # example, "en-US" or "sr-Latn". Supported language codes are listed in + # [Language Support](https://cloud.google.com/translate/docs/languages). If + # the source language isn't specified, the API attempts to identify the + # source language automatically and returns the source language within the + # response. Source language must be specified if the request contains a + # glossary or a custom model. + # @!attribute [rw] target_language_code + # @return [::String] + # Required. The ISO-639 language code to use for translation of the input + # document, set to one of the language codes listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @!attribute [rw] document_input_config + # @return [::Google::Cloud::Translate::V3::DocumentInputConfig] + # Required. Input configurations. + # @!attribute [rw] document_output_config + # @return [::Google::Cloud::Translate::V3::DocumentOutputConfig] + # Optional. Output configurations. + # Defines if the output file should be stored within Cloud Storage as well + # as the desired output format. If not provided the translated file will + # only be returned through a byte-stream and its output mime type will be + # the same as the input file's mime type. + # @!attribute [rw] model + # @return [::String] + # Optional. The `model` type requested for this translation. + # + # The format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If not provided, the default Google model (NMT) will be used for + # translation. + # @!attribute [rw] glossary_config + # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] + # Optional. Glossary to be applied. The glossary must be within the same + # region (have the same location-id) as the model, otherwise an + # INVALID_ARGUMENT (400) error is returned. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters (Unicode + # codepoints), can only contain lowercase letters, numeric characters, + # underscores and dashes. International characters are allowed. Label values + # are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + # @!attribute [rw] customized_attribution + # @return [::String] + # Optional. This flag is to support user customized attribution. + # If not provided, the default is `Machine Translated by Google`. + # Customized attribution should follow rules in + # https://cloud.google.com/translate/attribution#attribution_and_logos + # @!attribute [rw] is_translate_native_pdf_only + # @return [::Boolean] + # Optional. is_translate_native_pdf_only field for external customers. + # If true, the page limit of online native pdf translation is 300 and only + # native pdf pages will be translated. + # @!attribute [rw] enable_shadow_removal_native_pdf + # @return [::Boolean] + # Optional. If true, use the text removal server to remove the shadow text on + # background image for native pdf translation. + # Shadow removal feature can only be enabled when + # is_translate_native_pdf_only: false && pdf_native_only: false + # @!attribute [rw] enable_rotation_correction + # @return [::Boolean] + # Optional. If true, enable auto rotation correction in DVS. + class TranslateDocumentRequest + 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 translated document message. + # @!attribute [rw] byte_stream_outputs + # @return [::Array<::String>] + # The array of translated documents. It is expected to be size 1 for now. We + # may produce multiple translated documents in the future for other type of + # file formats. + # @!attribute [rw] mime_type + # @return [::String] + # The translated document's mime type. + # @!attribute [rw] detected_language_code + # @return [::String] + # The detected language for the input document. + # If the user did not provide the source language for the input document, + # this field will have the language code automatically detected. If the + # source language was passed, auto-detection of the language does not occur + # and this field is empty. + class DocumentTranslation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A translated document response message. + # @!attribute [rw] document_translation + # @return [::Google::Cloud::Translate::V3::DocumentTranslation] + # Translated document. + # @!attribute [rw] glossary_document_translation + # @return [::Google::Cloud::Translate::V3::DocumentTranslation] + # The document's translation output if a glossary is provided in the request. + # This can be the same as [TranslateDocumentResponse.document_translation] + # if no glossary terms apply. + # @!attribute [rw] model + # @return [::String] + # Only present when 'model' is present in the request. + # 'model' is normalized to have a project number. + # + # For example: + # If the 'model' field in TranslateDocumentRequest is: + # `projects/{project-id}/locations/{location-id}/models/general/nmt` then + # `model` here would be normalized to + # `projects/{project-number}/locations/{location-id}/models/general/nmt`. + # @!attribute [rw] glossary_config + # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] + # The `glossary_config` used for this translation. + class TranslateDocumentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The batch translation request. + # @!attribute [rw] parent + # @return [::String] + # Required. Location to make a call. Must refer to a caller's project. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # The `global` location is not supported for batch translation. + # + # Only AutoML Translation models or glossaries within the same region (have + # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + # error is returned. + # @!attribute [rw] source_language_code + # @return [::String] + # Required. Source language code. Supported language codes are listed in + # [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @!attribute [rw] target_language_codes + # @return [::Array<::String>] + # Required. Specify up to 10 language codes here. Supported language codes + # are listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @!attribute [rw] models + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The models to use for translation. Map's key is target language + # code. Map's value is model name. Value can be a built-in general model, + # or an AutoML Translation model. + # + # The value format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If the map is empty or a specific model is + # not requested for a language pair, then default google model (nmt) is used. + # @!attribute [rw] input_configs + # @return [::Array<::Google::Cloud::Translate::V3::InputConfig>] + # Required. Input configurations. + # The total number of files matched should be <= 100. + # The total content size should be <= 100M Unicode codepoints. + # The files must use UTF-8 encoding. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Translate::V3::OutputConfig] + # Required. Output configuration. + # If 2 input configs match to the same file (that is, same input path), + # we don't generate output for duplicate inputs. + # @!attribute [rw] glossaries + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig}] + # Optional. Glossaries to be applied for translation. + # It's keyed by target language code. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels with user-defined metadata for the request. + # + # Label keys and values can be no longer than 63 characters + # (Unicode codepoints), can only contain lowercase letters, numeric + # characters, underscores and dashes. International characters are allowed. + # Label values are optional. Label keys must start with a letter. + # + # See https://cloud.google.com/translate/docs/advanced/labels for more + # information. + class BatchTranslateTextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ModelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] + class GlossariesEntry + 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 + end + + # State metadata for the batch translation operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::BatchTranslateMetadata::State] + # The state of the operation. + # @!attribute [rw] translated_characters + # @return [::Integer] + # Number of successfully translated characters so far (Unicode codepoints). + # @!attribute [rw] failed_characters + # @return [::Integer] + # Number of characters that have failed to process so far (Unicode + # codepoints). + # @!attribute [rw] total_characters + # @return [::Integer] + # Total number of characters (Unicode codepoints). + # This is the total number of codepoints from input files times the number of + # target languages and appears here shortly after the call is submitted. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # Time when the operation was submitted. + class BatchTranslateMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the job. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is being processed. + RUNNING = 1 + + # The batch is processed, and at least one item was successfully + # processed. + SUCCEEDED = 2 + + # The batch is done and no item was successfully processed. + FAILED = 3 + + # Request is in the process of being canceled after caller invoked + # longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4 + + # The batch is done after the user has called the + # longrunning.Operations.CancelOperation. Any records processed before the + # cancel command are output as specified in the request. + CANCELLED = 5 + end + end + + # Stored in the + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # field returned by BatchTranslateText if at least one sentence is translated + # successfully. + # @!attribute [rw] total_characters + # @return [::Integer] + # Total number of characters (Unicode codepoints). + # @!attribute [rw] translated_characters + # @return [::Integer] + # Number of successfully translated characters (Unicode codepoints). + # @!attribute [rw] failed_characters + # @return [::Integer] + # Number of characters that have failed to process (Unicode codepoints). + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # Time when the operation was submitted. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to true. + class BatchTranslateResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input configuration for glossaries. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Translate::V3::GcsSource] + # Required. Google Cloud Storage location of glossary data. + # File format is determined based on the filename extension. API returns + # [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file + # formats. Wildcards are not allowed. This must be a single file in one of + # the following formats: + # + # For unidirectional glossaries: + # + # - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. + # The first column is source text. The second column is target text. + # No headers in this file. The first row contains data and not column + # names. + # + # - TMX (`.tmx`): TMX file with parallel data defining source/target term + # pairs. + # + # For equivalent term sets glossaries: + # + # - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms + # in multiple languages. See documentation for more information - + # [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). + class GlossaryInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a glossary built from user-provided data. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the glossary. Glossary names have the form + # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. + # @!attribute [rw] language_pair + # @return [::Google::Cloud::Translate::V3::Glossary::LanguageCodePair] + # Used with unidirectional glossaries. + # + # Note: The following fields are mutually exclusive: `language_pair`, `language_codes_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] language_codes_set + # @return [::Google::Cloud::Translate::V3::Glossary::LanguageCodesSet] + # Used with equivalent term set glossaries. + # + # Note: The following fields are mutually exclusive: `language_codes_set`, `language_pair`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Translate::V3::GlossaryInputConfig] + # Required. Provides examples to build the glossary from. + # Total glossary must not exceed 10M Unicode codepoints. + # @!attribute [r] entry_count + # @return [::Integer] + # Output only. The number of entries defined in the glossary. + # @!attribute [r] submit_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When CreateGlossary was called. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the glossary creation was finished. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The display name of the glossary. + class Glossary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Used with unidirectional glossaries. + # @!attribute [rw] source_language_code + # @return [::String] + # Required. The ISO-639 language code of the input text, for example, + # "en-US". Expected to be an exact match for GlossaryTerm.language_code. + # @!attribute [rw] target_language_code + # @return [::String] + # Required. The ISO-639 language code for translation output, for example, + # "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. + class LanguageCodePair + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Used with equivalent term set glossaries. + # @!attribute [rw] language_codes + # @return [::Array<::String>] + # The ISO-639 language code(s) for terms defined in the glossary. + # All entries are unique. The list contains at least two entries. + # Expected to be an exact match for GlossaryTerm.language_code. + class LanguageCodesSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for CreateGlossary. + # @!attribute [rw] parent + # @return [::String] + # Required. The project name. + # @!attribute [rw] glossary + # @return [::Google::Cloud::Translate::V3::Glossary] + # Required. The glossary to create. + class CreateGlossaryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the update glossary flow + # @!attribute [rw] glossary + # @return [::Google::Cloud::Translate::V3::Glossary] + # Required. The glossary entry to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. Currently only `display_name` and + # 'input_config' + class UpdateGlossaryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetGlossary. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the glossary to retrieve. + class GetGlossaryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteGlossary. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the glossary to delete. + class DeleteGlossaryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListGlossaries. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project from which to list all of the glossaries. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server may return fewer glossaries than + # requested. If unspecified, the server picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of [ListGlossariesResponse.next_page_token] + # returned from the previous call to `ListGlossaries` method. + # The first page is returned if `page_token`is empty or missing. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter specifying constraints of a list operation. + # Specify the constraint by the format of "key=value", where key must be + # "src" or "tgt", and the value must be a valid language code. + # For multiple restrictions, concatenate them by "AND" (uppercase only), + # such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used + # here, which means using 'en-US' and 'en' can lead to different results, + # which depends on the language code you used when you create the glossary. + # For the unidirectional glossaries, the "src" and "tgt" add restrictions + # on the source and target language code separately. + # For the equivalent term set glossaries, the "src" and/or "tgt" add + # restrictions on the term set. + # For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional + # glossaries which exactly match the source language code as "en-US" and the + # target language code "zh-CN", but all equivalent term set glossaries which + # contain "en-US" and "zh-CN" in their language set will be picked. + # If missing, no filtering is performed. + class ListGlossariesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListGlossaries. + # @!attribute [rw] glossaries + # @return [::Array<::Google::Cloud::Translate::V3::Glossary>] + # The list of glossaries for a project. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve a page of results. Pass this value in the + # [ListGlossariesRequest.page_token] field in the subsequent call to + # `ListGlossaries` method to retrieve the next page of results. + class ListGlossariesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the Get Glossary Entry Api + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the glossary entry to get + class GetGlossaryEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for Delete Glossary Entry + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the glossary entry to delete + class DeleteGlossaryEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListGlossaryEntries + # @!attribute [rw] parent + # @return [::String] + # Required. The parent glossary resource name for listing the glossary's + # entries. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. The server may return fewer glossary entries + # than requested. If unspecified, the server picks an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # Typically, this is the value of + # [ListGlossaryEntriesResponse.next_page_token] returned from the previous + # call. The first page is returned if `page_token`is empty or missing. + class ListGlossaryEntriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListGlossaryEntries + # @!attribute [rw] glossary_entries + # @return [::Array<::Google::Cloud::Translate::V3::GlossaryEntry>] + # Optional. The Glossary Entries + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token to retrieve a page of results. Pass this value in the + # [ListGLossaryEntriesRequest.page_token] field in the subsequent calls. + class ListGlossaryEntriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateGlossaryEntry + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the glossary to create the entry under. + # @!attribute [rw] glossary_entry + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # Required. The glossary entry to create + class CreateGlossaryEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateGlossaryEntry + # @!attribute [rw] glossary_entry + # @return [::Google::Cloud::Translate::V3::GlossaryEntry] + # Required. The glossary entry to update. + class UpdateGlossaryEntryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stored in the + # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata} + # field returned by CreateGlossary. + # @!attribute [rw] name + # @return [::String] + # The name of the glossary that is being created. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::CreateGlossaryMetadata::State] + # The current state of the glossary creation operation. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation was submitted to the server. + class CreateGlossaryMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumerates the possible states that the creation request can be in. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is being processed. + RUNNING = 1 + + # The glossary was successfully created. + SUCCEEDED = 2 + + # Failed to create the glossary. + FAILED = 3 + + # Request is in the process of being canceled after caller invoked + # longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4 + + # The glossary creation request was successfully canceled. + CANCELLED = 5 + end + end + + # Stored in the + # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata} + # field returned by UpdateGlossary. + # @!attribute [rw] glossary + # @return [::Google::Cloud::Translate::V3::Glossary] + # The updated glossary object. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::UpdateGlossaryMetadata::State] + # The current state of the glossary update operation. If the glossary input + # file was not updated this will be completed immediately + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation was submitted to the server. + class UpdateGlossaryMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumerates the possible states that the update request can be in. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is being processed. + RUNNING = 1 + + # The glossary was successfully updated. + SUCCEEDED = 2 + + # Failed to update the glossary. + FAILED = 3 + + # Request is in the process of being canceled after caller invoked + # longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4 + + # The glossary update request was successfully canceled. + CANCELLED = 5 + end + end + + # Stored in the + # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata} + # field returned by DeleteGlossary. + # @!attribute [rw] name + # @return [::String] + # The name of the glossary that is being deleted. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::DeleteGlossaryMetadata::State] + # The current state of the glossary deletion operation. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation was submitted to the server. + class DeleteGlossaryMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumerates the possible states that the creation request can be in. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is being processed. + RUNNING = 1 + + # The glossary was successfully deleted. + SUCCEEDED = 2 + + # Failed to delete the glossary. + FAILED = 3 + + # Request is in the process of being canceled after caller invoked + # longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4 + + # The glossary deletion request was successfully canceled. + CANCELLED = 5 + end + end + + # Stored in the + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # field returned by DeleteGlossary. + # @!attribute [rw] name + # @return [::String] + # The name of the deleted glossary. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation was submitted to the server. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the glossary deletion is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to true. + class DeleteGlossaryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The BatchTranslateDocument request. + # @!attribute [rw] parent + # @return [::String] + # Required. Location to make a regional call. + # + # Format: `projects/{project-number-or-id}/locations/{location-id}`. + # + # The `global` location is not supported for batch translation. + # + # Only AutoML Translation models or glossaries within the same region (have + # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) + # error is returned. + # @!attribute [rw] source_language_code + # @return [::String] + # Required. The ISO-639 language code of the input document if known, for + # example, "en-US" or "sr-Latn". Supported language codes are listed in + # [Language Support](https://cloud.google.com/translate/docs/languages). + # @!attribute [rw] target_language_codes + # @return [::Array<::String>] + # Required. The ISO-639 language code to use for translation of the input + # document. Specify up to 10 language codes here. Supported language codes + # are listed in [Language + # Support](https://cloud.google.com/translate/docs/languages). + # @!attribute [rw] input_configs + # @return [::Array<::Google::Cloud::Translate::V3::BatchDocumentInputConfig>] + # Required. Input configurations. + # The total number of files matched should be <= 100. + # The total content size to translate should be <= 100M Unicode codepoints. + # The files must use UTF-8 encoding. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Translate::V3::BatchDocumentOutputConfig] + # Required. Output configuration. + # If 2 input configs match to the same file (that is, same input path), + # we don't generate output for duplicate inputs. + # @!attribute [rw] models + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The models to use for translation. Map's key is target language + # code. Map's value is the model name. Value can be a built-in general model, + # or an AutoML Translation model. + # + # The value format depends on model type: + # + # - AutoML Translation models: + # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` + # + # - General (built-in) models: + # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, + # + # + # If the map is empty or a specific model is + # not requested for a language pair, then default google model (nmt) is used. + # @!attribute [rw] glossaries + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig}] + # Optional. Glossaries to be applied. It's keyed by target language code. + # @!attribute [rw] format_conversions + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The file format conversion map that is applied to all input + # files. The map key is the original mime_type. The map value is the target + # mime_type of translated documents. + # + # Supported file format conversion includes: + # - `application/pdf` to + # `application/vnd.openxmlformats-officedocument.wordprocessingml.document` + # + # If nothing specified, output files will be in the same format as the + # original file. + # @!attribute [rw] customized_attribution + # @return [::String] + # Optional. This flag is to support user customized attribution. + # If not provided, the default is `Machine Translated by Google`. + # Customized attribution should follow rules in + # https://cloud.google.com/translate/attribution#attribution_and_logos + # @!attribute [rw] enable_shadow_removal_native_pdf + # @return [::Boolean] + # Optional. If true, use the text removal server to remove the shadow text on + # background image for native pdf translation. + # Shadow removal feature can only be enabled when + # is_translate_native_pdf_only: false && pdf_native_only: false + # @!attribute [rw] enable_rotation_correction + # @return [::Boolean] + # Optional. If true, enable auto rotation correction in DVS. + class BatchTranslateDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ModelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] + class GlossariesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class FormatConversionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Input configuration for BatchTranslateDocument request. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Translate::V3::GcsSource] + # Google Cloud Storage location for the source input. + # This can be a single file (for example, + # `gs://translation-test/input.docx`) or a wildcard (for example, + # `gs://translation-test/*`). + # + # File mime type is determined based on extension. Supported mime type + # includes: + # - `pdf`, application/pdf + # - `docx`, + # application/vnd.openxmlformats-officedocument.wordprocessingml.document + # - `pptx`, + # application/vnd.openxmlformats-officedocument.presentationml.presentation + # - `xlsx`, + # application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + # + # The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. + # The max file size to support for `.pdf` is 1GB and the max page limit is + # 1000 pages. + # The max file size to support for all input documents is 1GB. + class BatchDocumentInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Output configuration for BatchTranslateDocument request. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Translate::V3::GcsDestination] + # Google Cloud Storage destination for output content. + # For every single input document (for example, gs://a/b/c.[extension]), we + # generate at most 2 * n output files. (n is the # of target_language_codes + # in the BatchTranslateDocumentRequest). + # + # While the input documents are being processed, we write/update an index + # file `index.csv` under `gcs_destination.output_uri_prefix` (for example, + # gs://translation_output/index.csv) The index file is generated/updated as + # new files are being translated. The format is: + # + # input_document,target_language_code,translation_output,error_output, + # glossary_translation_output,glossary_error_output + # + # `input_document` is one file we matched using gcs_source.input_uri. + # `target_language_code` is provided in the request. + # `translation_output` contains the translations. (details provided below) + # `error_output` contains the error message during processing of the file. + # Both translations_file and errors_file could be empty strings if we have + # no content to output. + # `glossary_translation_output` and `glossary_error_output` are the + # translated output/error when we apply glossaries. They could also be + # empty if we have no content to output. + # + # Once a row is present in index.csv, the input/output matching never + # changes. Callers should also expect all the content in input_file are + # processed and ready to be consumed (that is, no partial output file is + # written). + # + # Since index.csv will be keeping updated during the process, please make + # sure there is no custom retention policy applied on the output bucket + # that may avoid file updating. + # (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) + # + # The naming format of translation output files follows (for target + # language code [trg]): `translation_output`: + # `gs://translation_output/a_b_c_[trg]_translation.[extension]` + # `glossary_translation_output`: + # `gs://translation_test/a_b_c_[trg]_glossary_translation.[extension]`. The + # output document will maintain the same file format as the input document. + # + # The naming format of error output files follows (for target language code + # [trg]): `error_output`: `gs://translation_test/a_b_c_[trg]_errors.txt` + # `glossary_error_output`: + # `gs://translation_test/a_b_c_[trg]_glossary_translation.txt`. The error + # output is a txt file containing error details. + class BatchDocumentOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stored in the + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # field returned by BatchTranslateDocument if at least one document is + # translated successfully. + # @!attribute [rw] total_pages + # @return [::Integer] + # Total number of pages to translate in all documents. Documents without + # clear page definition (such as XLSX) are not counted. + # @!attribute [rw] translated_pages + # @return [::Integer] + # Number of successfully translated pages in all documents. Documents without + # clear page definition (such as XLSX) are not counted. + # @!attribute [rw] failed_pages + # @return [::Integer] + # Number of pages that failed to process in all documents. Documents without + # clear page definition (such as XLSX) are not counted. + # @!attribute [rw] total_billable_pages + # @return [::Integer] + # Number of billable pages in documents with clear page definition (such as + # PDF, DOCX, PPTX) + # @!attribute [rw] total_characters + # @return [::Integer] + # Total number of characters (Unicode codepoints) in all documents. + # @!attribute [rw] translated_characters + # @return [::Integer] + # Number of successfully translated characters (Unicode codepoints) in all + # documents. + # @!attribute [rw] failed_characters + # @return [::Integer] + # Number of characters that have failed to process (Unicode codepoints) in + # all documents. + # @!attribute [rw] total_billable_characters + # @return [::Integer] + # Number of billable characters (Unicode codepoints) in documents without + # clear page definition, such as XLSX. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # Time when the operation was submitted. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to true. + class BatchTranslateDocumentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # State metadata for the batch translation operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Translate::V3::BatchTranslateDocumentMetadata::State] + # The state of the operation. + # @!attribute [rw] total_pages + # @return [::Integer] + # Total number of pages to translate in all documents so far. Documents + # without clear page definition (such as XLSX) are not counted. + # @!attribute [rw] translated_pages + # @return [::Integer] + # Number of successfully translated pages in all documents so far. Documents + # without clear page definition (such as XLSX) are not counted. + # @!attribute [rw] failed_pages + # @return [::Integer] + # Number of pages that failed to process in all documents so far. Documents + # without clear page definition (such as XLSX) are not counted. + # @!attribute [rw] total_billable_pages + # @return [::Integer] + # Number of billable pages in documents with clear page definition (such as + # PDF, DOCX, PPTX) so far. + # @!attribute [rw] total_characters + # @return [::Integer] + # Total number of characters (Unicode codepoints) in all documents so far. + # @!attribute [rw] translated_characters + # @return [::Integer] + # Number of successfully translated characters (Unicode codepoints) in all + # documents so far. + # @!attribute [rw] failed_characters + # @return [::Integer] + # Number of characters that have failed to process (Unicode codepoints) in + # all documents so far. + # @!attribute [rw] total_billable_characters + # @return [::Integer] + # Number of billable characters (Unicode codepoints) in documents without + # clear page definition (such as XLSX) so far. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # Time when the operation was submitted. + class BatchTranslateDocumentMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the job. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is being processed. + RUNNING = 1 + + # The batch is processed, and at least one item was successfully processed. + SUCCEEDED = 2 + + # The batch is done and no item was successfully processed. + FAILED = 3 + + # Request is in the process of being canceled after caller invoked + # longrunning.Operations.CancelOperation on the request id. + CANCELLING = 4 + + # The batch is done after the user has called the + # longrunning.Operations.CancelOperation. Any records processed before the + # cancel command are output as specified in the request. + CANCELLED = 5 + end + end + + # Configures which glossary is used for a specific target language and defines + # options for applying that glossary. + # @!attribute [rw] glossary + # @return [::String] + # Required. The `glossary` to be applied for this translation. + # + # The format depends on the glossary: + # + # - User-provided custom glossary: + # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` + # @!attribute [rw] ignore_case + # @return [::Boolean] + # Optional. Indicates match is case insensitive. The default value is `false` + # if missing. + # @!attribute [rw] contextual_translation_enabled + # @return [::Boolean] + # Optional. If set to true, the glossary will be used for contextual + # translation. + class TranslateTextGlossaryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-translate-v3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/snippets/Gemfile b/owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile new file mode 100644 index 000000000000..bdff294d3cff --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3", path: "../" +else + gem "google-cloud-translate-v3" +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-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json b/owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json new file mode 100644 index 000000000000..c234e2a00fb6 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json @@ -0,0 +1,1535 @@ +{ + "client_library": { + "name": "google-cloud-translate-v3", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.translation.v3", + "version": "v3" + } + ] + }, + "snippets": [ + { + "region_tag": "translate_v3_generated_TranslationService_TranslateText_sync", + "title": "Snippet for the translate_text call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#translate_text.", + "file": "translation_service/translate_text.rb", + "language": "RUBY", + "client_method": { + "short_name": "translate_text", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#translate_text", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::TranslateTextRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::TranslateTextResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "TranslateText", + "full_name": "google.cloud.translation.v3.TranslationService.TranslateText", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_RomanizeText_sync", + "title": "Snippet for the romanize_text call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#romanize_text.", + "file": "translation_service/romanize_text.rb", + "language": "RUBY", + "client_method": { + "short_name": "romanize_text", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#romanize_text", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::RomanizeTextRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::RomanizeTextResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "RomanizeText", + "full_name": "google.cloud.translation.v3.TranslationService.RomanizeText", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_DetectLanguage_sync", + "title": "Snippet for the detect_language call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#detect_language.", + "file": "translation_service/detect_language.rb", + "language": "RUBY", + "client_method": { + "short_name": "detect_language", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#detect_language", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::DetectLanguageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::DetectLanguageResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "DetectLanguage", + "full_name": "google.cloud.translation.v3.TranslationService.DetectLanguage", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_GetSupportedLanguages_sync", + "title": "Snippet for the get_supported_languages call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_supported_languages.", + "file": "translation_service/get_supported_languages.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_supported_languages", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_supported_languages", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::SupportedLanguages", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "GetSupportedLanguages", + "full_name": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_TranslateDocument_sync", + "title": "Snippet for the translate_document call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#translate_document.", + "file": "translation_service/translate_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "translate_document", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#translate_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::TranslateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::TranslateDocumentResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "TranslateDocument", + "full_name": "google.cloud.translation.v3.TranslationService.TranslateDocument", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_BatchTranslateText_sync", + "title": "Snippet for the batch_translate_text call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_text.", + "file": "translation_service/batch_translate_text.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_translate_text", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_text", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::BatchTranslateTextRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "BatchTranslateText", + "full_name": "google.cloud.translation.v3.TranslationService.BatchTranslateText", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_BatchTranslateDocument_sync", + "title": "Snippet for the batch_translate_document call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_document.", + "file": "translation_service/batch_translate_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_translate_document", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "BatchTranslateDocument", + "full_name": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_CreateGlossary_sync", + "title": "Snippet for the create_glossary call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_glossary.", + "file": "translation_service/create_glossary.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_glossary", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_glossary", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::CreateGlossaryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "CreateGlossary", + "full_name": "google.cloud.translation.v3.TranslationService.CreateGlossary", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_UpdateGlossary_sync", + "title": "Snippet for the update_glossary call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#update_glossary.", + "file": "translation_service/update_glossary.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_glossary", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#update_glossary", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::UpdateGlossaryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "UpdateGlossary", + "full_name": "google.cloud.translation.v3.TranslationService.UpdateGlossary", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListGlossaries_sync", + "title": "Snippet for the list_glossaries call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_glossaries.", + "file": "translation_service/list_glossaries.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_glossaries", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_glossaries", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListGlossariesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListGlossariesResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListGlossaries", + "full_name": "google.cloud.translation.v3.TranslationService.ListGlossaries", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_GetGlossary_sync", + "title": "Snippet for the get_glossary call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_glossary.", + "file": "translation_service/get_glossary.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_glossary", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_glossary", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::GetGlossaryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::Glossary", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "GetGlossary", + "full_name": "google.cloud.translation.v3.TranslationService.GetGlossary", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_DeleteGlossary_sync", + "title": "Snippet for the delete_glossary call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary.", + "file": "translation_service/delete_glossary.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_glossary", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::DeleteGlossaryRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "DeleteGlossary", + "full_name": "google.cloud.translation.v3.TranslationService.DeleteGlossary", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_GetGlossaryEntry_sync", + "title": "Snippet for the get_glossary_entry call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_glossary_entry.", + "file": "translation_service/get_glossary_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_glossary_entry", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_glossary_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::GetGlossaryEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::GlossaryEntry", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "GetGlossaryEntry", + "full_name": "google.cloud.translation.v3.TranslationService.GetGlossaryEntry", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListGlossaryEntries_sync", + "title": "Snippet for the list_glossary_entries call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_glossary_entries.", + "file": "translation_service/list_glossary_entries.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_glossary_entries", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_glossary_entries", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListGlossaryEntries", + "full_name": "google.cloud.translation.v3.TranslationService.ListGlossaryEntries", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_CreateGlossaryEntry_sync", + "title": "Snippet for the create_glossary_entry call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_glossary_entry.", + "file": "translation_service/create_glossary_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_glossary_entry", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_glossary_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::GlossaryEntry", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "CreateGlossaryEntry", + "full_name": "google.cloud.translation.v3.TranslationService.CreateGlossaryEntry", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_UpdateGlossaryEntry_sync", + "title": "Snippet for the update_glossary_entry call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#update_glossary_entry.", + "file": "translation_service/update_glossary_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_glossary_entry", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#update_glossary_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::GlossaryEntry", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "UpdateGlossaryEntry", + "full_name": "google.cloud.translation.v3.TranslationService.UpdateGlossaryEntry", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_DeleteGlossaryEntry_sync", + "title": "Snippet for the delete_glossary_entry call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary_entry.", + "file": "translation_service/delete_glossary_entry.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_glossary_entry", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary_entry", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "DeleteGlossaryEntry", + "full_name": "google.cloud.translation.v3.TranslationService.DeleteGlossaryEntry", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_CreateDataset_sync", + "title": "Snippet for the create_dataset call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_dataset.", + "file": "translation_service/create_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_dataset", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::CreateDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "CreateDataset", + "full_name": "google.cloud.translation.v3.TranslationService.CreateDataset", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_GetDataset_sync", + "title": "Snippet for the get_dataset call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_dataset.", + "file": "translation_service/get_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dataset", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::GetDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::Dataset", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "GetDataset", + "full_name": "google.cloud.translation.v3.TranslationService.GetDataset", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListDatasets_sync", + "title": "Snippet for the list_datasets call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_datasets.", + "file": "translation_service/list_datasets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_datasets", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_datasets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListDatasetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListDatasetsResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListDatasets", + "full_name": "google.cloud.translation.v3.TranslationService.ListDatasets", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_DeleteDataset_sync", + "title": "Snippet for the delete_dataset call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_dataset.", + "file": "translation_service/delete_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_dataset", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::DeleteDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "DeleteDataset", + "full_name": "google.cloud.translation.v3.TranslationService.DeleteDataset", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_CreateAdaptiveMtDataset_sync", + "title": "Snippet for the create_adaptive_mt_dataset call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_adaptive_mt_dataset.", + "file": "translation_service/create_adaptive_mt_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_adaptive_mt_dataset", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_adaptive_mt_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtDataset", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "CreateAdaptiveMtDataset", + "full_name": "google.cloud.translation.v3.TranslationService.CreateAdaptiveMtDataset", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_DeleteAdaptiveMtDataset_sync", + "title": "Snippet for the delete_adaptive_mt_dataset call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_dataset.", + "file": "translation_service/delete_adaptive_mt_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_adaptive_mt_dataset", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "DeleteAdaptiveMtDataset", + "full_name": "google.cloud.translation.v3.TranslationService.DeleteAdaptiveMtDataset", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_GetAdaptiveMtDataset_sync", + "title": "Snippet for the get_adaptive_mt_dataset call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_dataset.", + "file": "translation_service/get_adaptive_mt_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_adaptive_mt_dataset", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtDataset", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "GetAdaptiveMtDataset", + "full_name": "google.cloud.translation.v3.TranslationService.GetAdaptiveMtDataset", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListAdaptiveMtDatasets_sync", + "title": "Snippet for the list_adaptive_mt_datasets call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_datasets.", + "file": "translation_service/list_adaptive_mt_datasets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_adaptive_mt_datasets", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_datasets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListAdaptiveMtDatasets", + "full_name": "google.cloud.translation.v3.TranslationService.ListAdaptiveMtDatasets", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_AdaptiveMtTranslate_sync", + "title": "Snippet for the adaptive_mt_translate call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#adaptive_mt_translate.", + "file": "translation_service/adaptive_mt_translate.rb", + "language": "RUBY", + "client_method": { + "short_name": "adaptive_mt_translate", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#adaptive_mt_translate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "AdaptiveMtTranslate", + "full_name": "google.cloud.translation.v3.TranslationService.AdaptiveMtTranslate", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_GetAdaptiveMtFile_sync", + "title": "Snippet for the get_adaptive_mt_file call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_file.", + "file": "translation_service/get_adaptive_mt_file.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_adaptive_mt_file", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_file", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtFile", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "GetAdaptiveMtFile", + "full_name": "google.cloud.translation.v3.TranslationService.GetAdaptiveMtFile", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_DeleteAdaptiveMtFile_sync", + "title": "Snippet for the delete_adaptive_mt_file call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_file.", + "file": "translation_service/delete_adaptive_mt_file.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_adaptive_mt_file", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_file", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "DeleteAdaptiveMtFile", + "full_name": "google.cloud.translation.v3.TranslationService.DeleteAdaptiveMtFile", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ImportAdaptiveMtFile_sync", + "title": "Snippet for the import_adaptive_mt_file call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#import_adaptive_mt_file.", + "file": "translation_service/import_adaptive_mt_file.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_adaptive_mt_file", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#import_adaptive_mt_file", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ImportAdaptiveMtFile", + "full_name": "google.cloud.translation.v3.TranslationService.ImportAdaptiveMtFile", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListAdaptiveMtFiles_sync", + "title": "Snippet for the list_adaptive_mt_files call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_files.", + "file": "translation_service/list_adaptive_mt_files.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_adaptive_mt_files", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_files", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListAdaptiveMtFiles", + "full_name": "google.cloud.translation.v3.TranslationService.ListAdaptiveMtFiles", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListAdaptiveMtSentences_sync", + "title": "Snippet for the list_adaptive_mt_sentences call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_sentences.", + "file": "translation_service/list_adaptive_mt_sentences.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_adaptive_mt_sentences", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_sentences", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListAdaptiveMtSentences", + "full_name": "google.cloud.translation.v3.TranslationService.ListAdaptiveMtSentences", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ImportData_sync", + "title": "Snippet for the import_data call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#import_data.", + "file": "translation_service/import_data.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_data", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#import_data", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ImportDataRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ImportData", + "full_name": "google.cloud.translation.v3.TranslationService.ImportData", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ExportData_sync", + "title": "Snippet for the export_data call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#export_data.", + "file": "translation_service/export_data.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_data", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#export_data", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ExportDataRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ExportData", + "full_name": "google.cloud.translation.v3.TranslationService.ExportData", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListExamples_sync", + "title": "Snippet for the list_examples call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_examples.", + "file": "translation_service/list_examples.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_examples", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_examples", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListExamplesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListExamplesResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListExamples", + "full_name": "google.cloud.translation.v3.TranslationService.ListExamples", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_CreateModel_sync", + "title": "Snippet for the create_model call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_model.", + "file": "translation_service/create_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_model", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::CreateModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "CreateModel", + "full_name": "google.cloud.translation.v3.TranslationService.CreateModel", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_ListModels_sync", + "title": "Snippet for the list_models call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_models.", + "file": "translation_service/list_models.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_models", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_models", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::ListModelsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::ListModelsResponse", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "ListModels", + "full_name": "google.cloud.translation.v3.TranslationService.ListModels", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_GetModel_sync", + "title": "Snippet for the get_model call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_model.", + "file": "translation_service/get_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_model", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::GetModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Translate::V3::Model", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "GetModel", + "full_name": "google.cloud.translation.v3.TranslationService.GetModel", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "translate_v3_generated_TranslationService_DeleteModel_sync", + "title": "Snippet for the delete_model call in the TranslationService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_model.", + "file": "translation_service/delete_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_model", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Translate::V3::DeleteModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "TranslationService::Client", + "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" + }, + "method": { + "short_name": "DeleteModel", + "full_name": "google.cloud.translation.v3.TranslationService.DeleteModel", + "service": { + "short_name": "TranslationService", + "full_name": "google.cloud.translation.v3.TranslationService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb new file mode 100644 index 000000000000..aa4ad9228411 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_AdaptiveMtTranslate_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the adaptive_mt_translate call in the TranslationService 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::Translate::V3::TranslationService::Client#adaptive_mt_translate. +# +def adaptive_mt_translate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new + + # Call the adaptive_mt_translate method. + result = client.adaptive_mt_translate request + + # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse. + p result +end +# [END translate_v3_generated_TranslationService_AdaptiveMtTranslate_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb new file mode 100644 index 000000000000..25d0fe3a2789 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_BatchTranslateDocument_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the batch_translate_document call in the TranslationService 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::Translate::V3::TranslationService::Client#batch_translate_document. +# +def batch_translate_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new + + # Call the batch_translate_document method. + result = client.batch_translate_document 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 translate_v3_generated_TranslationService_BatchTranslateDocument_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb new file mode 100644 index 000000000000..1ed61588014c --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_BatchTranslateText_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the batch_translate_text call in the TranslationService 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::Translate::V3::TranslationService::Client#batch_translate_text. +# +def batch_translate_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new + + # Call the batch_translate_text method. + result = client.batch_translate_text 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 translate_v3_generated_TranslationService_BatchTranslateText_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb new file mode 100644 index 000000000000..a7e3243384ec --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateAdaptiveMtDataset_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the create_adaptive_mt_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#create_adaptive_mt_dataset. +# +def create_adaptive_mt_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new + + # Call the create_adaptive_mt_dataset method. + result = client.create_adaptive_mt_dataset request + + # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. + p result +end +# [END translate_v3_generated_TranslationService_CreateAdaptiveMtDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb new file mode 100644 index 000000000000..0ae3a139cb62 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateDataset_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the create_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#create_dataset. +# +def create_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::CreateDatasetRequest.new + + # Call the create_dataset method. + result = client.create_dataset 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 translate_v3_generated_TranslationService_CreateDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb new file mode 100644 index 000000000000..3ecab7c93861 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateGlossary_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the create_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#create_glossary. +# +def create_glossary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new + + # Call the create_glossary method. + result = client.create_glossary 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 translate_v3_generated_TranslationService_CreateGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb new file mode 100644 index 000000000000..9f644113a2e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateGlossaryEntry_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the create_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#create_glossary_entry. +# +def create_glossary_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new + + # Call the create_glossary_entry method. + result = client.create_glossary_entry request + + # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + p result +end +# [END translate_v3_generated_TranslationService_CreateGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb new file mode 100644 index 000000000000..f13607493059 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateModel_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the create_model call in the TranslationService 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::Translate::V3::TranslationService::Client#create_model. +# +def create_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::CreateModelRequest.new + + # Call the create_model method. + result = client.create_model 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 translate_v3_generated_TranslationService_CreateModel_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb new file mode 100644 index 000000000000..f9f940bb5044 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteAdaptiveMtDataset_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the delete_adaptive_mt_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_adaptive_mt_dataset. +# +def delete_adaptive_mt_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new + + # Call the delete_adaptive_mt_dataset method. + result = client.delete_adaptive_mt_dataset request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END translate_v3_generated_TranslationService_DeleteAdaptiveMtDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb new file mode 100644 index 000000000000..469a91f67799 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteAdaptiveMtFile_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the delete_adaptive_mt_file call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_adaptive_mt_file. +# +def delete_adaptive_mt_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new + + # Call the delete_adaptive_mt_file method. + result = client.delete_adaptive_mt_file request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END translate_v3_generated_TranslationService_DeleteAdaptiveMtFile_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb new file mode 100644 index 000000000000..36188a743141 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteDataset_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the delete_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_dataset. +# +def delete_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DeleteDatasetRequest.new + + # Call the delete_dataset method. + result = client.delete_dataset 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 translate_v3_generated_TranslationService_DeleteDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb new file mode 100644 index 000000000000..0d5258e5b7f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteGlossary_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the delete_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_glossary. +# +def delete_glossary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new + + # Call the delete_glossary method. + result = client.delete_glossary 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 translate_v3_generated_TranslationService_DeleteGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb new file mode 100644 index 000000000000..f9a3a195e7df --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteGlossaryEntry_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the delete_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_glossary_entry. +# +def delete_glossary_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new + + # Call the delete_glossary_entry method. + result = client.delete_glossary_entry request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END translate_v3_generated_TranslationService_DeleteGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb new file mode 100644 index 000000000000..f97403f97994 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteModel_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the delete_model call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_model. +# +def delete_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DeleteModelRequest.new + + # Call the delete_model method. + result = client.delete_model 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 translate_v3_generated_TranslationService_DeleteModel_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb new file mode 100644 index 000000000000..55ecd2e01e60 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DetectLanguage_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the detect_language call in the TranslationService 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::Translate::V3::TranslationService::Client#detect_language. +# +def detect_language + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DetectLanguageRequest.new + + # Call the detect_language method. + result = client.detect_language request + + # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. + p result +end +# [END translate_v3_generated_TranslationService_DetectLanguage_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb new file mode 100644 index 000000000000..67e09245adad --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ExportData_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the export_data call in the TranslationService 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::Translate::V3::TranslationService::Client#export_data. +# +def export_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ExportDataRequest.new + + # Call the export_data method. + result = client.export_data 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 translate_v3_generated_TranslationService_ExportData_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb new file mode 100644 index 000000000000..ba4e677c2358 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetAdaptiveMtDataset_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the get_adaptive_mt_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#get_adaptive_mt_dataset. +# +def get_adaptive_mt_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new + + # Call the get_adaptive_mt_dataset method. + result = client.get_adaptive_mt_dataset request + + # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. + p result +end +# [END translate_v3_generated_TranslationService_GetAdaptiveMtDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb new file mode 100644 index 000000000000..0e7ebc6cc6ec --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetAdaptiveMtFile_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the get_adaptive_mt_file call in the TranslationService 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::Translate::V3::TranslationService::Client#get_adaptive_mt_file. +# +def get_adaptive_mt_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new + + # Call the get_adaptive_mt_file method. + result = client.get_adaptive_mt_file request + + # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtFile. + p result +end +# [END translate_v3_generated_TranslationService_GetAdaptiveMtFile_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb new file mode 100644 index 000000000000..3c560b5a9f1f --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetDataset_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the get_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#get_dataset. +# +def get_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetDatasetRequest.new + + # Call the get_dataset method. + result = client.get_dataset request + + # The returned object is of type Google::Cloud::Translate::V3::Dataset. + p result +end +# [END translate_v3_generated_TranslationService_GetDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb new file mode 100644 index 000000000000..b4d2ade127f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetGlossary_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the get_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#get_glossary. +# +def get_glossary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetGlossaryRequest.new + + # Call the get_glossary method. + result = client.get_glossary request + + # The returned object is of type Google::Cloud::Translate::V3::Glossary. + p result +end +# [END translate_v3_generated_TranslationService_GetGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb new file mode 100644 index 000000000000..422026b30132 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetGlossaryEntry_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the get_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#get_glossary_entry. +# +def get_glossary_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new + + # Call the get_glossary_entry method. + result = client.get_glossary_entry request + + # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + p result +end +# [END translate_v3_generated_TranslationService_GetGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb new file mode 100644 index 000000000000..c7ddbabd9b88 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetModel_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the get_model call in the TranslationService 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::Translate::V3::TranslationService::Client#get_model. +# +def get_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetModelRequest.new + + # Call the get_model method. + result = client.get_model request + + # The returned object is of type Google::Cloud::Translate::V3::Model. + p result +end +# [END translate_v3_generated_TranslationService_GetModel_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb new file mode 100644 index 000000000000..3ee79de1a1de --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetSupportedLanguages_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the get_supported_languages call in the TranslationService 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::Translate::V3::TranslationService::Client#get_supported_languages. +# +def get_supported_languages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new + + # Call the get_supported_languages method. + result = client.get_supported_languages request + + # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. + p result +end +# [END translate_v3_generated_TranslationService_GetSupportedLanguages_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb new file mode 100644 index 000000000000..e44c710d2853 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ImportAdaptiveMtFile_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the import_adaptive_mt_file call in the TranslationService 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::Translate::V3::TranslationService::Client#import_adaptive_mt_file. +# +def import_adaptive_mt_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new + + # Call the import_adaptive_mt_file method. + result = client.import_adaptive_mt_file request + + # The returned object is of type Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse. + p result +end +# [END translate_v3_generated_TranslationService_ImportAdaptiveMtFile_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb new file mode 100644 index 000000000000..5b13e7a3f486 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ImportData_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the import_data call in the TranslationService 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::Translate::V3::TranslationService::Client#import_data. +# +def import_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ImportDataRequest.new + + # Call the import_data method. + result = client.import_data 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 translate_v3_generated_TranslationService_ImportData_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb new file mode 100644 index 000000000000..177ce32c2628 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListAdaptiveMtDatasets_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_adaptive_mt_datasets call in the TranslationService 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::Translate::V3::TranslationService::Client#list_adaptive_mt_datasets. +# +def list_adaptive_mt_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.new + + # Call the list_adaptive_mt_datasets method. + result = client.list_adaptive_mt_datasets 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::Translate::V3::AdaptiveMtDataset. + p item + end +end +# [END translate_v3_generated_TranslationService_ListAdaptiveMtDatasets_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb new file mode 100644 index 000000000000..29e1435d5606 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListAdaptiveMtFiles_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_adaptive_mt_files call in the TranslationService 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::Translate::V3::TranslationService::Client#list_adaptive_mt_files. +# +def list_adaptive_mt_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.new + + # Call the list_adaptive_mt_files method. + result = client.list_adaptive_mt_files 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::Translate::V3::AdaptiveMtFile. + p item + end +end +# [END translate_v3_generated_TranslationService_ListAdaptiveMtFiles_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb new file mode 100644 index 000000000000..eac68d950a17 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListAdaptiveMtSentences_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_adaptive_mt_sentences call in the TranslationService 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::Translate::V3::TranslationService::Client#list_adaptive_mt_sentences. +# +def list_adaptive_mt_sentences + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.new + + # Call the list_adaptive_mt_sentences method. + result = client.list_adaptive_mt_sentences 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::Translate::V3::AdaptiveMtSentence. + p item + end +end +# [END translate_v3_generated_TranslationService_ListAdaptiveMtSentences_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb new file mode 100644 index 000000000000..5e51cd9506fe --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListDatasets_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_datasets call in the TranslationService 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::Translate::V3::TranslationService::Client#list_datasets. +# +def list_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListDatasetsRequest.new + + # Call the list_datasets method. + result = client.list_datasets 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::Translate::V3::Dataset. + p item + end +end +# [END translate_v3_generated_TranslationService_ListDatasets_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb new file mode 100644 index 000000000000..43332205b3b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListExamples_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_examples call in the TranslationService 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::Translate::V3::TranslationService::Client#list_examples. +# +def list_examples + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListExamplesRequest.new + + # Call the list_examples method. + result = client.list_examples 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::Translate::V3::Example. + p item + end +end +# [END translate_v3_generated_TranslationService_ListExamples_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb new file mode 100644 index 000000000000..74b3307718fb --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListGlossaries_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_glossaries call in the TranslationService 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::Translate::V3::TranslationService::Client#list_glossaries. +# +def list_glossaries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListGlossariesRequest.new + + # Call the list_glossaries method. + result = client.list_glossaries 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::Translate::V3::Glossary. + p item + end +end +# [END translate_v3_generated_TranslationService_ListGlossaries_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb new file mode 100644 index 000000000000..f79260b875bb --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListGlossaryEntries_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_glossary_entries call in the TranslationService 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::Translate::V3::TranslationService::Client#list_glossary_entries. +# +def list_glossary_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.new + + # Call the list_glossary_entries method. + result = client.list_glossary_entries 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::Translate::V3::GlossaryEntry. + p item + end +end +# [END translate_v3_generated_TranslationService_ListGlossaryEntries_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb new file mode 100644 index 000000000000..50a7a989b9ac --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListModels_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the list_models call in the TranslationService 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::Translate::V3::TranslationService::Client#list_models. +# +def list_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListModelsRequest.new + + # Call the list_models method. + result = client.list_models 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::Translate::V3::Model. + p item + end +end +# [END translate_v3_generated_TranslationService_ListModels_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb new file mode 100644 index 000000000000..83a2d907ca73 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_RomanizeText_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the romanize_text call in the TranslationService 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::Translate::V3::TranslationService::Client#romanize_text. +# +def romanize_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::RomanizeTextRequest.new + + # Call the romanize_text method. + result = client.romanize_text request + + # The returned object is of type Google::Cloud::Translate::V3::RomanizeTextResponse. + p result +end +# [END translate_v3_generated_TranslationService_RomanizeText_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb new file mode 100644 index 000000000000..bb4283c41aa1 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_TranslateDocument_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the translate_document call in the TranslationService 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::Translate::V3::TranslationService::Client#translate_document. +# +def translate_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new + + # Call the translate_document method. + result = client.translate_document request + + # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. + p result +end +# [END translate_v3_generated_TranslationService_TranslateDocument_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb new file mode 100644 index 000000000000..78c5e7b91c60 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_TranslateText_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the translate_text call in the TranslationService 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::Translate::V3::TranslationService::Client#translate_text. +# +def translate_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::TranslateTextRequest.new + + # Call the translate_text method. + result = client.translate_text request + + # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. + p result +end +# [END translate_v3_generated_TranslationService_TranslateText_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb new file mode 100644 index 000000000000..fd1baaf19c5a --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_UpdateGlossary_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the update_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#update_glossary. +# +def update_glossary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::UpdateGlossaryRequest.new + + # Call the update_glossary method. + result = client.update_glossary 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 translate_v3_generated_TranslationService_UpdateGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb new file mode 100644 index 000000000000..8ba803b74149 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_UpdateGlossaryEntry_sync] +require "google/cloud/translate/v3" + +## +# Snippet for the update_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#update_glossary_entry. +# +def update_glossary_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new + + # Call the update_glossary_entry method. + result = client.update_glossary_entry request + + # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. + p result +end +# [END translate_v3_generated_TranslationService_UpdateGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb new file mode 100644 index 000000000000..6095a4a5cd3c --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" +require "google/cloud/translate/v3/translation_service_services_pb" +require "google/cloud/translate/v3/translation_service" + +class ::Google::Cloud::Translate::V3::TranslationService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb new file mode 100644 index 000000000000..9f8a19eacf25 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service" + +class ::Google::Cloud::Translate::V3::TranslationService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_adaptive_mt_dataset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.adaptive_mt_dataset_path project: "value0", location: "value1", dataset: "value2" + assert_equal "projects/value0/locations/value1/adaptiveMtDatasets/value2", path + end + end + + def test_adaptive_mt_file_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.adaptive_mt_file_path project: "value0", location: "value1", dataset: "value2", file: "value3" + assert_equal "projects/value0/locations/value1/adaptiveMtDatasets/value2/adaptiveMtFiles/value3", path + end + end + + def test_dataset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dataset_path project: "value0", location: "value1", dataset: "value2" + assert_equal "projects/value0/locations/value1/datasets/value2", path + end + end + + def test_glossary_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.glossary_path project: "value0", location: "value1", glossary: "value2" + assert_equal "projects/value0/locations/value1/glossaries/value2", path + end + end + + def test_glossary_entry_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.glossary_entry_path project: "value0", location: "value1", glossary: "value2", glossary_entry: "value3" + assert_equal "projects/value0/locations/value1/glossaries/value2/glossaryEntries/value3", 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::Translate::V3::TranslationService::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_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.model_path project: "value0", location: "value1", model: "value2" + assert_equal "projects/value0/locations/value1/models/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb new file mode 100644 index 000000000000..151151e4accd --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb @@ -0,0 +1,2228 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" +require "google/cloud/translate/v3/translation_service/rest" + + +class ::Google::Cloud::Translate::V3::TranslationService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_translate_text + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::TranslateTextResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + contents = ["hello world"] + mime_type = "hello world" + source_language_code = "hello world" + target_language_code = "hello world" + parent = "hello world" + model = "hello world" + glossary_config = {} + transliteration_config = {} + labels = {} + + translate_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_translate_text_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, translate_text_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.translate_text contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.translate_text ::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.translate_text(::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, translate_text_client_stub.call_count + end + end + end + + def test_romanize_text + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::RomanizeTextResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + contents = ["hello world"] + source_language_code = "hello world" + + romanize_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_romanize_text_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, romanize_text_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.romanize_text parent: parent, contents: contents, source_language_code: source_language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.romanize_text ::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.romanize_text(::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, romanize_text_client_stub.call_count + end + end + end + + def test_detect_language + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::DetectLanguageResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + model = "hello world" + content = "hello world" + mime_type = "hello world" + labels = {} + + detect_language_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_detect_language_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, detect_language_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.detect_language parent: parent, model: model, content: content, mime_type: mime_type, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.detect_language ::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.detect_language(::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, detect_language_client_stub.call_count + end + end + end + + def test_get_supported_languages + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::SupportedLanguages.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + display_language_code = "hello world" + model = "hello world" + + get_supported_languages_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_supported_languages_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_supported_languages_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_supported_languages parent: parent, display_language_code: display_language_code, model: model do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_supported_languages ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_supported_languages(::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_supported_languages_client_stub.call_count + end + end + end + + def test_translate_document + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + source_language_code = "hello world" + target_language_code = "hello world" + document_input_config = {} + document_output_config = {} + model = "hello world" + glossary_config = {} + labels = {} + customized_attribution = "hello world" + is_translate_native_pdf_only = true + enable_shadow_removal_native_pdf = true + enable_rotation_correction = true + + translate_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_translate_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, translate_document_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.translate_document parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.translate_document ::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.translate_document(::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, translate_document_client_stub.call_count + end + end + end + + def test_batch_translate_text + # 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" + source_language_code = "hello world" + target_language_codes = ["hello world"] + models = {} + input_configs = [{}] + output_config = {} + glossaries = {} + labels = {} + + batch_translate_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_batch_translate_text_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_translate_text_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_translate_text parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_translate_text ::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_translate_text(::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_translate_text_client_stub.call_count + end + end + end + + def test_batch_translate_document + # 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" + source_language_code = "hello world" + target_language_codes = ["hello world"] + input_configs = [{}] + output_config = {} + models = {} + glossaries = {} + format_conversions = {} + customized_attribution = "hello world" + enable_shadow_removal_native_pdf = true + enable_rotation_correction = true + + batch_translate_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_batch_translate_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_translate_document_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_translate_document parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_translate_document ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_translate_document(::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_translate_document_client_stub.call_count + end + end + end + + def test_create_glossary + # 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" + glossary = {} + + create_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_glossary_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_glossary({ parent: parent, glossary: glossary }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_glossary parent: parent, glossary: glossary do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_glossary ::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_glossary({ parent: parent, glossary: glossary }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_glossary(::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_glossary_client_stub.call_count + end + end + end + + def test_update_glossary + # 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. + glossary = {} + update_mask = {} + + update_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_update_glossary_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_glossary({ glossary: glossary, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_glossary glossary: glossary, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_glossary ::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_glossary({ glossary: glossary, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_glossary(::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_glossary_client_stub.call_count + end + end + end + + def test_list_glossaries + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListGlossariesResponse.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_glossaries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_glossaries_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_glossaries_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_glossaries({ 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_glossaries 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_glossaries ::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries({ 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_glossaries(::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries_client_stub.call_count + end + end + end + + def test_get_glossary + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::Glossary.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_glossary_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_glossary({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_glossary name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_glossary ::Google::Cloud::Translate::V3::GetGlossaryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_glossary({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_glossary(::Google::Cloud::Translate::V3::GetGlossaryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_glossary_client_stub.call_count + end + end + end + + def test_delete_glossary + # 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" + + delete_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_glossary_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_glossary({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_glossary name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_glossary ::Google::Cloud::Translate::V3::DeleteGlossaryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_glossary({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_glossary(::Google::Cloud::Translate::V3::DeleteGlossaryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_glossary_client_stub.call_count + end + end + end + + def test_get_glossary_entry + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::GlossaryEntry.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_glossary_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_glossary_entry({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_glossary_entry name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_glossary_entry ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_glossary_entry({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_glossary_entry(::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_glossary_entry_client_stub.call_count + end + end + end + + def test_list_glossary_entries + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse.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_glossary_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_glossary_entries_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_glossary_entries_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_glossary_entries({ 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_glossary_entries 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_glossary_entries ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries({ 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_glossary_entries(::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries_client_stub.call_count + end + end + end + + def test_create_glossary_entry + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::GlossaryEntry.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + glossary_entry = {} + + create_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_glossary_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_glossary_entry parent: parent, glossary_entry: glossary_entry do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_glossary_entry ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_glossary_entry(::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_glossary_entry_client_stub.call_count + end + end + end + + def test_update_glossary_entry + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::GlossaryEntry.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + glossary_entry = {} + + update_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_update_glossary_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_glossary_entry({ glossary_entry: glossary_entry }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_glossary_entry glossary_entry: glossary_entry do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_glossary_entry ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_glossary_entry({ glossary_entry: glossary_entry }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_glossary_entry(::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_glossary_entry_client_stub.call_count + end + end + end + + def test_delete_glossary_entry + # 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_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_glossary_entry_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_glossary_entry({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_glossary_entry name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_glossary_entry ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_glossary_entry({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_glossary_entry(::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_glossary_entry_client_stub.call_count + end + end + end + + def test_create_dataset + # 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" + dataset = {} + + create_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_dataset({ parent: parent, dataset: dataset }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_dataset parent: parent, dataset: dataset do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_dataset ::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_dataset({ parent: parent, dataset: dataset }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_dataset(::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_dataset_client_stub.call_count + end + end + end + + def test_get_dataset + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::Dataset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dataset ::Google::Cloud::Translate::V3::GetDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dataset(::Google::Cloud::Translate::V3::GetDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dataset_client_stub.call_count + end + end + end + + def test_list_datasets + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListDatasetsResponse.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_datasets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_datasets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_datasets_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_datasets({ 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_datasets 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_datasets ::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets({ 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_datasets(::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets_client_stub.call_count + end + end + end + + def test_delete_dataset + # 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" + + delete_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_dataset ::Google::Cloud::Translate::V3::DeleteDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_dataset(::Google::Cloud::Translate::V3::DeleteDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_dataset_client_stub.call_count + end + end + end + + def test_create_adaptive_mt_dataset + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + adaptive_mt_dataset = {} + + create_adaptive_mt_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_adaptive_mt_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_adaptive_mt_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_adaptive_mt_dataset parent: parent, adaptive_mt_dataset: adaptive_mt_dataset do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_adaptive_mt_dataset ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_adaptive_mt_dataset(::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_adaptive_mt_dataset_client_stub.call_count + end + end + end + + def test_delete_adaptive_mt_dataset + # 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_adaptive_mt_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_adaptive_mt_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_adaptive_mt_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_adaptive_mt_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_adaptive_mt_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_adaptive_mt_dataset ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_adaptive_mt_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_adaptive_mt_dataset(::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_adaptive_mt_dataset_client_stub.call_count + end + end + end + + def test_get_adaptive_mt_dataset + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_adaptive_mt_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_adaptive_mt_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_adaptive_mt_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_adaptive_mt_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_adaptive_mt_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_adaptive_mt_dataset ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_adaptive_mt_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_adaptive_mt_dataset(::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_adaptive_mt_dataset_client_stub.call_count + end + end + end + + def test_list_adaptive_mt_datasets + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.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_adaptive_mt_datasets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_adaptive_mt_datasets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_adaptive_mt_datasets_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_adaptive_mt_datasets({ 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_adaptive_mt_datasets 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_adaptive_mt_datasets ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets({ 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_adaptive_mt_datasets(::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets_client_stub.call_count + end + end + end + + def test_adaptive_mt_translate + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + dataset = "hello world" + content = ["hello world"] + reference_sentence_config = {} + glossary_config = {} + + adaptive_mt_translate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_adaptive_mt_translate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, adaptive_mt_translate_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.adaptive_mt_translate parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.adaptive_mt_translate ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.adaptive_mt_translate(::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, adaptive_mt_translate_client_stub.call_count + end + end + end + + def test_get_adaptive_mt_file + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::AdaptiveMtFile.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_adaptive_mt_file_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_adaptive_mt_file_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_adaptive_mt_file_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_adaptive_mt_file({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_adaptive_mt_file name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_adaptive_mt_file ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_adaptive_mt_file({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_adaptive_mt_file(::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_adaptive_mt_file_client_stub.call_count + end + end + end + + def test_delete_adaptive_mt_file + # 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_adaptive_mt_file_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_adaptive_mt_file_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_adaptive_mt_file_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_adaptive_mt_file({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_adaptive_mt_file name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_adaptive_mt_file ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_adaptive_mt_file({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_adaptive_mt_file(::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_adaptive_mt_file_client_stub.call_count + end + end + end + + def test_import_adaptive_mt_file + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + file_input_source = {} + + import_adaptive_mt_file_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_import_adaptive_mt_file_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_adaptive_mt_file_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_adaptive_mt_file parent: parent, file_input_source: file_input_source do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_adaptive_mt_file ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_adaptive_mt_file(::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_adaptive_mt_file_client_stub.call_count + end + end + end + + def test_list_adaptive_mt_files + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.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_adaptive_mt_files_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_adaptive_mt_files_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_adaptive_mt_files_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_adaptive_mt_files({ 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_adaptive_mt_files 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_adaptive_mt_files ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files({ 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_adaptive_mt_files(::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files_client_stub.call_count + end + end + end + + def test_list_adaptive_mt_sentences + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.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_adaptive_mt_sentences_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_adaptive_mt_sentences_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_adaptive_mt_sentences_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_adaptive_mt_sentences({ 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_adaptive_mt_sentences 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_adaptive_mt_sentences ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences({ 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_adaptive_mt_sentences(::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences_client_stub.call_count + end + end + end + + def test_import_data + # 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. + dataset = "hello world" + input_config = {} + + import_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_import_data_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_data_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_data({ dataset: dataset, input_config: input_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_data dataset: dataset, input_config: input_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_data ::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_data({ dataset: dataset, input_config: input_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_data(::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_data_client_stub.call_count + end + end + end + + def test_export_data + # 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. + dataset = "hello world" + output_config = {} + + export_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_export_data_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_data_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_data({ dataset: dataset, output_config: output_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_data dataset: dataset, output_config: output_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_data ::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_data({ dataset: dataset, output_config: output_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_data(::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_data_client_stub.call_count + end + end + end + + def test_list_examples + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListExamplesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_examples_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_examples_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_examples_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_examples({ parent: parent, 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_examples parent: parent, 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_examples ::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples({ parent: parent, 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_examples(::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples_client_stub.call_count + end + end + end + + def test_create_model + # 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" + model = {} + + create_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_model_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_model({ parent: parent, model: model }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_model parent: parent, model: model do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_model ::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_model({ parent: parent, model: model }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_model(::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_model_client_stub.call_count + end + end + end + + def test_list_models + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::ListModelsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_models_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_models_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_models_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_models({ parent: parent, 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_models parent: parent, 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_models ::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models({ parent: parent, 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_models(::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models_client_stub.call_count + end + end + end + + def test_get_model + # Create test objects. + client_result = ::Google::Cloud::Translate::V3::Model.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_model_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_model ::Google::Cloud::Translate::V3::GetModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_model(::Google::Cloud::Translate::V3::GetModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_model_client_stub.call_count + end + end + end + + def test_delete_model + # 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" + + delete_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_model_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_model ::Google::Cloud::Translate::V3::DeleteModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_model(::Google::Cloud::Translate::V3::DeleteModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_model_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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb new file mode 100644 index 000000000000..26223607f22b --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb @@ -0,0 +1,2575 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" +require "google/cloud/translate/v3/translation_service" + +class ::Google::Cloud::Translate::V3::TranslationService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_translate_text + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::TranslateTextResponse.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. + contents = ["hello world"] + mime_type = "hello world" + source_language_code = "hello world" + target_language_code = "hello world" + parent = "hello world" + model = "hello world" + glossary_config = {} + transliteration_config = {} + labels = {} + + translate_text_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :translate_text, name + assert_kind_of ::Google::Cloud::Translate::V3::TranslateTextRequest, request + assert_equal ["hello world"], request["contents"] + assert_equal "hello world", request["mime_type"] + assert_equal "hello world", request["source_language_code"] + assert_equal "hello world", request["target_language_code"] + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["model"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig), request["glossary_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::TransliterationConfig), request["transliteration_config"] + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, translate_text_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.translate_text contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.translate_text ::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.translate_text(::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, translate_text_client_stub.call_rpc_count + end + end + + def test_romanize_text + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::RomanizeTextResponse.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" + contents = ["hello world"] + source_language_code = "hello world" + + romanize_text_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :romanize_text, name + assert_kind_of ::Google::Cloud::Translate::V3::RomanizeTextRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["contents"] + assert_equal "hello world", request["source_language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, romanize_text_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.romanize_text parent: parent, contents: contents, source_language_code: source_language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.romanize_text ::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.romanize_text(::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, romanize_text_client_stub.call_rpc_count + end + end + + def test_detect_language + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::DetectLanguageResponse.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" + model = "hello world" + content = "hello world" + mime_type = "hello world" + labels = {} + + detect_language_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :detect_language, name + assert_kind_of ::Google::Cloud::Translate::V3::DetectLanguageRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["model"] + assert_equal "hello world", request["content"] + assert_equal :content, request.source + assert_equal "hello world", request["mime_type"] + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, detect_language_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.detect_language parent: parent, model: model, content: content, mime_type: mime_type, labels: labels do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.detect_language ::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.detect_language(::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, detect_language_client_stub.call_rpc_count + end + end + + def test_get_supported_languages + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::SupportedLanguages.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" + display_language_code = "hello world" + model = "hello world" + + get_supported_languages_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_supported_languages, name + assert_kind_of ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["display_language_code"] + assert_equal "hello world", request["model"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_supported_languages_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_supported_languages parent: parent, display_language_code: display_language_code, model: model do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_supported_languages ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_supported_languages(::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_supported_languages_client_stub.call_rpc_count + end + end + + def test_translate_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.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" + source_language_code = "hello world" + target_language_code = "hello world" + document_input_config = {} + document_output_config = {} + model = "hello world" + glossary_config = {} + labels = {} + customized_attribution = "hello world" + is_translate_native_pdf_only = true + enable_shadow_removal_native_pdf = true + enable_rotation_correction = true + + translate_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :translate_document, name + assert_kind_of ::Google::Cloud::Translate::V3::TranslateDocumentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["source_language_code"] + assert_equal "hello world", request["target_language_code"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DocumentInputConfig), request["document_input_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DocumentOutputConfig), request["document_output_config"] + assert_equal "hello world", request["model"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig), request["glossary_config"] + assert_equal({}, request["labels"].to_h) + assert_equal "hello world", request["customized_attribution"] + assert_equal true, request["is_translate_native_pdf_only"] + assert_equal true, request["enable_shadow_removal_native_pdf"] + assert_equal true, request["enable_rotation_correction"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, translate_document_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.translate_document parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.translate_document ::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.translate_document(::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, translate_document_client_stub.call_rpc_count + end + end + + def test_batch_translate_text + # 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" + source_language_code = "hello world" + target_language_codes = ["hello world"] + models = {} + input_configs = [{}] + output_config = {} + glossaries = {} + labels = {} + + batch_translate_text_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_translate_text, name + assert_kind_of ::Google::Cloud::Translate::V3::BatchTranslateTextRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["source_language_code"] + assert_equal ["hello world"], request["target_language_codes"] + assert_equal({}, request["models"].to_h) + assert_kind_of ::Google::Cloud::Translate::V3::InputConfig, request["input_configs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::OutputConfig), request["output_config"] + assert_equal({}, request["glossaries"].to_h) + assert_equal({}, request["labels"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_translate_text_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }) 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.batch_translate_text parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels 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.batch_translate_text ::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels) 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.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }, 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.batch_translate_text(::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels), 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, batch_translate_text_client_stub.call_rpc_count + end + end + + def test_batch_translate_document + # 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" + source_language_code = "hello world" + target_language_codes = ["hello world"] + input_configs = [{}] + output_config = {} + models = {} + glossaries = {} + format_conversions = {} + customized_attribution = "hello world" + enable_shadow_removal_native_pdf = true + enable_rotation_correction = true + + batch_translate_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_translate_document, name + assert_kind_of ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["source_language_code"] + assert_equal ["hello world"], request["target_language_codes"] + assert_kind_of ::Google::Cloud::Translate::V3::BatchDocumentInputConfig, request["input_configs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::BatchDocumentOutputConfig), request["output_config"] + assert_equal({}, request["models"].to_h) + assert_equal({}, request["glossaries"].to_h) + assert_equal({}, request["format_conversions"].to_h) + assert_equal "hello world", request["customized_attribution"] + assert_equal true, request["enable_shadow_removal_native_pdf"] + assert_equal true, request["enable_rotation_correction"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_translate_document_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) 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.batch_translate_document parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction 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.batch_translate_document ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) 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.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, 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.batch_translate_document(::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), 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, batch_translate_document_client_stub.call_rpc_count + end + end + + def test_create_glossary + # 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" + glossary = {} + + create_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_glossary, name + assert_kind_of ::Google::Cloud::Translate::V3::CreateGlossaryRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Glossary), request["glossary"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_glossary({ parent: parent, glossary: glossary }) 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_glossary parent: parent, glossary: glossary 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_glossary ::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary) 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_glossary({ parent: parent, glossary: glossary }, 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_glossary(::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary), 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_glossary_client_stub.call_rpc_count + end + end + + def test_update_glossary + # 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. + glossary = {} + update_mask = {} + + update_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_glossary, name + assert_kind_of ::Google::Cloud::Translate::V3::UpdateGlossaryRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Glossary), request["glossary"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_glossary({ glossary: glossary, update_mask: update_mask }) 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_glossary glossary: glossary, update_mask: update_mask 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_glossary ::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask) 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_glossary({ glossary: glossary, update_mask: update_mask }, 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_glossary(::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask), 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_glossary_client_stub.call_rpc_count + end + end + + def test_list_glossaries + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListGlossariesResponse.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_glossaries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_glossaries, name + assert_kind_of ::Google::Cloud::Translate::V3::ListGlossariesRequest, 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_glossaries_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_glossaries({ 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_glossaries 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_glossaries ::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries({ 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_glossaries(::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries_client_stub.call_rpc_count + end + end + + def test_get_glossary + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::Glossary.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_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_glossary, name + assert_kind_of ::Google::Cloud::Translate::V3::GetGlossaryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_glossary({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_glossary name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_glossary ::Google::Cloud::Translate::V3::GetGlossaryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_glossary({ 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_glossary(::Google::Cloud::Translate::V3::GetGlossaryRequest.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_glossary_client_stub.call_rpc_count + end + end + + def test_delete_glossary + # 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" + + delete_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_glossary, name + assert_kind_of ::Google::Cloud::Translate::V3::DeleteGlossaryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_glossary_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_glossary({ 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.delete_glossary 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.delete_glossary ::Google::Cloud::Translate::V3::DeleteGlossaryRequest.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.delete_glossary({ 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.delete_glossary(::Google::Cloud::Translate::V3::DeleteGlossaryRequest.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, delete_glossary_client_stub.call_rpc_count + end + end + + def test_get_glossary_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::GlossaryEntry.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_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_glossary_entry, name + assert_kind_of ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_glossary_entry({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_glossary_entry name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_glossary_entry ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_glossary_entry({ 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_glossary_entry(::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.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_glossary_entry_client_stub.call_rpc_count + end + end + + def test_list_glossary_entries + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse.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_glossary_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_glossary_entries, name + assert_kind_of ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, 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_glossary_entries_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_glossary_entries({ 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_glossary_entries 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_glossary_entries ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries({ 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_glossary_entries(::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries_client_stub.call_rpc_count + end + end + + def test_create_glossary_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::GlossaryEntry.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" + glossary_entry = {} + + create_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_glossary_entry, name + assert_kind_of ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::GlossaryEntry), request["glossary_entry"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_glossary_entry parent: parent, glossary_entry: glossary_entry do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_glossary_entry ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_glossary_entry(::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_glossary_entry_client_stub.call_rpc_count + end + end + + def test_update_glossary_entry + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::GlossaryEntry.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. + glossary_entry = {} + + update_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_glossary_entry, name + assert_kind_of ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::GlossaryEntry), request["glossary_entry"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_glossary_entry({ glossary_entry: glossary_entry }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_glossary_entry glossary_entry: glossary_entry do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_glossary_entry ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_glossary_entry({ glossary_entry: glossary_entry }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_glossary_entry(::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_glossary_entry_client_stub.call_rpc_count + end + end + + def test_delete_glossary_entry + # 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_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_glossary_entry, name + assert_kind_of ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_glossary_entry_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_glossary_entry({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_glossary_entry name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_glossary_entry ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_glossary_entry({ 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_glossary_entry(::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.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_glossary_entry_client_stub.call_rpc_count + end + end + + def test_create_dataset + # 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" + dataset = {} + + create_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_dataset, name + assert_kind_of ::Google::Cloud::Translate::V3::CreateDatasetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Dataset), request["dataset"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_dataset({ parent: parent, dataset: dataset }) 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_dataset parent: parent, dataset: dataset 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_dataset ::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset) 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_dataset({ parent: parent, dataset: dataset }, 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_dataset(::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset), 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_dataset_client_stub.call_rpc_count + end + end + + def test_get_dataset + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::Dataset.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_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dataset, name + assert_kind_of ::Google::Cloud::Translate::V3::GetDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dataset({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dataset name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dataset ::Google::Cloud::Translate::V3::GetDatasetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dataset({ 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_dataset(::Google::Cloud::Translate::V3::GetDatasetRequest.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_dataset_client_stub.call_rpc_count + end + end + + def test_list_datasets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListDatasetsResponse.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_datasets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_datasets, name + assert_kind_of ::Google::Cloud::Translate::V3::ListDatasetsRequest, 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_datasets_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_datasets({ 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_datasets 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_datasets ::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets({ 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_datasets(::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets_client_stub.call_rpc_count + end + end + + def test_delete_dataset + # 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" + + delete_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_dataset, name + assert_kind_of ::Google::Cloud::Translate::V3::DeleteDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_dataset({ 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.delete_dataset 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.delete_dataset ::Google::Cloud::Translate::V3::DeleteDatasetRequest.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.delete_dataset({ 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.delete_dataset(::Google::Cloud::Translate::V3::DeleteDatasetRequest.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, delete_dataset_client_stub.call_rpc_count + end + end + + def test_create_adaptive_mt_dataset + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.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" + adaptive_mt_dataset = {} + + create_adaptive_mt_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_adaptive_mt_dataset, name + assert_kind_of ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::AdaptiveMtDataset), request["adaptive_mt_dataset"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_adaptive_mt_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_adaptive_mt_dataset parent: parent, adaptive_mt_dataset: adaptive_mt_dataset do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_adaptive_mt_dataset ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_adaptive_mt_dataset(::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_adaptive_mt_dataset_client_stub.call_rpc_count + end + end + + def test_delete_adaptive_mt_dataset + # 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_adaptive_mt_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_adaptive_mt_dataset, name + assert_kind_of ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_adaptive_mt_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_adaptive_mt_dataset({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_adaptive_mt_dataset name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_adaptive_mt_dataset ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_adaptive_mt_dataset({ 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_adaptive_mt_dataset(::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.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_adaptive_mt_dataset_client_stub.call_rpc_count + end + end + + def test_get_adaptive_mt_dataset + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.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_adaptive_mt_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_adaptive_mt_dataset, name + assert_kind_of ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_adaptive_mt_dataset_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_adaptive_mt_dataset({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_adaptive_mt_dataset name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_adaptive_mt_dataset ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_adaptive_mt_dataset({ 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_adaptive_mt_dataset(::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.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_adaptive_mt_dataset_client_stub.call_rpc_count + end + end + + def test_list_adaptive_mt_datasets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.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_adaptive_mt_datasets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_adaptive_mt_datasets, name + assert_kind_of ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, 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_adaptive_mt_datasets_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_adaptive_mt_datasets({ 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_adaptive_mt_datasets 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_adaptive_mt_datasets ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets({ 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_adaptive_mt_datasets(::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets_client_stub.call_rpc_count + end + end + + def test_adaptive_mt_translate + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.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" + dataset = "hello world" + content = ["hello world"] + reference_sentence_config = {} + glossary_config = {} + + adaptive_mt_translate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :adaptive_mt_translate, name + assert_kind_of ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["dataset"] + assert_equal ["hello world"], request["content"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig), request["reference_sentence_config"] + assert request.has_reference_sentence_config? + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig), request["glossary_config"] + assert request.has_glossary_config? + refute_nil options + end + + Gapic::ServiceStub.stub :new, adaptive_mt_translate_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.adaptive_mt_translate parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.adaptive_mt_translate ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.adaptive_mt_translate(::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, adaptive_mt_translate_client_stub.call_rpc_count + end + end + + def test_get_adaptive_mt_file + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtFile.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_adaptive_mt_file_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_adaptive_mt_file, name + assert_kind_of ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_adaptive_mt_file_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_adaptive_mt_file({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_adaptive_mt_file name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_adaptive_mt_file ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_adaptive_mt_file({ 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_adaptive_mt_file(::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.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_adaptive_mt_file_client_stub.call_rpc_count + end + end + + def test_delete_adaptive_mt_file + # 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_adaptive_mt_file_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_adaptive_mt_file, name + assert_kind_of ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_adaptive_mt_file_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_adaptive_mt_file({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_adaptive_mt_file name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_adaptive_mt_file ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_adaptive_mt_file({ 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_adaptive_mt_file(::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.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_adaptive_mt_file_client_stub.call_rpc_count + end + end + + def test_import_adaptive_mt_file + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.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" + file_input_source = {} + + import_adaptive_mt_file_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_adaptive_mt_file, name + assert_kind_of ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::FileInputSource), request["file_input_source"] + assert_equal :file_input_source, request.source + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_adaptive_mt_file_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_adaptive_mt_file parent: parent, file_input_source: file_input_source do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_adaptive_mt_file ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_adaptive_mt_file(::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_adaptive_mt_file_client_stub.call_rpc_count + end + end + + def test_list_adaptive_mt_files + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.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_adaptive_mt_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_adaptive_mt_files, name + assert_kind_of ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, 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_adaptive_mt_files_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_adaptive_mt_files({ 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_adaptive_mt_files 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_adaptive_mt_files ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files({ 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_adaptive_mt_files(::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files_client_stub.call_rpc_count + end + end + + def test_list_adaptive_mt_sentences + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.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_adaptive_mt_sentences_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_adaptive_mt_sentences, name + assert_kind_of ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, 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_adaptive_mt_sentences_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_adaptive_mt_sentences({ 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_adaptive_mt_sentences 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_adaptive_mt_sentences ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences({ 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_adaptive_mt_sentences(::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences_client_stub.call_rpc_count + end + end + + def test_import_data + # 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. + dataset = "hello world" + input_config = {} + + import_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_data, name + assert_kind_of ::Google::Cloud::Translate::V3::ImportDataRequest, request + assert_equal "hello world", request["dataset"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DatasetInputConfig), request["input_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_data_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_data({ dataset: dataset, input_config: input_config }) 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.import_data dataset: dataset, input_config: input_config 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.import_data ::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config) 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.import_data({ dataset: dataset, input_config: input_config }, 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.import_data(::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config), 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, import_data_client_stub.call_rpc_count + end + end + + def test_export_data + # 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. + dataset = "hello world" + output_config = {} + + export_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_data, name + assert_kind_of ::Google::Cloud::Translate::V3::ExportDataRequest, request + assert_equal "hello world", request["dataset"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DatasetOutputConfig), request["output_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_data_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_data({ dataset: dataset, output_config: output_config }) 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.export_data dataset: dataset, output_config: output_config 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.export_data ::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config) 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.export_data({ dataset: dataset, output_config: output_config }, 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.export_data(::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config), 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, export_data_client_stub.call_rpc_count + end + end + + def test_list_examples + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListExamplesResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_examples_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_examples, name + assert_kind_of ::Google::Cloud::Translate::V3::ListExamplesRequest, request + assert_equal "hello world", request["parent"] + 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_examples_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_examples({ parent: parent, 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_examples parent: parent, 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_examples ::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples({ parent: parent, 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_examples(::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples_client_stub.call_rpc_count + end + end + + def test_create_model + # 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" + model = {} + + create_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_model, name + assert_kind_of ::Google::Cloud::Translate::V3::CreateModelRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Model), request["model"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_model_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_model({ parent: parent, model: model }) 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_model parent: parent, model: model 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_model ::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model) 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_model({ parent: parent, model: model }, 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_model(::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model), 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_model_client_stub.call_rpc_count + end + end + + def test_list_models + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::ListModelsResponse.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" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_models, name + assert_kind_of ::Google::Cloud::Translate::V3::ListModelsRequest, request + assert_equal "hello world", request["parent"] + 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_models_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_models({ parent: parent, 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_models parent: parent, 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_models ::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models({ parent: parent, 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_models(::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models_client_stub.call_rpc_count + end + end + + def test_get_model + # Create GRPC objects. + grpc_response = ::Google::Cloud::Translate::V3::Model.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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_model, name + assert_kind_of ::Google::Cloud::Translate::V3::GetModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_model_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_model({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_model name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_model ::Google::Cloud::Translate::V3::GetModelRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_model({ 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_model(::Google::Cloud::Translate::V3::GetModelRequest.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_model_client_stub.call_rpc_count + end + end + + def test_delete_model + # 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" + + delete_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_model, name + assert_kind_of ::Google::Cloud::Translate::V3::DeleteModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_model_client_stub do + # Create client + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_model({ 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.delete_model 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.delete_model ::Google::Cloud::Translate::V3::DeleteModelRequest.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.delete_model({ 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.delete_model(::Google::Cloud::Translate::V3::DeleteModelRequest.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, delete_model_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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Translate::V3::TranslationService::Client, client + assert_equal creds, client.configure.credentials + end + 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::Translate::V3::TranslationService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Translate::V3::TranslationService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/helper.rb b/owl-bot-staging/google-cloud-translate-v3/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate-v3/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-translate/.gitignore b/owl-bot-staging/google-cloud-translate/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/.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-translate/.repo-metadata.json b/owl-bot-staging/google-cloud-translate/.repo-metadata.json new file mode 100644 index 000000000000..154a425c46de --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "translate.googleapis.com", + "api_shortname": "translate", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-translate/latest", + "distribution_name": "google-cloud-translate", + "is_cloud": true, + "language": "ruby", + "name": "translate", + "name_pretty": "Cloud Translation API", + "product_documentation": "https://cloud.google.com/translate", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service.", + "ruby-cloud-env-prefix": "TRANSLATE", + "ruby-cloud-product-url": "https://cloud.google.com/translate", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-translate/.rubocop.yml b/owl-bot-staging/google-cloud-translate/.rubocop.yml new file mode 100644 index 000000000000..e177fd4a3c2a --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-translate.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +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/FileName: + Exclude: + - "lib/google-cloud-translate.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-translate/.toys.rb b/owl-bot-staging/google-cloud-translate/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate/.yardopts b/owl-bot-staging/google-cloud-translate/.yardopts new file mode 100644 index 000000000000..d6eb6631a4e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Translation API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +MIGRATING.md +LICENSE.md diff --git a/owl-bot-staging/google-cloud-translate/AUTHENTICATION.md b/owl-bot-staging/google-cloud-translate/AUTHENTICATION.md new file mode 100644 index 000000000000..caba11945d31 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-translate 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-translate 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/translate" + +client = Google::Cloud::Translate.translation_service do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/translate" + +Google::Cloud::Translate.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = Google::Cloud::Translate.translation_service +``` + +### 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-translate +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/translate" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = Google::Cloud::Translate.translation_service +``` + +### 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-translate/CHANGELOG.md b/owl-bot-staging/google-cloud-translate/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-translate/Gemfile b/owl-bot-staging/google-cloud-translate/Gemfile new file mode 100644 index 000000000000..fa5bdac7584b --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/Gemfile @@ -0,0 +1,28 @@ +source "https://rubygems.org" + +gemspec + +local_dependencies = ["google-cloud-translate-v2", "google-cloud-translate-v3"] + +main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-translate.gemspec")) +local_dependencies.each do |name| + spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ + unless File.file? spec_path + warn "WARNING: Disabled local dependency for #{name} because gemspec not found." + next + end + version = Bundler.load_gemspec(spec_path).version + if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } + warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." + next + end + gem name, path: "../#{name}" +end + +gem "google-style", "~> 1.30.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-translate/LICENSE.md b/owl-bot-staging/google-cloud-translate/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/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-translate/README.md b/owl-bot-staging/google-cloud-translate/README.md new file mode 100644 index 000000000000..04a095eab92e --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/README.md @@ -0,0 +1,152 @@ +# Ruby Client for the Cloud Translation API + +API Client library for the Cloud Translation API + +Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-translate-v*`. +The gem `google-cloud-translate` is the main client library that brings the +versioned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-translate/latest) +for this library, google-cloud-translate, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-translate-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v2/latest), +[google-cloud-translate-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest). + +See also the [Product Documentation](https://cloud.google.com/translate) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-translate +``` + +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/translate.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +```ruby +require "google/cloud/translate" + +client = Google::Cloud::Translate.translation_service +request = ::Google::Cloud::Translate::V3::TranslateTextRequest.new # (request fields as keyword arguments...) +response = client.translate_text request +``` + +## Migrating from 2.x versions + +The 3.0 release of the google-cloud-translate client is a significant upgrade +based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby), +and includes substantial interface changes. Existing code written for earlier +versions of this library will likely require updates to use this version. +See the {file:MIGRATING.md MIGRATING.md} document for more information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +Debug logging also requires that the versioned clients for this service be +sufficiently recent, released after about Dec 10, 2024. If logging is not +working, try updating the versioned clients in your bundle or installed gems: +[google-cloud-translate-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v2/latest), +[google-cloud-translate-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +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-translate`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-translate-v2`. +_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-translate`. +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-translate-v2`. + +### 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-translate/Rakefile b/owl-bot-staging/google-cloud-translate/Rakefile new file mode 100644 index 000000000000..fb853337ba0f --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true +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-translate acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["TRANSLATE_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["TRANSLATE_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["TRANSLATE_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 TRANSLATE_TEST_PROJECT=test123 TRANSLATE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/translate/v3/translation_service/credentials" + ::Google::Cloud::Translate::V3::TranslationService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["TRANSLATE_PROJECT"] = project + ENV["TRANSLATE_TEST_PROJECT"] = project + ENV["TRANSLATE_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-translate 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-translate 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-translate 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-translate gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-translate" + header "google-cloud-translate rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-translate yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-translate 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-translate 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-translate 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-translate/google-cloud-translate.gemspec b/owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec new file mode 100644 index 000000000000..16c18170ada6 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/translate/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-translate" + gem.version = Google::Cloud::Translate::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service." + gem.summary = "API Client library for the Cloud Translation API" + 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") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts", "MIGRATING.md"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.0" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-translate-v2", ">= 0.0", "< 2.a" + gem.add_dependency "google-cloud-translate-v3", ">= 0.11", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb b/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb new file mode 100644 index 000000000000..60bfba5fe0f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate" unless defined? Google::Cloud::Translate::VERSION diff --git a/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb new file mode 100644 index 000000000000..cd1decafa120 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb @@ -0,0 +1,156 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/translate/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :translate do |config| + config.add_field! :endpoint, nil, match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String + config.add_field! :universe_domain, nil, match: ::String +end + +module Google + module Cloud + module Translate + ## + # Create a new client object for TranslationService. + # + # By default, this returns an instance of + # [Google::Cloud::Translate::V3::TranslationService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest/Google-Cloud-Translate-V3-TranslationService-Client) + # for a gRPC client for version V3 of the API. + # However, you can specify a different API version by passing it in the + # `version` parameter. If the TranslationService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # You can also specify a different transport by passing `:rest` or `:grpc` in + # the `transport` parameter. + # + # Raises an exception if the currently installed versioned client gem for the + # given API version does not support the given transport of the TranslationService service. + # You can determine whether the method will succeed by calling + # {Google::Cloud::Translate.translation_service_available?}. + # + # ## About TranslationService + # + # Provides natural language translation operations. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [::Object] A client object for the specified version. + # + def self.translation_service version: :v3, transport: :grpc, &block + require "google/cloud/translate/#{version.to_s.downcase}" + + package_name = Google::Cloud::Translate + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + service_module = Google::Cloud::Translate.const_get(package_name).const_get(:TranslationService) + service_module = service_module.const_get(:Rest) if transport == :rest + service_module.const_get(:Client).new(&block) + end + + ## + # Determines whether the TranslationService service is supported by the current client. + # If true, you can retrieve a client object by calling {Google::Cloud::Translate.translation_service}. + # If false, that method will raise an exception. This could happen if the given + # API version does not exist or does not support the TranslationService service, + # or if the versioned client gem needs an update to support the TranslationService service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v3`. + # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. + # @return [boolean] Whether the service is available. + # + def self.translation_service_available? version: :v3, transport: :grpc + require "google/cloud/translate/#{version.to_s.downcase}" + package_name = Google::Cloud::Translate + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + return false unless package_name + service_module = Google::Cloud::Translate.const_get package_name + return false unless service_module.const_defined? :TranslationService + service_module = service_module.const_get :TranslationService + if transport == :rest + return false unless service_module.const_defined? :Rest + service_module = service_module.const_get :Rest + end + service_module.const_defined? :Client + rescue ::LoadError + false + end + + ## + # Configure the google-cloud-translate library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # 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 [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.translate if block_given? + + ::Google::Cloud.configure.translate + end + end + end +end + +helper_path = ::File.join __dir__, "translate", "helpers.rb" +require "google/cloud/translate/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb new file mode 100644 index 000000000000..316956ce38b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb b/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb new file mode 100644 index 000000000000..7c39809ff7a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/translate" +require "gapic/common" +require "gapic/grpc" +require "gapic/rest" + +class Google::Cloud::Translate::ClientConstructionMinitest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_translation_service_grpc + skip unless Google::Cloud::Translate.translation_service_available? transport: :grpc + Gapic::ServiceStub.stub :new, DummyStub.new do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Translate.translation_service transport: :grpc do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Translate::V3::TranslationService::Client, client + end + end + + def test_translation_service_rest + skip unless Google::Cloud::Translate.translation_service_available? transport: :rest + Gapic::Rest::ClientStub.stub :new, DummyStub.new do + client = Google::Cloud::Translate.translation_service transport: :rest do |config| + config.credentials = :dummy_credentials + end + assert_kind_of Google::Cloud::Translate::V3::TranslationService::Rest::Client, client + end + end +end diff --git a/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb b/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb new file mode 100644 index 000000000000..3b69563e0077 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/translate/version" + +class Google::Cloud::Translate::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Translate::VERSION + end +end diff --git a/owl-bot-staging/google-cloud-translate/test/helper.rb b/owl-bot-staging/google-cloud-translate/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-translate/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/.gitignore b/owl-bot-staging/google-cloud-video-live_stream-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-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-video-live_stream-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-video-live_stream-v1/.repo-metadata.json new file mode 100644 index 000000000000..aeab9c64ff17 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "livestream.googleapis.com", + "api_shortname": "livestream", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest", + "distribution_name": "google-cloud-video-live_stream-v1", + "is_cloud": true, + "language": "ruby", + "name": "livestream", + "name_pretty": "Live Stream V1 API", + "product_documentation": "https://cloud.google.com/livestream/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Live Stream API transcodes mezzanine live signals into direct-to-consumer streaming formats, including Dynamic Adaptive Streaming over HTTP (DASH/MPEG-DASH), and HTTP Live Streaming (HLS), for multiple device platforms. Note that google-cloud-video-live_stream-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-video-live_stream instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/livestream/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml b/owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml new file mode 100644 index 000000000000..3d8359eaee07 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-video-live_stream-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-video-live_stream-v1.rb" diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/.yardopts b/owl-bot-staging/google-cloud-video-live_stream-v1/.yardopts new file mode 100644 index 000000000000..ab2ac4451b9f --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Live Stream 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-video-live_stream-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-video-live_stream-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..7132dc94ea28 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-video-live_stream-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-video-live_stream-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/video/live_stream/v1" + +client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/video/live_stream/v1" + +::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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-video-live_stream-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/video/live_stream/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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-video-live_stream-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-video-live_stream-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile b/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.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-video-live_stream-v1/LICENSE.md b/owl-bot-staging/google-cloud-video-live_stream-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-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-video-live_stream-v1/README.md b/owl-bot-staging/google-cloud-video-live_stream-v1/README.md new file mode 100644 index 000000000000..1cce01e33fdb --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Live Stream V1 API + +API Client library for the Live Stream V1 API + +The Live Stream API transcodes mezzanine live signals into direct-to-consumer streaming formats, including Dynamic Adaptive Streaming over HTTP (DASH/MPEG-DASH), and HTTP Live Streaming (HLS), for multiple device platforms. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Live Stream V1 API. Most users should consider using +the main client gem, +[google-cloud-video-live_stream](https://rubygems.org/gems/google-cloud-video-live_stream). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-video-live_stream-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/livestream.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/video/live_stream/v1" + +client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +request = ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new # (request fields as keyword arguments...) +response = client.create_channel request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/livestream/) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/video/live_stream/v1" +require "logger" + +client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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-video-live_stream`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-video-live_stream-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-video-live_stream`. +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-video-live_stream-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-video-live_stream-v1/Rakefile b/owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile new file mode 100644 index 000000000000..b9de32a98243 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/video/live_stream/v1/livestream_service/credentials" + ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-video-live_stream-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-video-live_stream-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-video-live_stream-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-video-live_stream-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-video-live_stream-v1" + header "google-cloud-video-live_stream-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-video-live_stream-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-video-live_stream-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-video-live_stream-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-video-live_stream-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-video-live_stream-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json new file mode 100644 index 000000000000..3b108930e5f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json @@ -0,0 +1,188 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.video.livestream.v1", + "libraryPackage": "::Google::Cloud::Video::LiveStream::V1", + "services": { + "LivestreamService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client", + "rpcs": { + "CreateChannel": { + "methods": [ + "create_channel" + ] + }, + "ListChannels": { + "methods": [ + "list_channels" + ] + }, + "GetChannel": { + "methods": [ + "get_channel" + ] + }, + "DeleteChannel": { + "methods": [ + "delete_channel" + ] + }, + "UpdateChannel": { + "methods": [ + "update_channel" + ] + }, + "StartChannel": { + "methods": [ + "start_channel" + ] + }, + "StopChannel": { + "methods": [ + "stop_channel" + ] + }, + "StartDistribution": { + "methods": [ + "start_distribution" + ] + }, + "StopDistribution": { + "methods": [ + "stop_distribution" + ] + }, + "CreateInput": { + "methods": [ + "create_input" + ] + }, + "ListInputs": { + "methods": [ + "list_inputs" + ] + }, + "GetInput": { + "methods": [ + "get_input" + ] + }, + "DeleteInput": { + "methods": [ + "delete_input" + ] + }, + "UpdateInput": { + "methods": [ + "update_input" + ] + }, + "PreviewInput": { + "methods": [ + "preview_input" + ] + }, + "CreateEvent": { + "methods": [ + "create_event" + ] + }, + "ListEvents": { + "methods": [ + "list_events" + ] + }, + "GetEvent": { + "methods": [ + "get_event" + ] + }, + "DeleteEvent": { + "methods": [ + "delete_event" + ] + }, + "ListClips": { + "methods": [ + "list_clips" + ] + }, + "GetClip": { + "methods": [ + "get_clip" + ] + }, + "CreateClip": { + "methods": [ + "create_clip" + ] + }, + "DeleteClip": { + "methods": [ + "delete_clip" + ] + }, + "CreateDvrSession": { + "methods": [ + "create_dvr_session" + ] + }, + "ListDvrSessions": { + "methods": [ + "list_dvr_sessions" + ] + }, + "GetDvrSession": { + "methods": [ + "get_dvr_session" + ] + }, + "DeleteDvrSession": { + "methods": [ + "delete_dvr_session" + ] + }, + "UpdateDvrSession": { + "methods": [ + "update_dvr_session" + ] + }, + "CreateAsset": { + "methods": [ + "create_asset" + ] + }, + "DeleteAsset": { + "methods": [ + "delete_asset" + ] + }, + "GetAsset": { + "methods": [ + "get_asset" + ] + }, + "ListAssets": { + "methods": [ + "list_assets" + ] + }, + "GetPool": { + "methods": [ + "get_pool" + ] + }, + "UpdatePool": { + "methods": [ + "update_pool" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec b/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec new file mode 100644 index 000000000000..3822779303f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/video/live_stream/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-video-live_stream-v1" + gem.version = Google::Cloud::Video::LiveStream::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Live Stream API transcodes mezzanine live signals into direct-to-consumer streaming formats, including Dynamic Adaptive Streaming over HTTP (DASH/MPEG-DASH), and HTTP Live Streaming (HLS), for multiple device platforms. Note that google-cloud-video-live_stream-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-video-live_stream instead. See the readme for more details." + gem.summary = "API Client library for the Live Stream V1 API" + 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 = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb new file mode 100644 index 000000000000..581cf388ce2b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1" diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb new file mode 100644 index 000000000000..49926cffb929 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/livestream_service" +require "google/cloud/video/live_stream/v1/version" + +module Google + module Cloud + module Video + module LiveStream + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/video/live_stream/v1" + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/video/live_stream/v1" + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + module V1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/video/live_stream/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb new file mode 100644 index 000000000000..b9059d78ec3f --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" + +module Google + module Cloud + module Video + module LiveStream + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/video/live_stream/v1/rest" + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Video", "LiveStream"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb new file mode 100644 index 000000000000..a24205f13b01 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/version" + +require "google/cloud/video/live_stream/v1/livestream_service/credentials" +require "google/cloud/video/live_stream/v1/livestream_service/paths" +require "google/cloud/video/live_stream/v1/livestream_service/operations" +require "google/cloud/video/live_stream/v1/livestream_service/client" +require "google/cloud/video/live_stream/v1/livestream_service/rest" + +module Google + module Cloud + module Video + module LiveStream + module V1 + ## + # Using Live Stream API, you can generate live streams in the various + # renditions and streaming formats. The streaming format include HTTP Live + # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send + # a source stream in the various ways, including Real-Time Messaging + # Protocol (RTMP) and Secure Reliable Transport (SRT). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/video/live_stream/v1/livestream_service" + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/video/live_stream/v1/livestream_service/rest" + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + module LivestreamService + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "livestream_service", "helpers.rb" +require "google/cloud/video/live_stream/v1/livestream_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb new file mode 100644 index 000000000000..06812729aaca --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb @@ -0,0 +1,4350 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" +require "google/cloud/location" + +module Google + module Cloud + module Video + module LiveStream + module V1 + module LivestreamService + ## + # Client for the LivestreamService service. + # + # Using Live Stream API, you can generate live streams in the various + # renditions and streaming formats. The streaming format include HTTP Live + # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send + # a source stream in the various ways, including Real-Time Messaging + # Protocol (RTMP) and Secure Reliable Transport (SRT). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :livestream_service_stub + + ## + # Configure the LivestreamService Client class. + # + # See {::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LivestreamService clients + # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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", "Video", "LiveStream", "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_channel.timeout = 60.0 + + default_config.rpcs.list_channels.timeout = 60.0 + default_config.rpcs.list_channels.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_channel.timeout = 60.0 + default_config.rpcs.get_channel.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_channel.timeout = 60.0 + + default_config.rpcs.update_channel.timeout = 60.0 + + default_config.rpcs.start_channel.timeout = 60.0 + + default_config.rpcs.stop_channel.timeout = 60.0 + + default_config.rpcs.start_distribution.timeout = 60.0 + + default_config.rpcs.stop_distribution.timeout = 60.0 + + default_config.rpcs.create_input.timeout = 60.0 + + default_config.rpcs.list_inputs.timeout = 60.0 + default_config.rpcs.list_inputs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_input.timeout = 60.0 + default_config.rpcs.get_input.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_input.timeout = 60.0 + + default_config.rpcs.update_input.timeout = 60.0 + + default_config.rpcs.preview_input.timeout = 60.0 + + default_config.rpcs.create_event.timeout = 60.0 + + default_config.rpcs.list_events.timeout = 60.0 + default_config.rpcs.list_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_event.timeout = 60.0 + default_config.rpcs.get_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_event.timeout = 60.0 + + default_config.rpcs.list_clips.timeout = 60.0 + default_config.rpcs.list_clips.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_clip.timeout = 60.0 + default_config.rpcs.get_clip.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_clip.timeout = 60.0 + + default_config.rpcs.delete_clip.timeout = 60.0 + + default_config.rpcs.create_dvr_session.timeout = 60.0 + + default_config.rpcs.list_dvr_sessions.timeout = 60.0 + default_config.rpcs.list_dvr_sessions.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_dvr_session.timeout = 60.0 + default_config.rpcs.get_dvr_session.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_dvr_session.timeout = 60.0 + + default_config.rpcs.update_dvr_session.timeout = 60.0 + + default_config.rpcs.create_asset.timeout = 60.0 + + default_config.rpcs.delete_asset.timeout = 60.0 + + default_config.rpcs.get_asset.timeout = 60.0 + default_config.rpcs.get_asset.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_assets.timeout = 60.0 + default_config.rpcs.list_assets.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_pool.timeout = 60.0 + default_config.rpcs.get_pool.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_pool.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LivestreamService 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::Video::LiveStream::V1::LivestreamService::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 + @livestream_service_stub.universe_domain + end + + ## + # Create a new LivestreamService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LivestreamService 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/video/livestream/v1/service_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 + + @livestream_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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, + logger: @config.logger + ) + + @livestream_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @livestream_service_stub.endpoint + config.universe_domain = @livestream_service_stub.universe_domain + config.logger = @livestream_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Video::LiveStream::V1::LivestreamService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @livestream_service_stub.logger + end + + # Service calls + + ## + # Creates a channel with the provided unique ID in the specified + # region. + # + # @overload create_channel(request, options = nil) + # Pass arguments to `create_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(parent: nil, channel: nil, channel_id: nil, request_id: nil) + # Pass arguments to `create_channel` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] + # Required. The channel resource to be created. + # @param channel_id [::String] + # Required. The ID of the channel resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new + # + # # Call the create_channel method. + # result = client.create_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :create_channel, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all channels in the specified region. + # + # @overload list_channels(request, options = nil) + # Pass arguments to `list_channels` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channels(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_channels` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # The filter to apply to list results. + # @param order_by [::String] + # Specifies the ordering of results following syntax at + # https://cloud.google.com/apis/design/design_patterns#sorting_order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new + # + # # Call the list_channels method. + # result = client.list_channels 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::Video::LiveStream::V1::Channel. + # p item + # end + # + def list_channels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest + + # Converts hash 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_channels.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::Video::LiveStream::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_channels.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_channels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :list_channels, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_channels, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified channel. + # + # @overload get_channel(request, options = nil) + # Pass arguments to `get_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil) + # Pass arguments to `get_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Channel] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Channel] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new + # + # # Call the get_channel method. + # result = client.get_channel request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. + # p result + # + def get_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :get_channel, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified channel. + # + # @overload delete_channel(request, options = nil) + # Pass arguments to `delete_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @param force [::Boolean] + # If the `force` field is set to the default value of `false`, you must + # delete all of a channel's events before you can delete the channel itself. + # If the field is set to `true`, requests to delete a channel also delete + # associated channel events. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new + # + # # Call the delete_channel method. + # result = client.delete_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :delete_channel, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified channel. + # + # @overload update_channel(request, options = nil) + # Pass arguments to `update_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(update_mask: nil, channel: nil, request_id: nil) + # Pass arguments to `update_channel` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the Channel + # resource by the update. You can only update the following fields: + # + # * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + # * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) + # * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + # * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) + # * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + # * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + # * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + # * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + # * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + # * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the mask is not present, then each field from the list above is updated + # if the field appears in the request payload. To unset a field, add the + # field to the update mask and remove it from the request payload. + # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] + # Required. The channel resource to be updated. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new + # + # # Call the update_channel method. + # result = client.update_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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.channel&.name + header_params["channel.name"] = request.channel.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_channel.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :update_channel, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts the specified channel. Part of the video pipeline will be created + # only when the StartChannel request is received by the server. + # + # @overload start_channel(request, options = nil) + # Pass arguments to `start_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StartChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) + # Pass arguments to `start_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new + # + # # Call the start_channel method. + # result = client.start_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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.start_channel.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :start_channel, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops the specified channel. Part of the video pipeline will be released + # when the StopChannel request is received by the server. + # + # @overload stop_channel(request, options = nil) + # Pass arguments to `stop_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StopChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) + # Pass arguments to `stop_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new + # + # # Call the stop_channel method. + # result = client.stop_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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.stop_channel.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :stop_channel, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts distribution which delivers outputs to the destination indicated by + # the Distribution configuration. + # + # @overload start_distribution(request, options = nil) + # Pass arguments to `start_distribution` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) + # Pass arguments to `start_distribution` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param distribution_keys [::Array<::String>] + # Optional. A list of keys to identify the distribution configuration in the + # channel resource. If left empty, all the distributions in the channel + # specification will be started. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new + # + # # Call the start_distribution method. + # result = client.start_distribution 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_distribution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest + + # Converts hash 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_distribution.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::Video::LiveStream::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.start_distribution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_distribution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :start_distribution, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops the specified distribution. + # + # @overload stop_distribution(request, options = nil) + # Pass arguments to `stop_distribution` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) + # Pass arguments to `stop_distribution` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param distribution_keys [::Array<::String>] + # Optional. A list of key to identify the distribution configuration in the + # channel resource. If left empty, all the distributions in the channel + # specification will be stopped. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new + # + # # Call the stop_distribution method. + # result = client.stop_distribution 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_distribution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest + + # Converts hash 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_distribution.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::Video::LiveStream::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.stop_distribution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_distribution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :stop_distribution, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an input with the provided unique ID in the specified region. + # + # @overload create_input(request, options = nil) + # Pass arguments to `create_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(parent: nil, input: nil, input_id: nil, request_id: nil) + # Pass arguments to `create_input` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] + # Required. The input resource to be created. + # @param input_id [::String] + # Required. The ID of the input resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new + # + # # Call the create_input method. + # result = client.create_input 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_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :create_input, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all inputs in the specified region. + # + # @overload list_inputs(request, options = nil) + # Pass arguments to `list_inputs` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListInputsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_inputs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_inputs` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListInputsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # The filter to apply to list results. + # @param order_by [::String] + # Specifies the ordering of results following syntax at [Sorting + # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new + # + # # Call the list_inputs method. + # result = client.list_inputs 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::Video::LiveStream::V1::Input. + # p item + # end + # + def list_inputs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest + + # Converts hash 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_inputs.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::Video::LiveStream::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_inputs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_inputs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :list_inputs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_inputs, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified input. + # + # @overload get_input(request, options = nil) + # Pass arguments to `get_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(name: nil) + # Pass arguments to `get_input` via keyword arguments. Note that at + # least one keyword argument is 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 input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Input] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Input] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new + # + # # Call the get_input method. + # result = client.get_input request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. + # p result + # + def get_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :get_input, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified input. + # + # @overload delete_input(request, options = nil) + # Pass arguments to `delete_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(name: nil, request_id: nil) + # Pass arguments to `delete_input` via keyword arguments. Note that at + # least one keyword argument is 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 input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new + # + # # Call the delete_input method. + # result = client.delete_input 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_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :delete_input, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified input. + # + # @overload update_input(request, options = nil) + # Pass arguments to `update_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(update_mask: nil, input: nil, request_id: nil) + # Pass arguments to `update_input` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the Input + # resource by the update. You can only update the following fields: + # + # * [`tier`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#Tier) + # * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + # * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the mask is not present, then each field from the list above is updated + # if the field appears in the request payload. To unset a field, add the + # field to the update mask and remove it from the request payload. + # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] + # Required. The input resource to be updated. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new + # + # # Call the update_input method. + # result = client.update_input 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_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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.input&.name + header_params["input.name"] = request.input.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_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :update_input, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Preview the streaming content of the specified input. + # + # @overload preview_input(request, options = nil) + # Pass arguments to `preview_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload preview_input(name: nil) + # Pass arguments to `preview_input` via keyword arguments. Note that at + # least one keyword argument is 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 input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new + # + # # Call the preview_input method. + # result = client.preview_input request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::PreviewInputResponse. + # p result + # + def preview_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest + + # Converts hash 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.preview_input.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::Video::LiveStream::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.preview_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.preview_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :preview_input, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an event with the provided unique ID in the specified channel. + # + # @overload create_event(request, options = nil) + # Pass arguments to `create_event` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(parent: nil, event: nil, event_id: nil, request_id: nil) + # Pass arguments to `create_event` via keyword arguments. Note that at + # least one keyword argument is 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 channel for the resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param event [::Google::Cloud::Video::LiveStream::V1::Event, ::Hash] + # Required. The event resource to be created. + # @param event_id [::String] + # Required. The ID of the event resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Event] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Event] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new + # + # # Call the create_event method. + # result = client.create_event request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + # p result + # + def create_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest + + # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :create_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all events in the specified channel. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_events` via keyword arguments. Note that at + # least one keyword argument is 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 channel for the resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param page_size [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListEventsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # The filter to apply to list results. + # @param order_by [::String] + # Specifies the ordering of results following syntax at + # https://cloud.google.com/apis/design/design_patterns#sorting_order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_events 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::Video::LiveStream::V1::Event. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest + + # Converts hash 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_events.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::Video::LiveStream::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_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :list_events, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_events, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified event. + # + # @overload get_event(request, options = nil) + # Pass arguments to `get_event` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil) + # Pass arguments to `get_event` via keyword arguments. Note that at + # least one keyword argument is 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 event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Event] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Event] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new + # + # # Call the get_event method. + # result = client.get_event request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + # p result + # + def get_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetEventRequest + + # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :get_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified event. + # + # @overload delete_event(request, options = nil) + # Pass arguments to `delete_event` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) + # Pass arguments to `delete_event` via keyword arguments. Note that at + # least one keyword argument is 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 event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new + # + # # Call the delete_event method. + # result = client.delete_event request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest + + # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :delete_event, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all clips in the specified channel. + # + # @overload list_clips(request, options = nil) + # Pass arguments to `list_clips` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListClipsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clips(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clips` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListClipsRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new + # + # # Call the list_clips method. + # result = client.list_clips 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::Video::LiveStream::V1::Clip. + # p item + # end + # + def list_clips request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest + + # Converts hash 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_clips.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::Video::LiveStream::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_clips.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clips.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :list_clips, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_clips, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified clip. + # + # @overload get_clip(request, options = nil) + # Pass arguments to `get_clip` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetClipRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetClipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clip(name: nil) + # Pass arguments to `get_clip` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Clip] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Clip] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new + # + # # Call the get_clip method. + # result = client.get_clip request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip. + # p result + # + def get_clip request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetClipRequest + + # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_clip.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :get_clip, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a clip with the provided clip ID in the specified channel. + # + # @overload create_clip(request, options = nil) + # Pass arguments to `create_clip` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateClipRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clip(parent: nil, clip_id: nil, clip: nil, request_id: nil) + # Pass arguments to `create_clip` via keyword arguments. Note that at + # least one keyword argument is 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 name, in the following form: + # `projects/{project}/locations/{location}/channels/{channel}`. + # @param clip_id [::String] + # Required. The ID of the clip resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param clip [::Google::Cloud::Video::LiveStream::V1::Clip, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new + # + # # Call the create_clip method. + # result = client.create_clip 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_clip request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest + + # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_clip.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :create_clip, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified clip job resource. This method only deletes the clip + # job and does not delete the VOD clip stored in Cloud Storage. + # + # @overload delete_clip(request, options = nil) + # Pass arguments to `delete_clip` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clip(name: nil, request_id: nil) + # Pass arguments to `delete_clip` via keyword arguments. Note that at + # least one keyword argument is 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 clip resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new + # + # # Call the delete_clip method. + # result = client.delete_clip 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_clip request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest + + # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_clip.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :delete_clip, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a DVR session with the provided unique ID in the specified channel. + # + # @overload create_dvr_session(request, options = nil) + # Pass arguments to `create_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(parent: nil, dvr_session_id: nil, dvr_session: nil, request_id: nil) + # Pass arguments to `create_dvr_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 name, in the following form: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param dvr_session_id [::String] + # Required. The ID of the DVR session resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new + # + # # Call the create_dvr_session method. + # result = client.create_dvr_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_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :create_dvr_session, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all DVR sessions in the specified channel. + # + # @overload list_dvr_sessions(request, options = nil) + # Pass arguments to `list_dvr_sessions` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_dvr_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. Parent value for ListDvrSessionsRequest + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.new + # + # # Call the list_dvr_sessions method. + # result = client.list_dvr_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::Video::LiveStream::V1::DvrSession. + # p item + # end + # + def list_dvr_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_dvr_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :list_dvr_sessions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_dvr_sessions, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified DVR session. + # + # @overload get_dvr_session(request, options = nil) + # Pass arguments to `get_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(name: nil) + # Pass arguments to `get_dvr_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. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::DvrSession] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new + # + # # Call the get_dvr_session method. + # result = client.get_dvr_session request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::DvrSession. + # p result + # + def get_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :get_dvr_session, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified DVR session. + # + # @overload delete_dvr_session(request, options = nil) + # Pass arguments to `delete_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(name: nil, request_id: nil) + # Pass arguments to `delete_dvr_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 event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.new + # + # # Call the delete_dvr_session method. + # result = client.delete_dvr_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_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :delete_dvr_session, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified DVR session. + # + # @overload update_dvr_session(request, options = nil) + # Pass arguments to `update_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(update_mask: nil, dvr_session: nil, request_id: nil) + # Pass arguments to `update_dvr_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # DvrSession resource by the update. You can only update the following + # fields: + # + # * `dvrWindows` + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] + # Required. The DVR session resource to be updated. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new + # + # # Call the update_dvr_session method. + # result = client.update_dvr_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 update_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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.dvr_session&.name + header_params["dvr_session.name"] = request.dvr_session.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_dvr_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :update_dvr_session, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Asset with the provided unique ID in the specified + # region. + # + # @overload create_asset(request, options = nil) + # Pass arguments to `create_asset` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil, request_id: nil) + # Pass arguments to `create_asset` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param asset [::Google::Cloud::Video::LiveStream::V1::Asset, ::Hash] + # Required. The asset resource to be created. + # @param asset_id [::String] + # Required. The ID of the asset resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new + # + # # Call the create_asset method. + # result = client.create_asset 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_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest + + # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :create_asset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified asset if it is not used. + # + # @overload delete_asset(request, options = nil) + # Pass arguments to `delete_asset` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil, request_id: nil) + # Pass arguments to `delete_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset resource, in the form of: + # `projects/{project}/locations/{location}/assets/{assetId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new + # + # # Call the delete_asset method. + # result = client.delete_asset 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_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest + + # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :delete_asset, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified asset. + # + # @overload get_asset(request, options = nil) + # Pass arguments to `get_asset` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil) + # Pass arguments to `get_asset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/assets/{asset}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Asset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new + # + # # Call the get_asset method. + # result = client.get_asset request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset. + # p result + # + def get_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest + + # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :get_asset, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all assets in the specified region. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets 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::Video::LiveStream::V1::Asset. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest + + # Converts hash 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_assets.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::Video::LiveStream::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_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :list_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_assets, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified pool. + # + # @overload get_pool(request, options = nil) + # Pass arguments to `get_pool` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pool(name: nil) + # Pass arguments to `get_pool` via keyword arguments. Note that at + # least one keyword argument is 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 pool resource, in the form of: + # `projects/{project}/locations/{location}/pools/{poolId}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Pool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Pool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new + # + # # Call the get_pool method. + # result = client.get_pool request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool. + # p result + # + def get_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest + + # Converts hash 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_pool.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::Video::LiveStream::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_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :get_pool, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified pool. + # + # @overload update_pool(request, options = nil) + # Pass arguments to `update_pool` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pool(update_mask: nil, pool: nil, request_id: nil) + # Pass arguments to `update_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the Pool + # resource by the update. You can only update the following fields: + # + # * `networkConfig` + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # @param pool [::Google::Cloud::Video::LiveStream::V1::Pool, ::Hash] + # Required. The pool resource to be updated. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new + # + # # Call the update_pool method. + # result = client.update_pool 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_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest + + # Converts hash 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_pool.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::Video::LiveStream::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.pool&.name + header_params["pool.name"] = request.pool.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_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.call_rpc :update_pool, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the LivestreamService API. + # + # This class represents the configuration for LivestreamService, + # 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::Video::LiveStream::V1::LivestreamService::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_channel to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_channel.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_channel.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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 LivestreamService 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_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :create_channel + ## + # RPC-specific configuration for `list_channels` + # @return [::Gapic::Config::Method] + # + attr_reader :list_channels + ## + # RPC-specific configuration for `get_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :get_channel + ## + # RPC-specific configuration for `delete_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_channel + ## + # RPC-specific configuration for `update_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :update_channel + ## + # RPC-specific configuration for `start_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :start_channel + ## + # RPC-specific configuration for `stop_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_channel + ## + # RPC-specific configuration for `start_distribution` + # @return [::Gapic::Config::Method] + # + attr_reader :start_distribution + ## + # RPC-specific configuration for `stop_distribution` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_distribution + ## + # RPC-specific configuration for `create_input` + # @return [::Gapic::Config::Method] + # + attr_reader :create_input + ## + # RPC-specific configuration for `list_inputs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_inputs + ## + # RPC-specific configuration for `get_input` + # @return [::Gapic::Config::Method] + # + attr_reader :get_input + ## + # RPC-specific configuration for `delete_input` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_input + ## + # RPC-specific configuration for `update_input` + # @return [::Gapic::Config::Method] + # + attr_reader :update_input + ## + # RPC-specific configuration for `preview_input` + # @return [::Gapic::Config::Method] + # + attr_reader :preview_input + ## + # RPC-specific configuration for `create_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `get_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event + ## + # RPC-specific configuration for `delete_event` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event + ## + # RPC-specific configuration for `list_clips` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clips + ## + # RPC-specific configuration for `get_clip` + # @return [::Gapic::Config::Method] + # + attr_reader :get_clip + ## + # RPC-specific configuration for `create_clip` + # @return [::Gapic::Config::Method] + # + attr_reader :create_clip + ## + # RPC-specific configuration for `delete_clip` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_clip + ## + # RPC-specific configuration for `create_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dvr_session + ## + # RPC-specific configuration for `list_dvr_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_dvr_sessions + ## + # RPC-specific configuration for `get_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dvr_session + ## + # RPC-specific configuration for `delete_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dvr_session + ## + # RPC-specific configuration for `update_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dvr_session + ## + # RPC-specific configuration for `create_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_asset + ## + # RPC-specific configuration for `delete_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_asset + ## + # RPC-specific configuration for `get_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_asset + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `get_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pool + ## + # RPC-specific configuration for `update_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_pool + + # @private + def initialize parent_rpcs = nil + create_channel_config = parent_rpcs.create_channel if parent_rpcs.respond_to? :create_channel + @create_channel = ::Gapic::Config::Method.new create_channel_config + list_channels_config = parent_rpcs.list_channels if parent_rpcs.respond_to? :list_channels + @list_channels = ::Gapic::Config::Method.new list_channels_config + get_channel_config = parent_rpcs.get_channel if parent_rpcs.respond_to? :get_channel + @get_channel = ::Gapic::Config::Method.new get_channel_config + delete_channel_config = parent_rpcs.delete_channel if parent_rpcs.respond_to? :delete_channel + @delete_channel = ::Gapic::Config::Method.new delete_channel_config + update_channel_config = parent_rpcs.update_channel if parent_rpcs.respond_to? :update_channel + @update_channel = ::Gapic::Config::Method.new update_channel_config + start_channel_config = parent_rpcs.start_channel if parent_rpcs.respond_to? :start_channel + @start_channel = ::Gapic::Config::Method.new start_channel_config + stop_channel_config = parent_rpcs.stop_channel if parent_rpcs.respond_to? :stop_channel + @stop_channel = ::Gapic::Config::Method.new stop_channel_config + start_distribution_config = parent_rpcs.start_distribution if parent_rpcs.respond_to? :start_distribution + @start_distribution = ::Gapic::Config::Method.new start_distribution_config + stop_distribution_config = parent_rpcs.stop_distribution if parent_rpcs.respond_to? :stop_distribution + @stop_distribution = ::Gapic::Config::Method.new stop_distribution_config + create_input_config = parent_rpcs.create_input if parent_rpcs.respond_to? :create_input + @create_input = ::Gapic::Config::Method.new create_input_config + list_inputs_config = parent_rpcs.list_inputs if parent_rpcs.respond_to? :list_inputs + @list_inputs = ::Gapic::Config::Method.new list_inputs_config + get_input_config = parent_rpcs.get_input if parent_rpcs.respond_to? :get_input + @get_input = ::Gapic::Config::Method.new get_input_config + delete_input_config = parent_rpcs.delete_input if parent_rpcs.respond_to? :delete_input + @delete_input = ::Gapic::Config::Method.new delete_input_config + update_input_config = parent_rpcs.update_input if parent_rpcs.respond_to? :update_input + @update_input = ::Gapic::Config::Method.new update_input_config + preview_input_config = parent_rpcs.preview_input if parent_rpcs.respond_to? :preview_input + @preview_input = ::Gapic::Config::Method.new preview_input_config + create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event + @create_event = ::Gapic::Config::Method.new create_event_config + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event + @get_event = ::Gapic::Config::Method.new get_event_config + delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event + @delete_event = ::Gapic::Config::Method.new delete_event_config + list_clips_config = parent_rpcs.list_clips if parent_rpcs.respond_to? :list_clips + @list_clips = ::Gapic::Config::Method.new list_clips_config + get_clip_config = parent_rpcs.get_clip if parent_rpcs.respond_to? :get_clip + @get_clip = ::Gapic::Config::Method.new get_clip_config + create_clip_config = parent_rpcs.create_clip if parent_rpcs.respond_to? :create_clip + @create_clip = ::Gapic::Config::Method.new create_clip_config + delete_clip_config = parent_rpcs.delete_clip if parent_rpcs.respond_to? :delete_clip + @delete_clip = ::Gapic::Config::Method.new delete_clip_config + create_dvr_session_config = parent_rpcs.create_dvr_session if parent_rpcs.respond_to? :create_dvr_session + @create_dvr_session = ::Gapic::Config::Method.new create_dvr_session_config + list_dvr_sessions_config = parent_rpcs.list_dvr_sessions if parent_rpcs.respond_to? :list_dvr_sessions + @list_dvr_sessions = ::Gapic::Config::Method.new list_dvr_sessions_config + get_dvr_session_config = parent_rpcs.get_dvr_session if parent_rpcs.respond_to? :get_dvr_session + @get_dvr_session = ::Gapic::Config::Method.new get_dvr_session_config + delete_dvr_session_config = parent_rpcs.delete_dvr_session if parent_rpcs.respond_to? :delete_dvr_session + @delete_dvr_session = ::Gapic::Config::Method.new delete_dvr_session_config + update_dvr_session_config = parent_rpcs.update_dvr_session if parent_rpcs.respond_to? :update_dvr_session + @update_dvr_session = ::Gapic::Config::Method.new update_dvr_session_config + create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset + @create_asset = ::Gapic::Config::Method.new create_asset_config + delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset + @delete_asset = ::Gapic::Config::Method.new delete_asset_config + get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset + @get_asset = ::Gapic::Config::Method.new get_asset_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + get_pool_config = parent_rpcs.get_pool if parent_rpcs.respond_to? :get_pool + @get_pool = ::Gapic::Config::Method.new get_pool_config + update_pool_config = parent_rpcs.update_pool if parent_rpcs.respond_to? :update_pool + @update_pool = ::Gapic::Config::Method.new update_pool_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb new file mode 100644 index 000000000000..ebdda67ff801 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + module LivestreamService + # Credentials for the LivestreamService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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 +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb new file mode 100644 index 000000000000..dc29b6a405f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + module LivestreamService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the LivestreamService 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 LivestreamService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::Video::LiveStream::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? + throw :response, 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::Video::LiveStream::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? + throw :response, 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::Video::LiveStream::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? + 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::Video::LiveStream::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? + 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::Video::LiveStream::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? + throw :response, 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb new file mode 100644 index 000000000000..f3bbcf7af848 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + module LivestreamService + # Path helper methods for the LivestreamService API. + module Paths + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/assets/{asset}` + # + # @param project [String] + # @param location [String] + # @param asset [String] + # + # @return [::String] + def asset_path project:, location:, asset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/assets/#{asset}" + end + + ## + # Create a fully-qualified Channel resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/channels/{channel}` + # + # @param project [String] + # @param location [String] + # @param channel [String] + # + # @return [::String] + def channel_path project:, location:, channel: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/channels/#{channel}" + end + + ## + # Create a fully-qualified Clip resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}` + # + # @param project [String] + # @param location [String] + # @param channel [String] + # @param clip [String] + # + # @return [::String] + def clip_path project:, location:, channel:, clip: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "channel cannot contain /" if channel.to_s.include? "/" + + "projects/#{project}/locations/#{location}/channels/#{channel}/clips/#{clip}" + end + + ## + # Create a fully-qualified DvrSession resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/channels/{channel}/dvrSessions/{dvr_session}` + # + # @param project [String] + # @param location [String] + # @param channel [String] + # @param dvr_session [String] + # + # @return [::String] + def dvr_session_path project:, location:, channel:, dvr_session: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "channel cannot contain /" if channel.to_s.include? "/" + + "projects/#{project}/locations/#{location}/channels/#{channel}/dvrSessions/#{dvr_session}" + end + + ## + # Create a fully-qualified Event resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/channels/{channel}/events/{event}` + # + # @param project [String] + # @param location [String] + # @param channel [String] + # @param event [String] + # + # @return [::String] + def event_path project:, location:, channel:, event: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "channel cannot contain /" if channel.to_s.include? "/" + + "projects/#{project}/locations/#{location}/channels/#{channel}/events/#{event}" + end + + ## + # Create a fully-qualified Input resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/inputs/{input}` + # + # @param project [String] + # @param location [String] + # @param input [String] + # + # @return [::String] + def input_path project:, location:, input: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/inputs/#{input}" + 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 Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified Pool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/pools/{pool}` + # + # @param project [String] + # @param location [String] + # @param pool [String] + # + # @return [::String] + def pool_path project:, location:, pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/pools/#{pool}" + end + + ## + # Create a fully-qualified SecretVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{version}` + # + # @param project [String] + # @param secret [String] + # @param version [String] + # + # @return [::String] + def secret_version_path project:, secret:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{version}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb new file mode 100644 index 000000000000..54fae79a7d2a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/version" +require "google/cloud/video/live_stream/v1/bindings_override" + +require "google/cloud/video/live_stream/v1/livestream_service/credentials" +require "google/cloud/video/live_stream/v1/livestream_service/paths" +require "google/cloud/video/live_stream/v1/livestream_service/rest/operations" +require "google/cloud/video/live_stream/v1/livestream_service/rest/client" + +module Google + module Cloud + module Video + module LiveStream + module V1 + ## + # Using Live Stream API, you can generate live streams in the various + # renditions and streaming formats. The streaming format include HTTP Live + # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send + # a source stream in the various ways, including Real-Time Messaging + # Protocol (RTMP) and Secure Reliable Transport (SRT). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/video/live_stream/v1/livestream_service/rest" + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + module LivestreamService + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/video/live_stream/v1/livestream_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb new file mode 100644 index 000000000000..6704ac62a245 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb @@ -0,0 +1,4077 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" +require "google/cloud/video/live_stream/v1/livestream_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Video + module LiveStream + module V1 + module LivestreamService + module Rest + ## + # REST client for the LivestreamService service. + # + # Using Live Stream API, you can generate live streams in the various + # renditions and streaming formats. The streaming format include HTTP Live + # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send + # a source stream in the various ways, including Real-Time Messaging + # Protocol (RTMP) and Secure Reliable Transport (SRT). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :livestream_service_stub + + ## + # Configure the LivestreamService Client class. + # + # See {::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LivestreamService clients + # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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", "Video", "LiveStream", "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_channel.timeout = 60.0 + + default_config.rpcs.list_channels.timeout = 60.0 + default_config.rpcs.list_channels.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_channel.timeout = 60.0 + default_config.rpcs.get_channel.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_channel.timeout = 60.0 + + default_config.rpcs.update_channel.timeout = 60.0 + + default_config.rpcs.start_channel.timeout = 60.0 + + default_config.rpcs.stop_channel.timeout = 60.0 + + default_config.rpcs.start_distribution.timeout = 60.0 + + default_config.rpcs.stop_distribution.timeout = 60.0 + + default_config.rpcs.create_input.timeout = 60.0 + + default_config.rpcs.list_inputs.timeout = 60.0 + default_config.rpcs.list_inputs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_input.timeout = 60.0 + default_config.rpcs.get_input.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_input.timeout = 60.0 + + default_config.rpcs.update_input.timeout = 60.0 + + default_config.rpcs.preview_input.timeout = 60.0 + + default_config.rpcs.create_event.timeout = 60.0 + + default_config.rpcs.list_events.timeout = 60.0 + default_config.rpcs.list_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_event.timeout = 60.0 + default_config.rpcs.get_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_event.timeout = 60.0 + + default_config.rpcs.list_clips.timeout = 60.0 + default_config.rpcs.list_clips.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_clip.timeout = 60.0 + default_config.rpcs.get_clip.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_clip.timeout = 60.0 + + default_config.rpcs.delete_clip.timeout = 60.0 + + default_config.rpcs.create_dvr_session.timeout = 60.0 + + default_config.rpcs.list_dvr_sessions.timeout = 60.0 + default_config.rpcs.list_dvr_sessions.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_dvr_session.timeout = 60.0 + default_config.rpcs.get_dvr_session.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_dvr_session.timeout = 60.0 + + default_config.rpcs.update_dvr_session.timeout = 60.0 + + default_config.rpcs.create_asset.timeout = 60.0 + + default_config.rpcs.delete_asset.timeout = 60.0 + + default_config.rpcs.get_asset.timeout = 60.0 + default_config.rpcs.get_asset.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_assets.timeout = 60.0 + default_config.rpcs.list_assets.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_pool.timeout = 60.0 + default_config.rpcs.get_pool.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_pool.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LivestreamService 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::Video::LiveStream::V1::LivestreamService::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 + @livestream_service_stub.universe_domain + end + + ## + # Create a new LivestreamService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LivestreamService 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::Video::LiveStream::V1::LivestreamService::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 + + @livestream_service_stub = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @livestream_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @livestream_service_stub.endpoint + config.universe_domain = @livestream_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @livestream_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @livestream_service_stub.logger + end + + # Service calls + + ## + # Creates a channel with the provided unique ID in the specified + # region. + # + # @overload create_channel(request, options = nil) + # Pass arguments to `create_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(parent: nil, channel: nil, channel_id: nil, request_id: nil) + # Pass arguments to `create_channel` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] + # Required. The channel resource to be created. + # @param channel_id [::String] + # Required. The ID of the channel resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new + # + # # Call the create_channel method. + # result = client.create_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.create_channel request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all channels in the specified region. + # + # @overload list_channels(request, options = nil) + # Pass arguments to `list_channels` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channels(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_channels` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # The filter to apply to list results. + # @param order_by [::String] + # Specifies the ordering of results following syntax at + # https://cloud.google.com/apis/design/design_patterns#sorting_order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new + # + # # Call the list_channels method. + # result = client.list_channels 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::Video::LiveStream::V1::Channel. + # p item + # end + # + def list_channels request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest + + # Converts hash 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_channels.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::Video::LiveStream::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_channels.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_channels.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.list_channels request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_channels, "channels", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified channel. + # + # @overload get_channel(request, options = nil) + # Pass arguments to `get_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil) + # Pass arguments to `get_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Channel] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Channel] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new + # + # # Call the get_channel method. + # result = client.get_channel request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. + # p result + # + def get_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.get_channel request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified channel. + # + # @overload delete_channel(request, options = nil) + # Pass arguments to `delete_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @param force [::Boolean] + # If the `force` field is set to the default value of `false`, you must + # delete all of a channel's events before you can delete the channel itself. + # If the field is set to `true`, requests to delete a channel also delete + # associated channel events. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new + # + # # Call the delete_channel method. + # result = client.delete_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.delete_channel request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified channel. + # + # @overload update_channel(request, options = nil) + # Pass arguments to `update_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(update_mask: nil, channel: nil, request_id: nil) + # Pass arguments to `update_channel` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the Channel + # resource by the update. You can only update the following fields: + # + # * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + # * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) + # * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + # * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) + # * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + # * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + # * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + # * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + # * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + # * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the mask is not present, then each field from the list above is updated + # if the field appears in the request payload. To unset a field, add the + # field to the update mask and remove it from the request payload. + # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] + # Required. The channel resource to be updated. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new + # + # # Call the update_channel method. + # result = client.update_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.update_channel request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts the specified channel. Part of the video pipeline will be created + # only when the StartChannel request is received by the server. + # + # @overload start_channel(request, options = nil) + # Pass arguments to `start_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StartChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) + # Pass arguments to `start_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new + # + # # Call the start_channel method. + # result = client.start_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.start_channel request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops the specified channel. Part of the video pipeline will be released + # when the StopChannel request is received by the server. + # + # @overload stop_channel(request, options = nil) + # Pass arguments to `stop_channel` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StopChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) + # Pass arguments to `stop_channel` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new + # + # # Call the stop_channel method. + # result = client.stop_channel 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_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest + + # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.stop_channel request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts distribution which delivers outputs to the destination indicated by + # the Distribution configuration. + # + # @overload start_distribution(request, options = nil) + # Pass arguments to `start_distribution` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) + # Pass arguments to `start_distribution` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param distribution_keys [::Array<::String>] + # Optional. A list of keys to identify the distribution configuration in the + # channel resource. If left empty, all the distributions in the channel + # specification will be started. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new + # + # # Call the start_distribution method. + # result = client.start_distribution 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_distribution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest + + # Converts hash 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_distribution.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::Video::LiveStream::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_distribution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_distribution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.start_distribution request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops the specified distribution. + # + # @overload stop_distribution(request, options = nil) + # Pass arguments to `stop_distribution` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) + # Pass arguments to `stop_distribution` via keyword arguments. Note that at + # least one keyword argument is 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 channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param distribution_keys [::Array<::String>] + # Optional. A list of key to identify the distribution configuration in the + # channel resource. If left empty, all the distributions in the channel + # specification will be stopped. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new + # + # # Call the stop_distribution method. + # result = client.stop_distribution 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_distribution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest + + # Converts hash 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_distribution.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::Video::LiveStream::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_distribution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_distribution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.stop_distribution request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an input with the provided unique ID in the specified region. + # + # @overload create_input(request, options = nil) + # Pass arguments to `create_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(parent: nil, input: nil, input_id: nil, request_id: nil) + # Pass arguments to `create_input` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] + # Required. The input resource to be created. + # @param input_id [::String] + # Required. The ID of the input resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new + # + # # Call the create_input method. + # result = client.create_input 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_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.create_input request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all inputs in the specified region. + # + # @overload list_inputs(request, options = nil) + # Pass arguments to `list_inputs` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListInputsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_inputs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_inputs` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListInputsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # The filter to apply to list results. + # @param order_by [::String] + # Specifies the ordering of results following syntax at [Sorting + # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new + # + # # Call the list_inputs method. + # result = client.list_inputs 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::Video::LiveStream::V1::Input. + # p item + # end + # + def list_inputs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest + + # Converts hash 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_inputs.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::Video::LiveStream::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_inputs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_inputs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.list_inputs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_inputs, "inputs", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified input. + # + # @overload get_input(request, options = nil) + # Pass arguments to `get_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(name: nil) + # Pass arguments to `get_input` via keyword arguments. Note that at + # least one keyword argument is 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 input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Input] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Input] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new + # + # # Call the get_input method. + # result = client.get_input request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. + # p result + # + def get_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.get_input request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified input. + # + # @overload delete_input(request, options = nil) + # Pass arguments to `delete_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(name: nil, request_id: nil) + # Pass arguments to `delete_input` via keyword arguments. Note that at + # least one keyword argument is 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 input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new + # + # # Call the delete_input method. + # result = client.delete_input 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_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.delete_input request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified input. + # + # @overload update_input(request, options = nil) + # Pass arguments to `update_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_input(update_mask: nil, input: nil, request_id: nil) + # Pass arguments to `update_input` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the Input + # resource by the update. You can only update the following fields: + # + # * [`tier`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#Tier) + # * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + # * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the mask is not present, then each field from the list above is updated + # if the field appears in the request payload. To unset a field, add the + # field to the update mask and remove it from the request payload. + # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] + # Required. The input resource to be updated. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new + # + # # Call the update_input method. + # result = client.update_input 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_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest + + # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.update_input request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Preview the streaming content of the specified input. + # + # @overload preview_input(request, options = nil) + # Pass arguments to `preview_input` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload preview_input(name: nil) + # Pass arguments to `preview_input` via keyword arguments. Note that at + # least one keyword argument is 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 input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new + # + # # Call the preview_input method. + # result = client.preview_input request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::PreviewInputResponse. + # p result + # + def preview_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest + + # Converts hash 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.preview_input.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::Video::LiveStream::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.preview_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.preview_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.preview_input request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an event with the provided unique ID in the specified channel. + # + # @overload create_event(request, options = nil) + # Pass arguments to `create_event` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(parent: nil, event: nil, event_id: nil, request_id: nil) + # Pass arguments to `create_event` via keyword arguments. Note that at + # least one keyword argument is 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 channel for the resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param event [::Google::Cloud::Video::LiveStream::V1::Event, ::Hash] + # Required. The event resource to be created. + # @param event_id [::String] + # Required. The ID of the event resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Event] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new + # + # # Call the create_event method. + # result = client.create_event request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + # p result + # + def create_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest + + # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.create_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all events in the specified channel. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_events` via keyword arguments. Note that at + # least one keyword argument is 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 channel for the resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param page_size [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListEventsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @param page_token [::String] + # The next_page_token value returned from a previous List request, if any. + # @param filter [::String] + # The filter to apply to list results. + # @param order_by [::String] + # Specifies the ordering of results following syntax at + # https://cloud.google.com/apis/design/design_patterns#sorting_order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_events 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::Video::LiveStream::V1::Event. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest + + # Converts hash 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_events.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::Video::LiveStream::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_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.list_events request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_events, "events", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified event. + # + # @overload get_event(request, options = nil) + # Pass arguments to `get_event` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil) + # Pass arguments to `get_event` via keyword arguments. Note that at + # least one keyword argument is 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 event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Event] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new + # + # # Call the get_event method. + # result = client.get_event request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + # p result + # + def get_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetEventRequest + + # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.get_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified event. + # + # @overload delete_event(request, options = nil) + # Pass arguments to `delete_event` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) + # Pass arguments to `delete_event` via keyword arguments. Note that at + # least one keyword argument is 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 event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new + # + # # Call the delete_event method. + # result = client.delete_event request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest + + # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.delete_event request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all clips in the specified channel. + # + # @overload list_clips(request, options = nil) + # Pass arguments to `list_clips` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListClipsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clips(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clips` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListClipsRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new + # + # # Call the list_clips method. + # result = client.list_clips 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::Video::LiveStream::V1::Clip. + # p item + # end + # + def list_clips request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest + + # Converts hash 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_clips.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::Video::LiveStream::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_clips.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clips.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.list_clips request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_clips, "clips", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified clip. + # + # @overload get_clip(request, options = nil) + # Pass arguments to `get_clip` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetClipRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetClipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clip(name: nil) + # Pass arguments to `get_clip` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Clip] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Clip] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new + # + # # Call the get_clip method. + # result = client.get_clip request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip. + # p result + # + def get_clip request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetClipRequest + + # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_clip.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.get_clip request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a clip with the provided clip ID in the specified channel. + # + # @overload create_clip(request, options = nil) + # Pass arguments to `create_clip` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateClipRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clip(parent: nil, clip_id: nil, clip: nil, request_id: nil) + # Pass arguments to `create_clip` via keyword arguments. Note that at + # least one keyword argument is 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 name, in the following form: + # `projects/{project}/locations/{location}/channels/{channel}`. + # @param clip_id [::String] + # Required. The ID of the clip resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param clip [::Google::Cloud::Video::LiveStream::V1::Clip, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new + # + # # Call the create_clip method. + # result = client.create_clip 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_clip request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest + + # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_clip.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.create_clip request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified clip job resource. This method only deletes the clip + # job and does not delete the VOD clip stored in Cloud Storage. + # + # @overload delete_clip(request, options = nil) + # Pass arguments to `delete_clip` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clip(name: nil, request_id: nil) + # Pass arguments to `delete_clip` via keyword arguments. Note that at + # least one keyword argument is 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 clip resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new + # + # # Call the delete_clip method. + # result = client.delete_clip 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_clip request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest + + # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_clip.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.delete_clip request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a DVR session with the provided unique ID in the specified channel. + # + # @overload create_dvr_session(request, options = nil) + # Pass arguments to `create_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(parent: nil, dvr_session_id: nil, dvr_session: nil, request_id: nil) + # Pass arguments to `create_dvr_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 name, in the following form: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @param dvr_session_id [::String] + # Required. The ID of the DVR session resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new + # + # # Call the create_dvr_session method. + # result = client.create_dvr_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_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.create_dvr_session request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all DVR sessions in the specified channel. + # + # @overload list_dvr_sessions(request, options = nil) + # Pass arguments to `list_dvr_sessions` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_dvr_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. Parent value for ListDvrSessionsRequest + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.new + # + # # Call the list_dvr_sessions method. + # result = client.list_dvr_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::Video::LiveStream::V1::DvrSession. + # p item + # end + # + def list_dvr_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_sessions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_dvr_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.list_dvr_sessions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_dvr_sessions, "dvr_sessions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified DVR session. + # + # @overload get_dvr_session(request, options = nil) + # Pass arguments to `get_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(name: nil) + # Pass arguments to `get_dvr_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. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::DvrSession] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new + # + # # Call the get_dvr_session method. + # result = client.get_dvr_session request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::DvrSession. + # p result + # + def get_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.get_dvr_session request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified DVR session. + # + # @overload delete_dvr_session(request, options = nil) + # Pass arguments to `delete_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(name: nil, request_id: nil) + # Pass arguments to `delete_dvr_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 event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.new + # + # # Call the delete_dvr_session method. + # result = client.delete_dvr_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_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.delete_dvr_session request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified DVR session. + # + # @overload update_dvr_session(request, options = nil) + # Pass arguments to `update_dvr_session` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dvr_session(update_mask: nil, dvr_session: nil, request_id: nil) + # Pass arguments to `update_dvr_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # DvrSession resource by the update. You can only update the following + # fields: + # + # * `dvrWindows` + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] + # Required. The DVR session resource to be updated. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new + # + # # Call the update_dvr_session method. + # result = client.update_dvr_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 update_dvr_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest + + # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_dvr_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.update_dvr_session request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a Asset with the provided unique ID in the specified + # region. + # + # @overload create_asset(request, options = nil) + # Pass arguments to `create_asset` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil, request_id: nil) + # Pass arguments to `create_asset` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param asset [::Google::Cloud::Video::LiveStream::V1::Asset, ::Hash] + # Required. The asset resource to be created. + # @param asset_id [::String] + # Required. The ID of the asset resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new + # + # # Call the create_asset method. + # result = client.create_asset 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_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest + + # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.create_asset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the specified asset if it is not used. + # + # @overload delete_asset(request, options = nil) + # Pass arguments to `delete_asset` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil, request_id: nil) + # Pass arguments to `delete_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset resource, in the form of: + # `projects/{project}/locations/{location}/assets/{assetId}`. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new + # + # # Call the delete_asset method. + # result = client.delete_asset 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_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest + + # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.delete_asset request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified asset. + # + # @overload get_asset(request, options = nil) + # Pass arguments to `get_asset` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil) + # Pass arguments to `get_asset` via keyword arguments. Note that at + # least one keyword argument is 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. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/assets/{asset}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new + # + # # Call the get_asset method. + # result = client.get_asset request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset. + # p result + # + def get_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest + + # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.get_asset request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of all assets in the specified region. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is 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 location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets 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::Video::LiveStream::V1::Asset. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest + + # Converts hash 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_assets.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::Video::LiveStream::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_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.list_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_assets, "assets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the specified pool. + # + # @overload get_pool(request, options = nil) + # Pass arguments to `get_pool` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::GetPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pool(name: nil) + # Pass arguments to `get_pool` via keyword arguments. Note that at + # least one keyword argument is 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 pool resource, in the form of: + # `projects/{project}/locations/{location}/pools/{poolId}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Pool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Pool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new + # + # # Call the get_pool method. + # result = client.get_pool request + # + # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool. + # p result + # + def get_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest + + # Converts hash 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_pool.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::Video::LiveStream::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_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.get_pool request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the specified pool. + # + # @overload update_pool(request, options = nil) + # Pass arguments to `update_pool` via a request object, either of type + # {::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_pool(update_mask: nil, pool: nil, request_id: nil) + # Pass arguments to `update_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the Pool + # resource by the update. You can only update the following fields: + # + # * `networkConfig` + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # @param pool [::Google::Cloud::Video::LiveStream::V1::Pool, ::Hash] + # Required. The pool resource to be updated. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @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/video/live_stream/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new + # + # # Call the update_pool method. + # result = client.update_pool 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_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest + + # Converts hash 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_pool.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::Video::LiveStream::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_pool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @livestream_service_stub.update_pool request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the LivestreamService REST API. + # + # This class represents the configuration for LivestreamService 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::Video::LiveStream::V1::LivestreamService::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_channel to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_channel.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_channel.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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 LivestreamService 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_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :create_channel + ## + # RPC-specific configuration for `list_channels` + # @return [::Gapic::Config::Method] + # + attr_reader :list_channels + ## + # RPC-specific configuration for `get_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :get_channel + ## + # RPC-specific configuration for `delete_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_channel + ## + # RPC-specific configuration for `update_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :update_channel + ## + # RPC-specific configuration for `start_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :start_channel + ## + # RPC-specific configuration for `stop_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_channel + ## + # RPC-specific configuration for `start_distribution` + # @return [::Gapic::Config::Method] + # + attr_reader :start_distribution + ## + # RPC-specific configuration for `stop_distribution` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_distribution + ## + # RPC-specific configuration for `create_input` + # @return [::Gapic::Config::Method] + # + attr_reader :create_input + ## + # RPC-specific configuration for `list_inputs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_inputs + ## + # RPC-specific configuration for `get_input` + # @return [::Gapic::Config::Method] + # + attr_reader :get_input + ## + # RPC-specific configuration for `delete_input` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_input + ## + # RPC-specific configuration for `update_input` + # @return [::Gapic::Config::Method] + # + attr_reader :update_input + ## + # RPC-specific configuration for `preview_input` + # @return [::Gapic::Config::Method] + # + attr_reader :preview_input + ## + # RPC-specific configuration for `create_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `get_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event + ## + # RPC-specific configuration for `delete_event` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event + ## + # RPC-specific configuration for `list_clips` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clips + ## + # RPC-specific configuration for `get_clip` + # @return [::Gapic::Config::Method] + # + attr_reader :get_clip + ## + # RPC-specific configuration for `create_clip` + # @return [::Gapic::Config::Method] + # + attr_reader :create_clip + ## + # RPC-specific configuration for `delete_clip` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_clip + ## + # RPC-specific configuration for `create_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_dvr_session + ## + # RPC-specific configuration for `list_dvr_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_dvr_sessions + ## + # RPC-specific configuration for `get_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dvr_session + ## + # RPC-specific configuration for `delete_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_dvr_session + ## + # RPC-specific configuration for `update_dvr_session` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dvr_session + ## + # RPC-specific configuration for `create_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_asset + ## + # RPC-specific configuration for `delete_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_asset + ## + # RPC-specific configuration for `get_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_asset + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `get_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_pool + ## + # RPC-specific configuration for `update_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_pool + + # @private + def initialize parent_rpcs = nil + create_channel_config = parent_rpcs.create_channel if parent_rpcs.respond_to? :create_channel + @create_channel = ::Gapic::Config::Method.new create_channel_config + list_channels_config = parent_rpcs.list_channels if parent_rpcs.respond_to? :list_channels + @list_channels = ::Gapic::Config::Method.new list_channels_config + get_channel_config = parent_rpcs.get_channel if parent_rpcs.respond_to? :get_channel + @get_channel = ::Gapic::Config::Method.new get_channel_config + delete_channel_config = parent_rpcs.delete_channel if parent_rpcs.respond_to? :delete_channel + @delete_channel = ::Gapic::Config::Method.new delete_channel_config + update_channel_config = parent_rpcs.update_channel if parent_rpcs.respond_to? :update_channel + @update_channel = ::Gapic::Config::Method.new update_channel_config + start_channel_config = parent_rpcs.start_channel if parent_rpcs.respond_to? :start_channel + @start_channel = ::Gapic::Config::Method.new start_channel_config + stop_channel_config = parent_rpcs.stop_channel if parent_rpcs.respond_to? :stop_channel + @stop_channel = ::Gapic::Config::Method.new stop_channel_config + start_distribution_config = parent_rpcs.start_distribution if parent_rpcs.respond_to? :start_distribution + @start_distribution = ::Gapic::Config::Method.new start_distribution_config + stop_distribution_config = parent_rpcs.stop_distribution if parent_rpcs.respond_to? :stop_distribution + @stop_distribution = ::Gapic::Config::Method.new stop_distribution_config + create_input_config = parent_rpcs.create_input if parent_rpcs.respond_to? :create_input + @create_input = ::Gapic::Config::Method.new create_input_config + list_inputs_config = parent_rpcs.list_inputs if parent_rpcs.respond_to? :list_inputs + @list_inputs = ::Gapic::Config::Method.new list_inputs_config + get_input_config = parent_rpcs.get_input if parent_rpcs.respond_to? :get_input + @get_input = ::Gapic::Config::Method.new get_input_config + delete_input_config = parent_rpcs.delete_input if parent_rpcs.respond_to? :delete_input + @delete_input = ::Gapic::Config::Method.new delete_input_config + update_input_config = parent_rpcs.update_input if parent_rpcs.respond_to? :update_input + @update_input = ::Gapic::Config::Method.new update_input_config + preview_input_config = parent_rpcs.preview_input if parent_rpcs.respond_to? :preview_input + @preview_input = ::Gapic::Config::Method.new preview_input_config + create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event + @create_event = ::Gapic::Config::Method.new create_event_config + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event + @get_event = ::Gapic::Config::Method.new get_event_config + delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event + @delete_event = ::Gapic::Config::Method.new delete_event_config + list_clips_config = parent_rpcs.list_clips if parent_rpcs.respond_to? :list_clips + @list_clips = ::Gapic::Config::Method.new list_clips_config + get_clip_config = parent_rpcs.get_clip if parent_rpcs.respond_to? :get_clip + @get_clip = ::Gapic::Config::Method.new get_clip_config + create_clip_config = parent_rpcs.create_clip if parent_rpcs.respond_to? :create_clip + @create_clip = ::Gapic::Config::Method.new create_clip_config + delete_clip_config = parent_rpcs.delete_clip if parent_rpcs.respond_to? :delete_clip + @delete_clip = ::Gapic::Config::Method.new delete_clip_config + create_dvr_session_config = parent_rpcs.create_dvr_session if parent_rpcs.respond_to? :create_dvr_session + @create_dvr_session = ::Gapic::Config::Method.new create_dvr_session_config + list_dvr_sessions_config = parent_rpcs.list_dvr_sessions if parent_rpcs.respond_to? :list_dvr_sessions + @list_dvr_sessions = ::Gapic::Config::Method.new list_dvr_sessions_config + get_dvr_session_config = parent_rpcs.get_dvr_session if parent_rpcs.respond_to? :get_dvr_session + @get_dvr_session = ::Gapic::Config::Method.new get_dvr_session_config + delete_dvr_session_config = parent_rpcs.delete_dvr_session if parent_rpcs.respond_to? :delete_dvr_session + @delete_dvr_session = ::Gapic::Config::Method.new delete_dvr_session_config + update_dvr_session_config = parent_rpcs.update_dvr_session if parent_rpcs.respond_to? :update_dvr_session + @update_dvr_session = ::Gapic::Config::Method.new update_dvr_session_config + create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset + @create_asset = ::Gapic::Config::Method.new create_asset_config + delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset + @delete_asset = ::Gapic::Config::Method.new delete_asset_config + get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset + @get_asset = ::Gapic::Config::Method.new get_asset_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + get_pool_config = parent_rpcs.get_pool if parent_rpcs.respond_to? :get_pool + @get_pool = ::Gapic::Config::Method.new get_pool_config + update_pool_config = parent_rpcs.update_pool if parent_rpcs.respond_to? :update_pool + @update_pool = ::Gapic::Config::Method.new update_pool_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb new file mode 100644 index 000000000000..8db54d1cdab6 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb @@ -0,0 +1,927 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + module LivestreamService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the LivestreamService 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 LivestreamService 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @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::Video::LiveStream::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? + throw :response, 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::Video::LiveStream::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? + throw :response, 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::Video::LiveStream::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? + 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::Video::LiveStream::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? + 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "livestream.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "cancel_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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/[^/]+/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/[^/]+/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", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb new file mode 100644 index 000000000000..544178ad6b12 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb @@ -0,0 +1,2172 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" + +module Google + module Cloud + module Video + module LiveStream + module V1 + module LivestreamService + module Rest + ## + # REST service stub for the LivestreamService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the create_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest] + # 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_channel request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_channel_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, + method_name: "create_channel", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_channels REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest] + # 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::Video::LiveStream::V1::ListChannelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse] + # A result object deserialized from the server's reply + def list_channels request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_channels_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, + method_name: "list_channels", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest] + # 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::Video::LiveStream::V1::Channel] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Channel] + # A result object deserialized from the server's reply + def get_channel request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_channel_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, + method_name: "get_channel", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Channel.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest] + # 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_channel request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_channel_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, + method_name: "delete_channel", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest] + # 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_channel request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_channel_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, + method_name: "update_channel", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the start_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest] + # 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_channel request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_channel_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, + method_name: "start_channel", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stop_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest] + # 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_channel request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_channel_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, + method_name: "stop_channel", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the start_distribution REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest] + # 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_distribution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_distribution_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, + method_name: "start_distribution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stop_distribution REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest] + # 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_distribution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_distribution_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, + method_name: "stop_distribution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest] + # 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_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_input_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, + method_name: "create_input", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_inputs REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest] + # 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::Video::LiveStream::V1::ListInputsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse] + # A result object deserialized from the server's reply + def list_inputs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_inputs_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, + method_name: "list_inputs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetInputRequest] + # 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::Video::LiveStream::V1::Input] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Input] + # A result object deserialized from the server's reply + def get_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_input_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, + method_name: "get_input", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Input.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest] + # 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_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_input_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, + method_name: "delete_input", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest] + # 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_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_input_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, + method_name: "update_input", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the preview_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest] + # 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::Video::LiveStream::V1::PreviewInputResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] + # A result object deserialized from the server's reply + def preview_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_preview_input_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, + method_name: "preview_input", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_event REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest] + # 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::Video::LiveStream::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Event] + # A result object deserialized from the server's reply + def create_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_event_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, + method_name: "create_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_events REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest] + # 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::Video::LiveStream::V1::ListEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse] + # A result object deserialized from the server's reply + def list_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_events_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, + method_name: "list_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_event REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetEventRequest] + # 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::Video::LiveStream::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Event] + # A result object deserialized from the server's reply + def get_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_event_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, + method_name: "get_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_event REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest] + # 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_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_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, + method_name: "delete_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_clips REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest] + # 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::Video::LiveStream::V1::ListClipsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListClipsResponse] + # A result object deserialized from the server's reply + def list_clips request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clips_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, + method_name: "list_clips", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_clip REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetClipRequest] + # 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::Video::LiveStream::V1::Clip] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Clip] + # A result object deserialized from the server's reply + def get_clip request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_clip_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, + method_name: "get_clip", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Clip.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_clip REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest] + # 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_clip request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_clip_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, + method_name: "create_clip", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_clip REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest] + # 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_clip request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_clip_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, + method_name: "delete_clip", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest] + # 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_dvr_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_dvr_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, + method_name: "create_dvr_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_dvr_sessions REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest] + # 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::Video::LiveStream::V1::ListDvrSessionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse] + # A result object deserialized from the server's reply + def list_dvr_sessions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_dvr_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, + method_name: "list_dvr_sessions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest] + # 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::Video::LiveStream::V1::DvrSession] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] + # A result object deserialized from the server's reply + def get_dvr_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dvr_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, + method_name: "get_dvr_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::DvrSession.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest] + # 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_dvr_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_dvr_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, + method_name: "delete_dvr_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest] + # 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_dvr_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_dvr_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, + method_name: "update_dvr_session", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_asset REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest] + # 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_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_asset_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, + method_name: "create_asset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_asset REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest] + # 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_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_asset_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, + method_name: "delete_asset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_asset REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest] + # 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::Video::LiveStream::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Asset] + # A result object deserialized from the server's reply + def get_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_asset_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, + method_name: "get_asset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Asset.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_assets REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest] + # 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::Video::LiveStream::V1::ListAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse] + # A result object deserialized from the server's reply + def list_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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, + method_name: "list_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_pool REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest] + # 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::Video::LiveStream::V1::Pool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Video::LiveStream::V1::Pool] + # A result object deserialized from the server's reply + def get_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_pool_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, + method_name: "get_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Video::LiveStream::V1::Pool.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_pool REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest] + # 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_pool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_pool_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, + method_name: "update_pool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the create_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest] + # 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_channel_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/channels", + body: "channel", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_channels REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest] + # 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_channels_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/channels", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest] + # 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_channel_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest] + # 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_channel_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest] + # 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_channel_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{channel.name}", + body: "channel", + matches: [ + ["channel.name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest] + # 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_channel_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:start", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_channel REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest] + # 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_channel_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_distribution REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest] + # 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_distribution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:startdistribution", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_distribution REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest] + # 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_distribution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:stopdistribution", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest] + # 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_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/inputs", + body: "input", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_inputs REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest] + # 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_inputs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/inputs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetInputRequest] + # 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_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest] + # 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_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest] + # 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_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{input.name}", + body: "input", + matches: [ + ["input.name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the preview_input REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_preview_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:preview", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_event REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest] + # 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_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/events", + body: "event", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_events REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest] + # 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_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/events", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_event REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetEventRequest] + # 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_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/events/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_event REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest] + # 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_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/events/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_clips REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest] + # 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_clips_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/clips", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_clip REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetClipRequest] + # 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_clip_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/clips/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_clip REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest] + # 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_clip_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/clips", + body: "clip", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_clip REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest] + # 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_clip_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/clips/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest] + # 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_dvr_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/dvrSessions", + body: "dvr_session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_dvr_sessions REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest] + # 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_dvr_sessions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/dvrSessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest] + # 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_dvr_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/dvrSessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest] + # 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_dvr_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/dvrSessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_dvr_session REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest] + # 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_dvr_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{dvr_session.name}", + body: "dvr_session", + matches: [ + ["dvr_session.name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/dvrSessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_asset REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest] + # 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_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assets", + body: "asset", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_asset REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest] + # 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_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_asset REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest] + # 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_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_assets REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest] + # 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_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/assets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_pool REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest] + # 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_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/pools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_pool REST call + # + # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest] + # 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_pool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{pool.name}", + body: "pool", + matches: [ + ["pool.name", %r{^projects/[^/]+/locations/[^/]+/pools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb new file mode 100644 index 000000000000..ed1016097c8a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/livestream_service/rest" +require "google/cloud/video/live_stream/v1/bindings_override" +require "google/cloud/video/live_stream/v1/version" + +module Google + module Cloud + module Video + module LiveStream + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/video/live_stream/v1/rest" + # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new + # + module V1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb new file mode 100644 index 000000000000..cdd336eff66a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb new file mode 100644 index 000000000000..32a936f375d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/video/livestream/v1/outputs.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/rpc/status_pb' +require 'google/type/datetime_pb' + + +descriptor_data = "\n.google/cloud/video/livestream/v1/outputs.proto\x12 google.cloud.video.livestream.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x17google/rpc/status.proto\x1a\x1agoogle/type/datetime.proto\"\x87\x02\n\x10\x45lementaryStream\x12\x0b\n\x03key\x18\x04 \x01(\t\x12\x45\n\x0cvideo_stream\x18\x01 \x01(\x0b\x32-.google.cloud.video.livestream.v1.VideoStreamH\x00\x12\x45\n\x0c\x61udio_stream\x18\x02 \x01(\x0b\x32-.google.cloud.video.livestream.v1.AudioStreamH\x00\x12\x43\n\x0btext_stream\x18\x03 \x01(\x0b\x32,.google.cloud.video.livestream.v1.TextStreamH\x00\x42\x13\n\x11\x65lementary_stream\"\xab\x01\n\tMuxStream\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x03 \x01(\t\x12\x1a\n\x12\x65lementary_streams\x18\x04 \x03(\t\x12K\n\x10segment_settings\x18\x05 \x01(\x0b\x32\x31.google.cloud.video.livestream.v1.SegmentSettings\x12\x15\n\rencryption_id\x18\x06 \x01(\t\"\xce\x02\n\x08Manifest\x12\x11\n\tfile_name\x18\x01 \x01(\t\x12J\n\x04type\x18\x02 \x01(\x0e\x32\x37.google.cloud.video.livestream.v1.Manifest.ManifestTypeB\x03\xe0\x41\x02\x12\x18\n\x0bmux_streams\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12\x19\n\x11max_segment_count\x18\x04 \x01(\x05\x12\x38\n\x15segment_keep_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12 \n\x18use_timecode_as_timeline\x18\x06 \x01(\x08\x12\x10\n\x03key\x18\x07 \x01(\tB\x03\xe0\x41\x01\"@\n\x0cManifestType\x12\x1d\n\x19MANIFEST_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03HLS\x10\x01\x12\x08\n\x04\x44\x41SH\x10\x02\"_\n\x12\x44istributionStream\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tcontainer\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12\x65lementary_streams\x18\x03 \x03(\tB\x03\xe0\x41\x02\"\xc7\x03\n\x0c\x44istribution\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13\x64istribution_stream\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x05state\x18\x03 \x01(\x0e\x32\x34.google.cloud.video.livestream.v1.Distribution.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12K\n\x08srt_push\x18\x05 \x01(\x0b\x32\x37.google.cloud.video.livestream.v1.SrtPushOutputEndpointH\x00\x12M\n\trtmp_push\x18\x06 \x01(\x0b\x32\x38.google.cloud.video.livestream.v1.RtmpPushOutputEndpointH\x00\"i\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45RROR\x10\x05\x12\r\n\tNOT_READY\x10\x06\x12\t\n\x05READY\x10\x07\x12\x12\n\x0e\x41WAITING_INPUT\x10\x08\x12\x10\n\x0c\x44ISTRIBUTING\x10\tB\n\n\x08\x65ndpoint\"\x94\x01\n\x15SrtPushOutputEndpoint\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\x19passphrase_secret_version\x18\x02 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersionH\x00\x42\x13\n\x11passphrase_source\"C\n\x16RtmpPushOutputEndpoint\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nstream_key\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xe3\x01\n\x0bSpriteSheet\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\x12\x18\n\x0b\x66ile_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13sprite_width_pixels\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\x12!\n\x14sprite_height_pixels\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x14\n\x0c\x63olumn_count\x18\x05 \x01(\x05\x12\x11\n\trow_count\x18\x06 \x01(\x05\x12+\n\x08interval\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0f\n\x07quality\x18\x08 \x01(\x05\"\xc5\x03\n\x13PreprocessingConfig\x12J\n\x05\x61udio\x18\x01 \x01(\x0b\x32;.google.cloud.video.livestream.v1.PreprocessingConfig.Audio\x12H\n\x04\x63rop\x18\x02 \x01(\x0b\x32:.google.cloud.video.livestream.v1.PreprocessingConfig.Crop\x12\x46\n\x03pad\x18\x03 \x01(\x0b\x32\x39.google.cloud.video.livestream.v1.PreprocessingConfig.Pad\x1a\x15\n\x05\x41udio\x12\x0c\n\x04lufs\x18\x01 \x01(\x01\x1a\\\n\x04\x43rop\x12\x12\n\ntop_pixels\x18\x01 \x01(\x05\x12\x15\n\rbottom_pixels\x18\x02 \x01(\x05\x12\x13\n\x0bleft_pixels\x18\x03 \x01(\x05\x12\x14\n\x0cright_pixels\x18\x04 \x01(\x05\x1a[\n\x03Pad\x12\x12\n\ntop_pixels\x18\x01 \x01(\x05\x12\x15\n\rbottom_pixels\x18\x02 \x01(\x05\x12\x13\n\x0bleft_pixels\x18\x03 \x01(\x05\x12\x14\n\x0cright_pixels\x18\x04 \x01(\x05\"\xbe\x07\n\x0bVideoStream\x12O\n\x04h264\x18\x14 \x01(\x0b\x32?.google.cloud.video.livestream.v1.VideoStream.H264CodecSettingsH\x00\x12O\n\x04h265\x18\x15 \x01(\x0b\x32?.google.cloud.video.livestream.v1.VideoStream.H265CodecSettingsH\x00\x1a\x8c\x03\n\x11H264CodecSettings\x12\x14\n\x0cwidth_pixels\x18\x01 \x01(\x05\x12\x15\n\rheight_pixels\x18\x02 \x01(\x05\x12\x17\n\nframe_rate\x18\x03 \x01(\x01\x42\x03\xe0\x41\x02\x12\x18\n\x0b\x62itrate_bps\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\x0e\x61llow_open_gop\x18\x06 \x01(\x08\x12\x19\n\x0fgop_frame_count\x18\x07 \x01(\x05H\x00\x12\x31\n\x0cgop_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x15\n\rvbv_size_bits\x18\t \x01(\x05\x12\x19\n\x11vbv_fullness_bits\x18\n \x01(\x05\x12\x15\n\rentropy_coder\x18\x0b \x01(\t\x12\x11\n\tb_pyramid\x18\x0c \x01(\x08\x12\x15\n\rb_frame_count\x18\r \x01(\x05\x12\x13\n\x0b\x61q_strength\x18\x0e \x01(\x01\x12\x0f\n\x07profile\x18\x0f \x01(\t\x12\x0c\n\x04tune\x18\x10 \x01(\tB\n\n\x08gop_mode\x1a\xeb\x02\n\x11H265CodecSettings\x12\x19\n\x0cwidth_pixels\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1a\n\rheight_pixels\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\nframe_rate\x18\x03 \x01(\x01\x42\x03\xe0\x41\x02\x12\x18\n\x0b\x62itrate_bps\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1e\n\x0fgop_frame_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x12\x36\n\x0cgop_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x00\x12\x1a\n\rvbv_size_bits\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11vbv_fullness_bits\x18\n \x01(\x05\x42\x03\xe0\x41\x01\x12\x16\n\tb_pyramid\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rb_frame_count\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x61q_strength\x18\r \x01(\x01\x42\x03\xe0\x41\x01\x42\n\n\x08gop_modeB\x10\n\x0e\x63odec_settings\"\xec\x02\n\x0b\x41udioStream\x12\x10\n\x08transmux\x18\x08 \x01(\x08\x12\r\n\x05\x63odec\x18\x01 \x01(\t\x12\x18\n\x0b\x62itrate_bps\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x15\n\rchannel_count\x18\x03 \x01(\x05\x12\x16\n\x0e\x63hannel_layout\x18\x04 \x03(\t\x12K\n\x07mapping\x18\x05 \x03(\x0b\x32:.google.cloud.video.livestream.v1.AudioStream.AudioMapping\x12\x19\n\x11sample_rate_hertz\x18\x06 \x01(\x05\x1a\x8a\x01\n\x0c\x41udioMapping\x12\x16\n\tinput_key\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0binput_track\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1a\n\rinput_channel\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1b\n\x0eoutput_channel\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x0f\n\x07gain_db\x18\x05 \x01(\x01\"\xcb\x02\n\nTextStream\x12\x12\n\x05\x63odec\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12output_cea_channel\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12N\n\x07mapping\x18\x03 \x03(\x0b\x32\x38.google.cloud.video.livestream.v1.TextStream.TextMappingB\x03\xe0\x41\x01\x1a\x80\x01\n\x0bTextMapping\x12\x16\n\tinput_key\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0binput_track\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11input_cea_channel\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x66rom_language_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\"F\n\x0fSegmentSettings\x12\x33\n\x10segment_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xac\x02\n\x0eTimecodeConfig\x12O\n\x06source\x18\x01 \x01(\x0e\x32?.google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource\x12/\n\nutc_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12*\n\ttime_zone\x18\x03 \x01(\x0b\x32\x15.google.type.TimeZoneH\x00\"]\n\x0eTimecodeSource\x12\x1f\n\x1bTIMECODE_SOURCE_UNSPECIFIED\x10\x00\x12\x13\n\x0fMEDIA_TIMESTAMP\x10\x01\x12\x15\n\x11\x45MBEDDED_TIMECODE\x10\x02\x42\r\n\x0btime_offsetB\xe9\x01\n$com.google.cloud.video.livestream.v1B\x0cOutputsProtoP\x01ZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb\xaa\x02 Google.Cloud.Video.LiveStream.V1\xca\x02 Google\\Cloud\\Video\\LiveStream\\V1\xea\x02$Google::Cloud::Video::LiveStream::V1b\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.rpc.Status", "google/rpc/status.proto"], + ["google.type.TimeZone", "google/type/datetime.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 Video + module LiveStream + module V1 + ElementaryStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ElementaryStream").msgclass + MuxStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.MuxStream").msgclass + Manifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Manifest").msgclass + Manifest::ManifestType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Manifest.ManifestType").enummodule + DistributionStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DistributionStream").msgclass + Distribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Distribution").msgclass + Distribution::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Distribution.State").enummodule + SrtPushOutputEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.SrtPushOutputEndpoint").msgclass + RtmpPushOutputEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.RtmpPushOutputEndpoint").msgclass + SpriteSheet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.SpriteSheet").msgclass + PreprocessingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig").msgclass + PreprocessingConfig::Audio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig.Audio").msgclass + PreprocessingConfig::Crop = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig.Crop").msgclass + PreprocessingConfig::Pad = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig.Pad").msgclass + VideoStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStream").msgclass + VideoStream::H264CodecSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStream.H264CodecSettings").msgclass + VideoStream::H265CodecSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStream.H265CodecSettings").msgclass + AudioStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioStream").msgclass + AudioStream::AudioMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioStream.AudioMapping").msgclass + TextStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TextStream").msgclass + TextStream::TextMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TextStream.TextMapping").msgclass + SegmentSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.SegmentSettings").msgclass + TimecodeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TimecodeConfig").msgclass + TimecodeConfig::TimecodeSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource").enummodule + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb new file mode 100644 index 000000000000..eb89852aecb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/video/livestream/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/video/livestream/v1/outputs_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n0google/cloud/video/livestream/v1/resources.proto\x12 google.cloud.video.livestream.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/video/livestream/v1/outputs.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x98\x07\n\x05Input\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Input.LabelsEntry\x12:\n\x04type\x18\x05 \x01(\x0e\x32,.google.cloud.video.livestream.v1.Input.Type\x12:\n\x04tier\x18\x0e \x01(\x0e\x32,.google.cloud.video.livestream.v1.Input.Tier\x12\x10\n\x03uri\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12S\n\x14preprocessing_config\x18\t \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.PreprocessingConfig\x12L\n\x0esecurity_rules\x18\x0c \x01(\x0b\x32\x34.google.cloud.video.livestream.v1.Input.SecurityRule\x12Y\n\x15input_stream_property\x18\x0f \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.InputStreamPropertyB\x03\xe0\x41\x03\x1a!\n\x0cSecurityRule\x12\x11\n\tip_ranges\x18\x01 \x03(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"9\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tRTMP_PUSH\x10\x01\x12\x0c\n\x08SRT_PUSH\x10\x02\"]\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x06\n\x02SD\x10\x01\x12\x06\n\x02HD\x10\x02\x12\x07\n\x03UHD\x10\x03\x12\x0b\n\x07SD_H265\x10\x04\x12\x0b\n\x07HD_H265\x10\x05\x12\x0c\n\x08UHD_H265\x10\x06:\\\xea\x41Y\n\x1flivestream.googleapis.com/Input\x12\x36projects/{project}/locations/{location}/inputs/{input}\"\xb4\x0e\n\x07\x43hannel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x06labels\x18\x04 \x03(\x0b\x32\x35.google.cloud.video.livestream.v1.Channel.LabelsEntry\x12L\n\x11input_attachments\x18\x10 \x03(\x0b\x32\x31.google.cloud.video.livestream.v1.InputAttachment\x12\x19\n\x0c\x61\x63tive_input\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x45\n\x06output\x18\t \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.Channel.OutputB\x03\xe0\x41\x02\x12N\n\x12\x65lementary_streams\x18\n \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.ElementaryStream\x12@\n\x0bmux_streams\x18\x0b \x03(\x0b\x32+.google.cloud.video.livestream.v1.MuxStream\x12=\n\tmanifests\x18\x0c \x03(\x0b\x32*.google.cloud.video.livestream.v1.Manifest\x12W\n\x14\x64istribution_streams\x18\x1c \x03(\x0b\x32\x34.google.cloud.video.livestream.v1.DistributionStreamB\x03\xe0\x41\x01\x12J\n\rdistributions\x18\x1d \x03(\x0b\x32..google.cloud.video.livestream.v1.DistributionB\x03\xe0\x41\x01\x12\x44\n\rsprite_sheets\x18\r \x03(\x0b\x32-.google.cloud.video.livestream.v1.SpriteSheet\x12V\n\x0fstreaming_state\x18\x0e \x01(\x0e\x32\x38.google.cloud.video.livestream.v1.Channel.StreamingStateB\x03\xe0\x41\x03\x12\x30\n\x0fstreaming_error\x18\x12 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12?\n\nlog_config\x18\x13 \x01(\x0b\x32+.google.cloud.video.livestream.v1.LogConfig\x12I\n\x0ftimecode_config\x18\x15 \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.TimecodeConfig\x12\x46\n\x0b\x65ncryptions\x18\x18 \x03(\x0b\x32,.google.cloud.video.livestream.v1.EncryptionB\x03\xe0\x41\x01\x12\x43\n\x0cinput_config\x18\x19 \x01(\x0b\x32-.google.cloud.video.livestream.v1.InputConfig\x12P\n\x10retention_config\x18\x1a \x01(\x0b\x32\x31.google.cloud.video.livestream.v1.RetentionConfigB\x03\xe0\x41\x01\x12M\n\x0fstatic_overlays\x18\x1b \x03(\x0b\x32/.google.cloud.video.livestream.v1.StaticOverlayB\x03\xe0\x41\x01\x12\x61\n\x19\x61uto_transcription_config\x18\x1e \x01(\x0b\x32\x39.google.cloud.video.livestream.v1.AutoTranscriptionConfigB\x03\xe0\x41\x01\x1a\x15\n\x06Output\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xaa\x01\n\x0eStreamingState\x12\x1f\n\x1bSTREAMING_STATE_UNSPECIFIED\x10\x00\x12\r\n\tSTREAMING\x10\x01\x12\x12\n\x0e\x41WAITING_INPUT\x10\x02\x12\x13\n\x0fSTREAMING_ERROR\x10\x04\x12\x16\n\x12STREAMING_NO_INPUT\x10\x05\x12\x0b\n\x07STOPPED\x10\x06\x12\x0c\n\x08STARTING\x10\x07\x12\x0c\n\x08STOPPING\x10\x08:b\xea\x41_\n!livestream.googleapis.com/Channel\x12:projects/{project}/locations/{location}/channels/{channel}\"6\n\x14NormalizedCoordinate\x12\x0e\n\x01x\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x0e\n\x01y\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"6\n\x14NormalizedResolution\x12\x0e\n\x01w\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x0e\n\x01h\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"\xfd\x01\n\rStaticOverlay\x12\x36\n\x05\x61sset\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Asset\x12O\n\nresolution\x18\x02 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.NormalizedResolutionB\x03\xe0\x41\x01\x12M\n\x08position\x18\x03 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.NormalizedCoordinateB\x03\xe0\x41\x01\x12\x14\n\x07opacity\x18\x04 \x01(\x01\x42\x03\xe0\x41\x01\"\xc6\x01\n\x0bInputConfig\x12X\n\x11input_switch_mode\x18\x01 \x01(\x0e\x32=.google.cloud.video.livestream.v1.InputConfig.InputSwitchMode\"]\n\x0fInputSwitchMode\x12!\n\x1dINPUT_SWITCH_MODE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x46\x41ILOVER_PREFER_PRIMARY\x10\x01\x12\n\n\x06MANUAL\x10\x03\"\xc0\x01\n\tLogConfig\x12M\n\x0clog_severity\x18\x01 \x01(\x0e\x32\x37.google.cloud.video.livestream.v1.LogConfig.LogSeverity\"d\n\x0bLogSeverity\x12\x1c\n\x18LOG_SEVERITY_UNSPECIFIED\x10\x00\x12\x07\n\x03OFF\x10\x01\x12\t\n\x05\x44\x45\x42UG\x10\x64\x12\t\n\x04INFO\x10\xc8\x01\x12\x0c\n\x07WARNING\x10\x90\x03\x12\n\n\x05\x45RROR\x10\xf4\x03\"O\n\x0fRetentionConfig\x12<\n\x19retention_window_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xea\x01\n\x13InputStreamProperty\x12\x37\n\x13last_establish_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12L\n\rvideo_streams\x18\x02 \x03(\x0b\x32\x35.google.cloud.video.livestream.v1.VideoStreamProperty\x12L\n\raudio_streams\x18\x03 \x03(\x0b\x32\x35.google.cloud.video.livestream.v1.AudioStreamProperty\"i\n\x13VideoStreamProperty\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x43\n\x0cvideo_format\x18\x02 \x01(\x0b\x32-.google.cloud.video.livestream.v1.VideoFormat\"]\n\x0bVideoFormat\x12\r\n\x05\x63odec\x18\x01 \x01(\t\x12\x14\n\x0cwidth_pixels\x18\x02 \x01(\x05\x12\x15\n\rheight_pixels\x18\x03 \x01(\x05\x12\x12\n\nframe_rate\x18\x04 \x01(\x01\"i\n\x13\x41udioStreamProperty\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x43\n\x0c\x61udio_format\x18\x02 \x01(\x0b\x32-.google.cloud.video.livestream.v1.AudioFormat\"K\n\x0b\x41udioFormat\x12\r\n\x05\x63odec\x18\x01 \x01(\t\x12\x15\n\rchannel_count\x18\x02 \x01(\x05\x12\x16\n\x0e\x63hannel_layout\x18\x03 \x03(\t\"\xdd\x01\n\x0fInputAttachment\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x33\n\x05input\x18\x02 \x01(\tB$\xfa\x41!\n\x1flivestream.googleapis.com/Input\x12_\n\x12\x61utomatic_failover\x18\x03 \x01(\x0b\x32\x43.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover\x1a\'\n\x11\x41utomaticFailover\x12\x12\n\ninput_keys\x18\x01 \x03(\t\"\x99\x03\n\x17\x41utoTranscriptionConfig\x12\x64\n\x0e\x64isplay_timing\x18\x01 \x01(\x0e\x32G.google.cloud.video.livestream.v1.AutoTranscriptionConfig.DisplayTimingB\x03\xe0\x41\x01\x12\x64\n\x0equality_preset\x18\x02 \x01(\x0e\x32G.google.cloud.video.livestream.v1.AutoTranscriptionConfig.QualityPresetB\x03\xe0\x41\x01\"D\n\rDisplayTiming\x12\x1e\n\x1a\x44ISPLAY_TIMING_UNSPECIFIED\x10\x00\x12\t\n\x05\x41SYNC\x10\x01\x12\x08\n\x04SYNC\x10\x02\"l\n\rQualityPreset\x12\x1e\n\x1aQUALITY_PRESET_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLOW_LATENCY\x10\x01\x12\x14\n\x10\x42\x41LANCED_QUALITY\x10\x02\x12\x14\n\x10IMPROVED_QUALITY\x10\x03\"\xc6\x0c\n\x05\x45vent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Event.LabelsEntry\x12O\n\x0cinput_switch\x18\x05 \x01(\x0b\x32\x37.google.cloud.video.livestream.v1.Event.InputSwitchTaskH\x00\x12G\n\x08\x61\x64_break\x18\x06 \x01(\x0b\x32\x33.google.cloud.video.livestream.v1.Event.AdBreakTaskH\x00\x12X\n\x11return_to_program\x18\r \x01(\x0b\x32;.google.cloud.video.livestream.v1.Event.ReturnToProgramTaskH\x00\x12\x42\n\x05slate\x18\x0e \x01(\x0b\x32\x31.google.cloud.video.livestream.v1.Event.SlateTaskH\x00\x12@\n\x04mute\x18\x0f \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.Event.MuteTaskH\x00\x12\x44\n\x06unmute\x18\x10 \x01(\x0b\x32\x32.google.cloud.video.livestream.v1.Event.UnmuteTaskH\x00\x12[\n\x12update_encryptions\x18\x11 \x01(\x0b\x32=.google.cloud.video.livestream.v1.Event.UpdateEncryptionsTaskH\x00\x12\x13\n\x0b\x65xecute_now\x18\t \x01(\x08\x12\x32\n\x0e\x65xecution_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x05state\x18\x0b \x01(\x0e\x32-.google.cloud.video.livestream.v1.Event.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0c \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a$\n\x0fInputSwitchTask\x12\x11\n\tinput_key\x18\x01 \x01(\t\x1a:\n\x0b\x41\x64\x42reakTask\x12+\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1am\n\tSlateTask\x12+\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\x05\x61sset\x18\x02 \x01(\tB$\xfa\x41!\n\x1flivestream.googleapis.com/Asset\x1a\x15\n\x13ReturnToProgramTask\x1a\x37\n\x08MuteTask\x12+\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\x0c\n\nUnmuteTask\x1a\x65\n\x15UpdateEncryptionsTask\x12L\n\x0b\x65ncryptions\x18\x01 \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.EncryptionUpdateB\x03\xe0\x41\x02\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"o\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tSCHEDULED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07PENDING\x10\x05\x12\x0b\n\x07STOPPED\x10\x06:o\xea\x41l\n\x1flivestream.googleapis.com/Event\x12Iprojects/{project}/locations/{location}/channels/{channel}/events/{event}B\x06\n\x04task\"\x96\t\n\x04\x43lip\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x06labels\x18\x05 \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.Clip.LabelsEntry\x12@\n\x05state\x18\x06 \x01(\x0e\x32,.google.cloud.video.livestream.v1.Clip.StateB\x03\xe0\x41\x03\x12\x12\n\noutput_uri\x18\x07 \x01(\t\x12&\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12<\n\x06slices\x18\n \x03(\x0b\x32,.google.cloud.video.livestream.v1.Clip.Slice\x12P\n\x0e\x63lip_manifests\x18\x0c \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Clip.ClipManifestB\x03\xe0\x41\x02\x12K\n\x0boutput_type\x18\r \x01(\x0e\x32\x31.google.cloud.video.livestream.v1.Clip.OutputTypeB\x03\xe0\x41\x01\x1an\n\tTimeSlice\x12/\n\x0bmarkin_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cmarkout_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aW\n\x05Slice\x12\x46\n\ntime_slice\x18\x01 \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.Clip.TimeSliceH\x00\x42\x06\n\x04kind\x1a\x42\n\x0c\x43lipManifest\x12\x19\n\x0cmanifest_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\noutput_uri\x18\x02 \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\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\"@\n\nOutputType\x12\x1b\n\x17OUTPUT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08MANIFEST\x10\x01\x12\x07\n\x03MP4\x10\x02:l\xea\x41i\n\x1elivestream.googleapis.com/Clip\x12Gprojects/{project}/locations/{location}/channels/{channel}/clips/{clip}\"v\n\x0cTimeInterval\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x8c\x08\n\nDvrSession\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x06labels\x18\x04 \x03(\x0b\x32\x38.google.cloud.video.livestream.v1.DvrSession.LabelsEntryB\x03\xe0\x41\x01\x12\x46\n\x05state\x18\x05 \x01(\x0e\x32\x32.google.cloud.video.livestream.v1.DvrSession.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12T\n\rdvr_manifests\x18\x07 \x03(\x0b\x32\x38.google.cloud.video.livestream.v1.DvrSession.DvrManifestB\x03\xe0\x41\x02\x12P\n\x0b\x64vr_windows\x18\x08 \x03(\x0b\x32\x36.google.cloud.video.livestream.v1.DvrSession.DvrWindowB\x03\xe0\x41\x02\x1a\x41\n\x0b\x44vrManifest\x12\x19\n\x0cmanifest_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\noutput_uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\\\n\tDvrWindow\x12G\n\rtime_interval\x18\x01 \x01(\x0b\x32..google.cloud.video.livestream.v1.TimeIntervalH\x00\x42\x06\n\x04kind\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xab\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0c\n\x08UPDATING\x10\x02\x12\r\n\tSCHEDULED\x10\x03\x12\x08\n\x04LIVE\x10\x04\x12\x0c\n\x08\x46INISHED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x0c\n\x08\x44\x45LETING\x10\x07\x12\x13\n\x0fPOST_PROCESSING\x10\x08\x12\x0c\n\x08\x43OOLDOWN\x10\t\x12\x0c\n\x08STOPPING\x10\n:\x99\x01\xea\x41\x95\x01\n$livestream.googleapis.com/DvrSession\x12Tprojects/{project}/locations/{location}/channels/{channel}/dvrSessions/{dvr_session}*\x0b\x64vrSessions2\ndvrSession\"\xed\x05\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Asset.LabelsEntry\x12\x43\n\x05video\x18\x05 \x01(\x0b\x32\x32.google.cloud.video.livestream.v1.Asset.VideoAssetH\x00\x12\x43\n\x05image\x18\x06 \x01(\x0b\x32\x32.google.cloud.video.livestream.v1.Asset.ImageAssetH\x00\x12\x0e\n\x06\x63rc32c\x18\x07 \x01(\t\x12\x41\n\x05state\x18\x08 \x01(\x0e\x32-.google.cloud.video.livestream.v1.Asset.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\x19\n\nVideoAsset\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a\x19\n\nImageAsset\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\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\x0c\n\x08\x44\x45LETING\x10\x03\x12\t\n\x05\x45RROR\x10\x04:\\\xea\x41Y\n\x1flivestream.googleapis.com/Asset\x12\x36projects/{project}/locations/{location}/assets/{asset}B\n\n\x08resource\"\xb1\x08\n\nEncryption\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x19secret_manager_key_source\x18\x07 \x01(\x0b\x32@.google.cloud.video.livestream.v1.Encryption.SecretManagerSourceH\x00\x12Q\n\x0b\x64rm_systems\x18\x03 \x01(\x0b\x32\x37.google.cloud.video.livestream.v1.Encryption.DrmSystemsB\x03\xe0\x41\x02\x12O\n\x06\x61\x65s128\x18\x04 \x01(\x0b\x32=.google.cloud.video.livestream.v1.Encryption.Aes128EncryptionH\x01\x12V\n\nsample_aes\x18\x05 \x01(\x0b\x32@.google.cloud.video.livestream.v1.Encryption.SampleAesEncryptionH\x01\x12V\n\tmpeg_cenc\x18\x06 \x01(\x0b\x32\x41.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryptionH\x01\x1a\x61\n\x13SecretManagerSource\x12J\n\x0esecret_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x1a\n\n\x08Widevine\x1a\n\n\x08\x46\x61irplay\x1a\x0b\n\tPlayready\x1a\n\n\x08\x43learkey\x1a\xc6\x02\n\nDrmSystems\x12L\n\x08widevine\x18\x01 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.WidevineB\x03\xe0\x41\x01\x12L\n\x08\x66\x61irplay\x18\x02 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.FairplayB\x03\xe0\x41\x01\x12N\n\tplayready\x18\x03 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.Encryption.PlayreadyB\x03\xe0\x41\x01\x12L\n\x08\x63learkey\x18\x04 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.ClearkeyB\x03\xe0\x41\x01\x1a\x12\n\x10\x41\x65s128Encryption\x1a\x15\n\x13SampleAesEncryption\x1a+\n\x14MpegCommonEncryption\x12\x13\n\x06scheme\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x0f\n\rsecret_sourceB\x11\n\x0f\x65ncryption_mode\"\x9b\x01\n\x10\x45ncryptionUpdate\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x19secret_manager_key_source\x18\x02 \x01(\x0b\x32@.google.cloud.video.livestream.v1.Encryption.SecretManagerSourceH\x00\x42\x0f\n\rsecret_source\"\xea\x03\n\x04Pool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x06labels\x18\x04 \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.Pool.LabelsEntry\x12L\n\x0enetwork_config\x18\x05 \x01(\x0b\x32\x34.google.cloud.video.livestream.v1.Pool.NetworkConfig\x1aL\n\rNetworkConfig\x12;\n\x0epeered_network\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Y\xea\x41V\n\x1elivestream.googleapis.com/Pool\x12\x34projects/{project}/locations/{location}/pools/{pool}B\xeb\x01\n$com.google.cloud.video.livestream.v1B\x0eResourcesProtoP\x01ZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb\xaa\x02 Google.Cloud.Video.LiveStream.V1\xca\x02 Google\\Cloud\\Video\\LiveStream\\V1\xea\x02$Google::Cloud::Video::LiveStream::V1b\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.video.livestream.v1.PreprocessingConfig", "google/cloud/video/livestream/v1/outputs.proto"], + ["google.rpc.Status", "google/rpc/status.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 Video + module LiveStream + module V1 + Input = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input").msgclass + Input::SecurityRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input.SecurityRule").msgclass + Input::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input.Type").enummodule + Input::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input.Tier").enummodule + Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Channel").msgclass + Channel::Output = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Channel.Output").msgclass + Channel::StreamingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Channel.StreamingState").enummodule + NormalizedCoordinate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.NormalizedCoordinate").msgclass + NormalizedResolution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.NormalizedResolution").msgclass + StaticOverlay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StaticOverlay").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputConfig").msgclass + InputConfig::InputSwitchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputConfig.InputSwitchMode").enummodule + LogConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.LogConfig").msgclass + LogConfig::LogSeverity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.LogConfig.LogSeverity").enummodule + RetentionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.RetentionConfig").msgclass + InputStreamProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputStreamProperty").msgclass + VideoStreamProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStreamProperty").msgclass + VideoFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoFormat").msgclass + AudioStreamProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioStreamProperty").msgclass + AudioFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioFormat").msgclass + InputAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputAttachment").msgclass + InputAttachment::AutomaticFailover = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover").msgclass + AutoTranscriptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AutoTranscriptionConfig").msgclass + AutoTranscriptionConfig::DisplayTiming = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AutoTranscriptionConfig.DisplayTiming").enummodule + AutoTranscriptionConfig::QualityPreset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AutoTranscriptionConfig.QualityPreset").enummodule + Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event").msgclass + Event::InputSwitchTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.InputSwitchTask").msgclass + Event::AdBreakTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.AdBreakTask").msgclass + Event::SlateTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.SlateTask").msgclass + Event::ReturnToProgramTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.ReturnToProgramTask").msgclass + Event::MuteTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.MuteTask").msgclass + Event::UnmuteTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.UnmuteTask").msgclass + Event::UpdateEncryptionsTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.UpdateEncryptionsTask").msgclass + Event::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.State").enummodule + Clip = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip").msgclass + Clip::TimeSlice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.TimeSlice").msgclass + Clip::Slice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.Slice").msgclass + Clip::ClipManifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.ClipManifest").msgclass + Clip::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.State").enummodule + Clip::OutputType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.OutputType").enummodule + TimeInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TimeInterval").msgclass + DvrSession = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession").msgclass + DvrSession::DvrManifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession.DvrManifest").msgclass + DvrSession::DvrWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession.DvrWindow").msgclass + DvrSession::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession.State").enummodule + Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset").msgclass + Asset::VideoAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset.VideoAsset").msgclass + Asset::ImageAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset.ImageAsset").msgclass + Asset::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset.State").enummodule + Encryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption").msgclass + Encryption::SecretManagerSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.SecretManagerSource").msgclass + Encryption::Widevine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Widevine").msgclass + Encryption::Fairplay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Fairplay").msgclass + Encryption::Playready = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Playready").msgclass + Encryption::Clearkey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Clearkey").msgclass + Encryption::DrmSystems = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.DrmSystems").msgclass + Encryption::Aes128Encryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Aes128Encryption").msgclass + Encryption::SampleAesEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.SampleAesEncryption").msgclass + Encryption::MpegCommonEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption").msgclass + EncryptionUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.EncryptionUpdate").msgclass + Pool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Pool").msgclass + Pool::NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Pool.NetworkConfig").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb new file mode 100644 index 000000000000..c2580d3154ce --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/video/livestream/v1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/video/livestream/v1/resources_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/video/livestream/v1/service.proto\x12 google.cloud.video.livestream.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/video/livestream/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb5\x01\n\x12\x43reateAssetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Asset\x12;\n\x05\x61sset\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.AssetB\x03\xe0\x41\x02\x12\x15\n\x08\x61sset_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"_\n\x12\x44\x65leteAssetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Asset\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x95\x01\n\x11ListAssetsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Asset\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x12ListAssetsResponse\x12\x37\n\x06\x61ssets\x18\x01 \x03(\x0b\x32\'.google.cloud.video.livestream.v1.Asset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x0fGetAssetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Asset\"\xbf\x01\n\x14\x43reateChannelRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!livestream.googleapis.com/Channel\x12?\n\x07\x63hannel\x18\x02 \x01(\x0b\x32).google.cloud.video.livestream.v1.ChannelB\x03\xe0\x41\x02\x12\x17\n\nchannel_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x99\x01\n\x13ListChannelsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!livestream.googleapis.com/Channel\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x81\x01\n\x14ListChannelsResponse\x12;\n\x08\x63hannels\x18\x01 \x03(\x0b\x32).google.cloud.video.livestream.v1.Channel\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x11GetChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\"r\n\x14\x44\x65leteChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x12\n\nrequest_id\x18\x02 \x01(\t\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"\x9c\x01\n\x14UpdateChannelRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12?\n\x07\x63hannel\x18\x02 \x01(\x0b\x32).google.cloud.video.livestream.v1.ChannelB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"b\n\x13StartChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"a\n\x12StopChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x94\x01\n\x18StartDistributionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x1e\n\x11\x64istribution_keys\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x93\x01\n\x17StopDistributionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x1e\n\x11\x64istribution_keys\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xb5\x01\n\x12\x43reateInputRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Input\x12;\n\x05input\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.InputB\x03\xe0\x41\x02\x12\x15\n\x08input_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x95\x01\n\x11ListInputsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Input\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x12ListInputsResponse\x12\x37\n\x06inputs\x18\x01 \x03(\x0b\x32\'.google.cloud.video.livestream.v1.Input\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x0fGetInputRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Input\"_\n\x12\x44\x65leteInputRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Input\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x96\x01\n\x12UpdateInputRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12;\n\x05input\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.InputB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"\xb5\x01\n\x12\x43reateEventRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Event\x12;\n\x05\x65vent\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.EventB\x03\xe0\x41\x02\x12\x15\n\x08\x65vent_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x95\x01\n\x11ListEventsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Event\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x12ListEventsResponse\x12\x37\n\x06\x65vents\x18\x01 \x03(\x0b\x32\'.google.cloud.video.livestream.v1.Event\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x0fGetEventRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Event\"_\n\x12\x44\x65leteEventRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Event\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x1a\n\x18\x43hannelOperationResponse\"\x93\x01\n\x10ListClipsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1elivestream.googleapis.com/Clip\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"x\n\x11ListClipsResponse\x12\x35\n\x05\x63lips\x18\x01 \x03(\x0b\x32&.google.cloud.video.livestream.v1.Clip\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"F\n\x0eGetClipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elivestream.googleapis.com/Clip\"\xb5\x01\n\x11\x43reateClipRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1elivestream.googleapis.com/Clip\x12\x14\n\x07\x63lip_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x04\x63lip\x18\x03 \x01(\x0b\x32&.google.cloud.video.livestream.v1.ClipB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"j\n\x11\x44\x65leteClipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elivestream.googleapis.com/Clip\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xb3\x01\n\x16ListDvrSessionsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$livestream.googleapis.com/DvrSession\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\"\x8b\x01\n\x17ListDvrSessionsResponse\x12\x42\n\x0c\x64vr_sessions\x18\x01 \x03(\x0b\x32,.google.cloud.video.livestream.v1.DvrSession\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"R\n\x14GetDvrSessionRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$livestream.googleapis.com/DvrSession\"\xdd\x01\n\x17\x43reateDvrSessionRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$livestream.googleapis.com/DvrSession\x12\x1b\n\x0e\x64vr_session_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x0b\x64vr_session\x18\x03 \x01(\x0b\x32,.google.cloud.video.livestream.v1.DvrSessionB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17\x44\x65leteDvrSessionRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$livestream.googleapis.com/DvrSession\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xb8\x01\n\x17UpdateDvrSessionRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x46\n\x0b\x64vr_session\x18\x02 \x01(\x0b\x32,.google.cloud.video.livestream.v1.DvrSessionB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xe3\x01\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x06 \x01(\tB\x03\xe0\x41\x03\"F\n\x0eGetPoolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elivestream.googleapis.com/Pool\"\x93\x01\n\x11UpdatePoolRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x39\n\x04pool\x18\x02 \x01(\x0b\x32&.google.cloud.video.livestream.v1.PoolB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"L\n\x13PreviewInputRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Input\"9\n\x14PreviewInputResponse\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x14\n\x0c\x62\x65\x61rer_token\x18\x02 \x01(\t2\xb8\x37\n\x11LivestreamService\x12\xe0\x01\n\rCreateChannel\x12\x36.google.cloud.video.livestream.v1.CreateChannelRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\xda\x41\x19parent,channel,channel_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/channels:\x07\x63hannel\x12\xbc\x01\n\x0cListChannels\x12\x35.google.cloud.video.livestream.v1.ListChannelsRequest\x1a\x36.google.cloud.video.livestream.v1.ListChannelsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/channels\x12\xa9\x01\n\nGetChannel\x12\x33.google.cloud.video.livestream.v1.GetChannelRequest\x1a).google.cloud.video.livestream.v1.Channel\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/channels/*}\x12\xd0\x01\n\rDeleteChannel\x12\x36.google.cloud.video.livestream.v1.DeleteChannelRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/channels/*}\x12\xe2\x01\n\rUpdateChannel\x12\x36.google.cloud.video.livestream.v1.UpdateChannelRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\xda\x41\x13\x63hannel,update_mask\x82\xd3\xe4\x93\x02?24/v1/{channel.name=projects/*/locations/*/channels/*}:\x07\x63hannel\x12\xda\x01\n\x0cStartChannel\x12\x35.google.cloud.video.livestream.v1.StartChannelRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\"2/v1/{name=projects/*/locations/*/channels/*}:start:\x01*\x12\xd7\x01\n\x0bStopChannel\x12\x34.google.cloud.video.livestream.v1.StopChannelRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/channels/*}:stop:\x01*\x12\x83\x02\n\x11StartDistribution\x12:.google.cloud.video.livestream.v1.StartDistributionRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x16name,distribution_keys\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/channels/*}:startdistribution:\x01*\x12\x80\x02\n\x10StopDistribution\x12\x39.google.cloud.video.livestream.v1.StopDistributionRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x16name,distribution_keys\x82\xd3\xe4\x93\x02\x42\"=/v1/{name=projects/*/locations/*/channels/*}:stopdistribution:\x01*\x12\xd2\x01\n\x0b\x43reateInput\x12\x34.google.cloud.video.livestream.v1.CreateInputRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\xda\x41\x15parent,input,input_id\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/inputs:\x05input\x12\xb4\x01\n\nListInputs\x12\x33.google.cloud.video.livestream.v1.ListInputsRequest\x1a\x34.google.cloud.video.livestream.v1.ListInputsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/inputs\x12\xa1\x01\n\x08GetInput\x12\x31.google.cloud.video.livestream.v1.GetInputRequest\x1a\'.google.cloud.video.livestream.v1.Input\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/inputs/*}\x12\xca\x01\n\x0b\x44\x65leteInput\x12\x34.google.cloud.video.livestream.v1.DeleteInputRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/inputs/*}\x12\xd4\x01\n\x0bUpdateInput\x12\x34.google.cloud.video.livestream.v1.UpdateInputRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\xda\x41\x11input,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{input.name=projects/*/locations/*/inputs/*}:\x05input\x12\xc3\x01\n\x0cPreviewInput\x12\x35.google.cloud.video.livestream.v1.PreviewInputRequest\x1a\x36.google.cloud.video.livestream.v1.PreviewInputResponse\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\"2/v1/{name=projects/*/locations/*/inputs/*}:preview:\x01*\x12\xca\x01\n\x0b\x43reateEvent\x12\x34.google.cloud.video.livestream.v1.CreateEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"\\\xda\x41\x15parent,event,event_id\x82\xd3\xe4\x93\x02>\"5/v1/{parent=projects/*/locations/*/channels/*}/events:\x05\x65vent\x12\xbf\x01\n\nListEvents\x12\x33.google.cloud.video.livestream.v1.ListEventsRequest\x1a\x34.google.cloud.video.livestream.v1.ListEventsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/channels/*}/events\x12\xac\x01\n\x08GetEvent\x12\x31.google.cloud.video.livestream.v1.GetEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/channels/*/events/*}\x12\xa1\x01\n\x0b\x44\x65leteEvent\x12\x34.google.cloud.video.livestream.v1.DeleteEventRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/channels/*/events/*}\x12\xbb\x01\n\tListClips\x12\x32.google.cloud.video.livestream.v1.ListClipsRequest\x1a\x33.google.cloud.video.livestream.v1.ListClipsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*/channels/*}/clips\x12\xa8\x01\n\x07GetClip\x12\x30.google.cloud.video.livestream.v1.GetClipRequest\x1a&.google.cloud.video.livestream.v1.Clip\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/channels/*/clips/*}\x12\xd6\x01\n\nCreateClip\x12\x33.google.cloud.video.livestream.v1.CreateClipRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41\x19\n\x04\x43lip\x12\x11OperationMetadata\xda\x41\x13parent,clip,clip_id\x82\xd3\xe4\x93\x02<\"4/v1/{parent=projects/*/locations/*/channels/*}/clips:\x04\x63lip\x12\xd2\x01\n\nDeleteClip\x12\x33.google.cloud.video.livestream.v1.DeleteClipRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/channels/*/clips/*}\x12\x84\x02\n\x10\x43reateDvrSession\x12\x39.google.cloud.video.livestream.v1.CreateDvrSessionRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41\x1f\n\nDvrSession\x12\x11OperationMetadata\xda\x41!parent,dvr_session,dvr_session_id\x82\xd3\xe4\x93\x02I\":/v1/{parent=projects/*/locations/*/channels/*}/dvrSessions:\x0b\x64vr_session\x12\xd3\x01\n\x0fListDvrSessions\x12\x38.google.cloud.video.livestream.v1.ListDvrSessionsRequest\x1a\x39.google.cloud.video.livestream.v1.ListDvrSessionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/*/channels/*}/dvrSessions\x12\xc0\x01\n\rGetDvrSession\x12\x36.google.cloud.video.livestream.v1.GetDvrSessionRequest\x1a,.google.cloud.video.livestream.v1.DvrSession\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/*/channels/*/dvrSessions/*}\x12\xe4\x01\n\x10\x44\x65leteDvrSession\x12\x39.google.cloud.video.livestream.v1.DeleteDvrSessionRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<*:/v1/{name=projects/*/locations/*/channels/*/dvrSessions/*}\x12\x86\x02\n\x10UpdateDvrSession\x12\x39.google.cloud.video.livestream.v1.UpdateDvrSessionRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41\x1f\n\nDvrSession\x12\x11OperationMetadata\xda\x41\x17\x64vr_session,update_mask\x82\xd3\xe4\x93\x02U2F/v1/{dvr_session.name=projects/*/locations/*/channels/*/dvrSessions/*}:\x0b\x64vr_session\x12\xd2\x01\n\x0b\x43reateAsset\x12\x34.google.cloud.video.livestream.v1.CreateAssetRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1a\n\x05\x41sset\x12\x11OperationMetadata\xda\x41\x15parent,asset,asset_id\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/assets:\x05\x61sset\x12\xca\x01\n\x0b\x44\x65leteAsset\x12\x34.google.cloud.video.livestream.v1.DeleteAssetRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/assets/*}\x12\xa1\x01\n\x08GetAsset\x12\x31.google.cloud.video.livestream.v1.GetAssetRequest\x1a\'.google.cloud.video.livestream.v1.Asset\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/assets/*}\x12\xb4\x01\n\nListAssets\x12\x33.google.cloud.video.livestream.v1.ListAssetsRequest\x1a\x34.google.cloud.video.livestream.v1.ListAssetsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/assets\x12\x9d\x01\n\x07GetPool\x12\x30.google.cloud.video.livestream.v1.GetPoolRequest\x1a&.google.cloud.video.livestream.v1.Pool\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/pools/*}\x12\xcd\x01\n\nUpdatePool\x12\x33.google.cloud.video.livestream.v1.UpdatePoolRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41\x19\n\x04Pool\x12\x11OperationMetadata\xda\x41\x10pool,update_mask\x82\xd3\xe4\x93\x02\x36\x32./v1/{pool.name=projects/*/locations/*/pools/*}:\x04pool\x1aM\xca\x41\x19livestream.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa1\x03\n$com.google.cloud.video.livestream.v1B\x0cServiceProtoP\x01ZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb\xaa\x02 Google.Cloud.Video.LiveStream.V1\xca\x02 Google\\Cloud\\Video\\LiveStream\\V1\xea\x02$Google::Cloud::Video::LiveStream::V1\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}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.video.livestream.v1.Asset", "google/cloud/video/livestream/v1/resources.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.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 Video + module LiveStream + module V1 + CreateAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateAssetRequest").msgclass + DeleteAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteAssetRequest").msgclass + ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListAssetsRequest").msgclass + ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListAssetsResponse").msgclass + GetAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetAssetRequest").msgclass + CreateChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateChannelRequest").msgclass + ListChannelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListChannelsRequest").msgclass + ListChannelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListChannelsResponse").msgclass + GetChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetChannelRequest").msgclass + DeleteChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteChannelRequest").msgclass + UpdateChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdateChannelRequest").msgclass + StartChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StartChannelRequest").msgclass + StopChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StopChannelRequest").msgclass + StartDistributionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StartDistributionRequest").msgclass + StopDistributionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StopDistributionRequest").msgclass + CreateInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateInputRequest").msgclass + ListInputsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListInputsRequest").msgclass + ListInputsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListInputsResponse").msgclass + GetInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetInputRequest").msgclass + DeleteInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteInputRequest").msgclass + UpdateInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdateInputRequest").msgclass + CreateEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateEventRequest").msgclass + ListEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListEventsRequest").msgclass + ListEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListEventsResponse").msgclass + GetEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetEventRequest").msgclass + DeleteEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteEventRequest").msgclass + ChannelOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ChannelOperationResponse").msgclass + ListClipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListClipsRequest").msgclass + ListClipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListClipsResponse").msgclass + GetClipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetClipRequest").msgclass + CreateClipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateClipRequest").msgclass + DeleteClipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteClipRequest").msgclass + ListDvrSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListDvrSessionsRequest").msgclass + ListDvrSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListDvrSessionsResponse").msgclass + GetDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetDvrSessionRequest").msgclass + CreateDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateDvrSessionRequest").msgclass + DeleteDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteDvrSessionRequest").msgclass + UpdateDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdateDvrSessionRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.OperationMetadata").msgclass + GetPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetPoolRequest").msgclass + UpdatePoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdatePoolRequest").msgclass + PreviewInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreviewInputRequest").msgclass + PreviewInputResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreviewInputResponse").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb new file mode 100644 index 000000000000..23027c3880c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb @@ -0,0 +1,123 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/video/livestream/v1/service.proto for package 'Google.Cloud.Video.LiveStream.V1' +# Original file comments: +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.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/video/livestream/v1/service_pb' + +module Google + module Cloud + module Video + module LiveStream + module V1 + module LivestreamService + # Using Live Stream API, you can generate live streams in the various + # renditions and streaming formats. The streaming format include HTTP Live + # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send + # a source stream in the various ways, including Real-Time Messaging + # Protocol (RTMP) and Secure Reliable Transport (SRT). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.video.livestream.v1.LivestreamService' + + # Creates a channel with the provided unique ID in the specified + # region. + rpc :CreateChannel, ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, ::Google::Longrunning::Operation + # Returns a list of all channels in the specified region. + rpc :ListChannels, ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse + # Returns the specified channel. + rpc :GetChannel, ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, ::Google::Cloud::Video::LiveStream::V1::Channel + # Deletes the specified channel. + rpc :DeleteChannel, ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, ::Google::Longrunning::Operation + # Updates the specified channel. + rpc :UpdateChannel, ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, ::Google::Longrunning::Operation + # Starts the specified channel. Part of the video pipeline will be created + # only when the StartChannel request is received by the server. + rpc :StartChannel, ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, ::Google::Longrunning::Operation + # Stops the specified channel. Part of the video pipeline will be released + # when the StopChannel request is received by the server. + rpc :StopChannel, ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, ::Google::Longrunning::Operation + # Starts distribution which delivers outputs to the destination indicated by + # the Distribution configuration. + rpc :StartDistribution, ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, ::Google::Longrunning::Operation + # Stops the specified distribution. + rpc :StopDistribution, ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, ::Google::Longrunning::Operation + # Creates an input with the provided unique ID in the specified region. + rpc :CreateInput, ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, ::Google::Longrunning::Operation + # Returns a list of all inputs in the specified region. + rpc :ListInputs, ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse + # Returns the specified input. + rpc :GetInput, ::Google::Cloud::Video::LiveStream::V1::GetInputRequest, ::Google::Cloud::Video::LiveStream::V1::Input + # Deletes the specified input. + rpc :DeleteInput, ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, ::Google::Longrunning::Operation + # Updates the specified input. + rpc :UpdateInput, ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, ::Google::Longrunning::Operation + # Preview the streaming content of the specified input. + rpc :PreviewInput, ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse + # Creates an event with the provided unique ID in the specified channel. + rpc :CreateEvent, ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, ::Google::Cloud::Video::LiveStream::V1::Event + # Returns a list of all events in the specified channel. + rpc :ListEvents, ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse + # Returns the specified event. + rpc :GetEvent, ::Google::Cloud::Video::LiveStream::V1::GetEventRequest, ::Google::Cloud::Video::LiveStream::V1::Event + # Deletes the specified event. + rpc :DeleteEvent, ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, ::Google::Protobuf::Empty + # Returns a list of all clips in the specified channel. + rpc :ListClips, ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse + # Returns the specified clip. + rpc :GetClip, ::Google::Cloud::Video::LiveStream::V1::GetClipRequest, ::Google::Cloud::Video::LiveStream::V1::Clip + # Creates a clip with the provided clip ID in the specified channel. + rpc :CreateClip, ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, ::Google::Longrunning::Operation + # Deletes the specified clip job resource. This method only deletes the clip + # job and does not delete the VOD clip stored in Cloud Storage. + rpc :DeleteClip, ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, ::Google::Longrunning::Operation + # Creates a DVR session with the provided unique ID in the specified channel. + rpc :CreateDvrSession, ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, ::Google::Longrunning::Operation + # Returns a list of all DVR sessions in the specified channel. + rpc :ListDvrSessions, ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse + # Returns the specified DVR session. + rpc :GetDvrSession, ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, ::Google::Cloud::Video::LiveStream::V1::DvrSession + # Deletes the specified DVR session. + rpc :DeleteDvrSession, ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, ::Google::Longrunning::Operation + # Updates the specified DVR session. + rpc :UpdateDvrSession, ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, ::Google::Longrunning::Operation + # Creates a Asset with the provided unique ID in the specified + # region. + rpc :CreateAsset, ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, ::Google::Longrunning::Operation + # Deletes the specified asset if it is not used. + rpc :DeleteAsset, ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, ::Google::Longrunning::Operation + # Returns the specified asset. + rpc :GetAsset, ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, ::Google::Cloud::Video::LiveStream::V1::Asset + # Returns a list of all assets in the specified region. + rpc :ListAssets, ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse + # Returns the specified pool. + rpc :GetPool, ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, ::Google::Cloud::Video::LiveStream::V1::Pool + # Updates the specified pool. + rpc :UpdatePool, ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md new file mode 100644 index 000000000000..10dc79685a07 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Live Stream V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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-video-live_stream-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb new file mode 100644 index 000000000000..2da5118a4897 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb @@ -0,0 +1,788 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + # Encoding of an input element such as an audio, video, or text track. + # Elementary streams must be packaged before mapping and sharing between + # different output formats. + # @!attribute [rw] key + # @return [::String] + # A unique key for this elementary stream. The key must be 1-63 + # characters in length. The key must begin and end with a letter (regardless + # of case) or a number, but can contain dashes or underscores in between. + # @!attribute [rw] video_stream + # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream] + # Encoding of a video stream. + # + # Note: The following fields are mutually exclusive: `video_stream`, `audio_stream`, `text_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] audio_stream + # @return [::Google::Cloud::Video::LiveStream::V1::AudioStream] + # Encoding of an audio stream. + # + # Note: The following fields are mutually exclusive: `audio_stream`, `video_stream`, `text_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] text_stream + # @return [::Google::Cloud::Video::LiveStream::V1::TextStream] + # Encoding of a text stream. For example, closed captions or subtitles. + # + # Note: The following fields are mutually exclusive: `text_stream`, `video_stream`, `audio_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ElementaryStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Multiplexing settings for output stream. + # @!attribute [rw] key + # @return [::String] + # A unique key for this multiplexed stream. The key must be 1-63 + # characters in length. The key must begin and end with a letter (regardless + # of case) or a number, but can contain dashes or underscores in between. + # @!attribute [rw] container + # @return [::String] + # The container format. The default is `fmp4`. + # + # Supported container formats: + # + # - `fmp4` - the corresponding file extension is `.m4s` + # - `ts` - the corresponding file extension is `.ts` + # @!attribute [rw] elementary_streams + # @return [::Array<::String>] + # List of `ElementaryStream` + # {::Google::Cloud::Video::LiveStream::V1::ElementaryStream#key key}s multiplexed + # in this stream. + # + # - For `fmp4` container, must contain either one video or one audio stream. + # - For `ts` container, must contain exactly one audio stream and up to one + # video stream. + # @!attribute [rw] segment_settings + # @return [::Google::Cloud::Video::LiveStream::V1::SegmentSettings] + # Segment settings for `fmp4` and `ts`. + # @!attribute [rw] encryption_id + # @return [::String] + # Identifier of the encryption configuration to use. If omitted, output + # will be unencrypted. + class MuxStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Manifest configuration. + # @!attribute [rw] file_name + # @return [::String] + # The name of the generated file. The default is `manifest` with the + # extension suffix corresponding to the `Manifest` + # {::Google::Cloud::Video::LiveStream::V1::Manifest#type type}. If multiple + # manifests are added to the channel, each must have a unique file name. + # @!attribute [rw] type + # @return [::Google::Cloud::Video::LiveStream::V1::Manifest::ManifestType] + # Required. Type of the manifest, can be `HLS` or `DASH`. + # @!attribute [rw] mux_streams + # @return [::Array<::String>] + # Required. List of `MuxStream` + # {::Google::Cloud::Video::LiveStream::V1::MuxStream#key key}s that should appear + # in this manifest. + # + # - For HLS, either `fmp4` or `ts` mux streams can be specified but not + # mixed. + # - For DASH, only `fmp4` mux streams can be specified. + # @!attribute [rw] max_segment_count + # @return [::Integer] + # Maximum number of segments that this manifest holds. Once the manifest + # reaches this maximum number of segments, whenever a new segment is added to + # the manifest, the oldest segment will be removed from the manifest. + # The minimum value is 3 and the default value is 5. + # @!attribute [rw] segment_keep_duration + # @return [::Google::Protobuf::Duration] + # How long to keep a segment on the output Google Cloud Storage bucket after + # it is removed from the manifest. This field should be large enough to cover + # the manifest propagation delay. Otherwise, a player could receive 404 + # errors while accessing segments which are listed in the manifest that the + # player has, but were already deleted from the output Google Cloud Storage + # bucket. Default value is `60s`. + # + # If both segment_keep_duration and + # {::Google::Cloud::Video::LiveStream::V1::RetentionConfig#retention_window_duration RetentionConfig.retention_window_duration} + # are set, + # {::Google::Cloud::Video::LiveStream::V1::RetentionConfig#retention_window_duration RetentionConfig.retention_window_duration} + # is used and segment_keep_duration is ignored. + # @!attribute [rw] use_timecode_as_timeline + # @return [::Boolean] + # Whether to use the timecode, as specified in timecode config, when setting: + # + # - `availabilityStartTime` attribute in DASH manifests. + # - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. + # + # If false, ignore the input timecode and use the time from system clock + # when the manifest is first generated. This is the default behavior. + # @!attribute [rw] key + # @return [::String] + # Optional. A unique key for this manifest. + class Manifest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The manifest type can be either `HLS` or `DASH`. + module ManifestType + # The manifest type is not specified. + MANIFEST_TYPE_UNSPECIFIED = 0 + + # Create an `HLS` manifest. The corresponding file extension is `.m3u8`. + HLS = 1 + + # Create a `DASH` manifest. The corresponding file extension is `.mpd`. + DASH = 2 + end + end + + # Multiplexing settings for output streams used in + # {::Google::Cloud::Video::LiveStream::V1::Distribution Distribution}. + # @!attribute [rw] key + # @return [::String] + # Required. A unique key for this distribution stream. The key must be 1-63 + # characters in length. The key must begin and end with a letter (regardless + # of case) or a number, but can contain dashes or underscores in between. + # @!attribute [rw] container + # @return [::String] + # Required. The container format. + # + # Supported container formats: + # + # - `ts`, must contain exactly one audio stream and up to one video stream. + # - `flv`, must contain at most one audio stream and at most one video + # stream. + # @!attribute [rw] elementary_streams + # @return [::Array<::String>] + # Required. List of `ElementaryStream` + # {::Google::Cloud::Video::LiveStream::V1::ElementaryStream#key key}s multiplexed + # in this stream. Must contain at least one audio stream and up to one video + # stream. + class DistributionStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Distribution configuration. + # @!attribute [rw] key + # @return [::String] + # Required. A unique key for this distribution. The key must be 1-63 + # characters in length. The key must begin and end with a letter (regardless + # of case) or a number, but can contain dashes or underscores in between. + # @!attribute [rw] distribution_stream + # @return [::String] + # Required. `DistributionStream` + # {::Google::Cloud::Video::LiveStream::V1::DistributionStream#key key}s that should + # appear in this distribution output. + # + # - For SRT protocol, only `ts` distribution streams can be specified. + # - For RTMP protocol, only `flv` distribution streams can be specified. + # @!attribute [r] state + # @return [::Google::Cloud::Video::LiveStream::V1::Distribution::State] + # Output only. State of the distribution. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only present when the `state` is `ERROR`. The reason for the + # error state of the distribution. + # @!attribute [rw] srt_push + # @return [::Google::Cloud::Video::LiveStream::V1::SrtPushOutputEndpoint] + # Output endpoint using SRT_PUSH. + # + # Note: The following fields are mutually exclusive: `srt_push`, `rtmp_push`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] rtmp_push + # @return [::Google::Cloud::Video::LiveStream::V1::RtmpPushOutputEndpoint] + # Output endpoint using RTMP_PUSH. + # + # Note: The following fields are mutually exclusive: `rtmp_push`, `srt_push`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Distribution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of this distribution. + module State + # State is not specified. + STATE_UNSPECIFIED = 0 + + # Distribution has trouble to produce or deliver the output. + ERROR = 5 + + # Distribution is not ready to be started. + NOT_READY = 6 + + # Distribution is ready to be started. + READY = 7 + + # Distribution is already started and is waiting for input. + AWAITING_INPUT = 8 + + # Distribution is already started and is generating output. + DISTRIBUTING = 9 + end + end + + # Configurations for an output endpoint using SRT_PUSH as the streaming + # protocol. + # @!attribute [rw] uri + # @return [::String] + # Required. The full URI of the remote SRT server. + # @!attribute [rw] passphrase_secret_version + # @return [::String] + # The name of the Secret Version containing the SRT encryption passphrase, + # which is stored in Google Secret Manager. It should be in the format of + # `projects/{project}/secrets/{secret_id}/versions/{version_number}`. + class SrtPushOutputEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configurations for an output endpoint using RTMP_PUSH as the streaming + # protocol. + # @!attribute [rw] uri + # @return [::String] + # Required. The full URI of the remote RTMP server. For example: + # `rtmp://192.168.123.321/live/my-stream` or `rtmp://somedomain.com/someapp`. + # @!attribute [rw] stream_key + # @return [::String] + # Required. Stream key for RTMP protocol. + class RtmpPushOutputEndpoint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sprite sheet configuration. + # @!attribute [rw] format + # @return [::String] + # Format type. The default is `jpeg`. + # + # Supported formats: + # + # - `jpeg` + # @!attribute [rw] file_prefix + # @return [::String] + # Required. File name prefix for the generated sprite sheets. If multiple + # sprite sheets are added to the channel, each must have a unique file + # prefix. + # Each sprite sheet has an incremental 10-digit zero-padded suffix starting + # from 0 before the extension, such as `sprite_sheet0000000123.jpeg`. + # @!attribute [rw] sprite_width_pixels + # @return [::Integer] + # Required. The width of the sprite in pixels. Must be an even integer. + # @!attribute [rw] sprite_height_pixels + # @return [::Integer] + # Required. The height of the sprite in pixels. Must be an even integer. + # @!attribute [rw] column_count + # @return [::Integer] + # The maximum number of sprites per row in a sprite sheet. Valid range is + # [1, 10] and the default value is 1. + # @!attribute [rw] row_count + # @return [::Integer] + # The maximum number of rows per sprite sheet. When the sprite sheet is full, + # a new sprite sheet is created. Valid range is [1, 10] and the default value + # is 1. + # @!attribute [rw] interval + # @return [::Google::Protobuf::Duration] + # Create sprites at regular intervals. Valid range is [1 second, 1 hour] and + # the default value is `10s`. + # @!attribute [rw] quality + # @return [::Integer] + # The quality of the generated sprite sheet. Enter a value between 1 + # and 100, where 1 is the lowest quality and 100 is the highest quality. + # The default is 100. A high quality value corresponds to a low image data + # compression ratio. + class SpriteSheet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Preprocessing configurations. + # @!attribute [rw] audio + # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig::Audio] + # Audio preprocessing configuration. + # @!attribute [rw] crop + # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig::Crop] + # Specify the video cropping configuration. + # @!attribute [rw] pad + # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig::Pad] + # Specify the video pad filter configuration. + class PreprocessingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Audio preprocessing configuration. + # @!attribute [rw] lufs + # @return [::Float] + # Specify audio loudness normalization in loudness units relative to full + # scale (LUFS). Enter a value between -24 and 0 according to the following: + # + # - -24 is the Advanced Television Systems Committee (ATSC A/85) + # - -23 is the EU R128 broadcast standard + # - -19 is the prior standard for online mono audio + # - -18 is the ReplayGain standard + # - -16 is the prior standard for stereo audio + # - -14 is the new online audio standard recommended by Spotify, as well as + # Amazon Echo + # - 0 disables normalization. The default is 0. + class Audio + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Video cropping configuration for the input video. The cropped input video + # is scaled to match the output resolution. + # @!attribute [rw] top_pixels + # @return [::Integer] + # The number of pixels to crop from the top. The default is 0. + # @!attribute [rw] bottom_pixels + # @return [::Integer] + # The number of pixels to crop from the bottom. The default is 0. + # @!attribute [rw] left_pixels + # @return [::Integer] + # The number of pixels to crop from the left. The default is 0. + # @!attribute [rw] right_pixels + # @return [::Integer] + # The number of pixels to crop from the right. The default is 0. + class Crop + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pad filter configuration for the input video. The padded input video + # is scaled after padding with black to match the output resolution. + # @!attribute [rw] top_pixels + # @return [::Integer] + # The number of pixels to add to the top. The default is 0. + # @!attribute [rw] bottom_pixels + # @return [::Integer] + # The number of pixels to add to the bottom. The default is 0. + # @!attribute [rw] left_pixels + # @return [::Integer] + # The number of pixels to add to the left. The default is 0. + # @!attribute [rw] right_pixels + # @return [::Integer] + # The number of pixels to add to the right. The default is 0. + class Pad + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Video stream resource. + # @!attribute [rw] h264 + # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings] + # H264 codec settings. + # + # Note: The following fields are mutually exclusive: `h264`, `h265`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] h265 + # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings] + # H265 codec settings. + # + # Note: The following fields are mutually exclusive: `h265`, `h264`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class VideoStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # H264 codec settings. + # @!attribute [rw] width_pixels + # @return [::Integer] + # Required. The width of the video in pixels. Must be an even integer. + # Valid range is [320, 4096]. + # @!attribute [rw] height_pixels + # @return [::Integer] + # Required. The height of the video in pixels. Must be an even integer. + # Valid range is [180, 2160]. + # @!attribute [rw] frame_rate + # @return [::Float] + # Required. The target video frame rate in frames per second (FPS). Must be + # less than or equal to 60. Will default to the input frame rate if larger + # than the input frame rate. The API will generate an output FPS that is + # divisible by the input FPS, and smaller or equal to the target FPS. See + # [Calculating frame + # rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for + # more information. + # @!attribute [rw] bitrate_bps + # @return [::Integer] + # Required. The video bitrate in bits per second. Minimum value is 10,000. + # + # - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps). + # - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps). + # - For UHD resolution (<= 2160p), must be <= 25,000,000 (25 Mbps). + # @!attribute [rw] allow_open_gop + # @return [::Boolean] + # Specifies whether an open Group of Pictures (GOP) structure should be + # allowed or not. The default is `false`. + # @!attribute [rw] gop_frame_count + # @return [::Integer] + # Select the GOP size based on the specified frame count. + # If GOP frame count is set instead of GOP duration, GOP duration will be + # calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration + # must satisfy the limitations on `gopDuration` as well. + # Valid range is [60, 600]. + # + # Note: The following fields are mutually exclusive: `gop_frame_count`, `gop_duration`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gop_duration + # @return [::Google::Protobuf::Duration] + # Select the GOP size based on the specified duration. The default is + # `2s`. Note that `gopDuration` must be less than or equal to + # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration}, + # and + # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration} + # must be divisible by `gopDuration`. Valid range is [2s, 20s]. + # + # All video streams in the same channel must have the same GOP size. + # + # Note: The following fields are mutually exclusive: `gop_duration`, `gop_frame_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vbv_size_bits + # @return [::Integer] + # Size of the Video Buffering Verifier (VBV) buffer in bits. Must be + # greater than zero. The default is equal to + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#bitrate_bps bitrate_bps}. + # @!attribute [rw] vbv_fullness_bits + # @return [::Integer] + # Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. + # Must be greater than zero. The default is equal to 90% of + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#vbv_size_bits vbv_size_bits}. + # @!attribute [rw] entropy_coder + # @return [::String] + # The entropy coder to use. The default is `cabac`. + # + # Supported entropy coders: + # + # - `cavlc` + # - `cabac` + # @!attribute [rw] b_pyramid + # @return [::Boolean] + # Allow B-pyramid for reference frame selection. This may not be supported + # on all decoders. The default is `false`. + # @!attribute [rw] b_frame_count + # @return [::Integer] + # The number of consecutive B-frames. Must be greater than or equal to + # zero. Must be less than + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#gop_frame_count gop_frame_count} + # if set. The default is 0. + # @!attribute [rw] aq_strength + # @return [::Float] + # Specify the intensity of the adaptive quantizer (AQ). Must be between 0 + # and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A + # higher value equals a lower bitrate but smoother image. The default is 0. + # @!attribute [rw] profile + # @return [::String] + # Enforces the specified codec profile. The following profiles are + # supported: + # + # * `baseline` + # * `main` (default) + # * `high` + # + # The available options are [FFmpeg-compatible Profile + # Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). + # Note that certain values for this field may cause the + # transcoder to override other fields you set in the + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings H264CodecSettings} + # message. + # @!attribute [rw] tune + # @return [::String] + # Enforces the specified codec tune. The available options are + # [FFmpeg-compatible Encode + # Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) + # Note that certain values for this field may cause the transcoder to + # override other fields you set in the + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings H264CodecSettings} + # message. + class H264CodecSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # H265 codec settings. + # @!attribute [rw] width_pixels + # @return [::Integer] + # Optional. The width of the video in pixels. Must be an even integer. + # When not specified, the width is adjusted to match the specified height + # and input aspect ratio. If both are omitted, the input width is used. + # Valid range is [320, 4096]. + # @!attribute [rw] height_pixels + # @return [::Integer] + # Optional. The height of the video in pixels. Must be an even integer. + # When not specified, the height is adjusted to match the specified width + # and input aspect ratio. If both are omitted, the input height is used. + # Valid range is [180, 2160]. + # @!attribute [rw] frame_rate + # @return [::Float] + # Required. The target video frame rate in frames per second (FPS). Must be + # less than or equal to 120. Will default to the input frame rate if larger + # than the input frame rate. The API will generate an output FPS that is + # divisible by the input FPS, and smaller or equal to the target FPS. See + # [Calculating frame + # rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for + # more information. + # @!attribute [rw] bitrate_bps + # @return [::Integer] + # Required. The video bitrate in bits per second. Minimum value is 10,000. + # + # - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps). + # - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps). + # - For UHD resolution (<= 2160p), must be <= 25,000,000 (25 Mbps). + # @!attribute [rw] gop_frame_count + # @return [::Integer] + # Optional. Select the GOP size based on the specified frame count. + # If GOP frame count is set instead of GOP duration, GOP duration will be + # calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration + # must satisfy the limitations on `gopDuration` as well. + # Valid range is [60, 600]. + # + # Note: The following fields are mutually exclusive: `gop_frame_count`, `gop_duration`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gop_duration + # @return [::Google::Protobuf::Duration] + # Optional. Select the GOP size based on the specified duration. The + # default is `2s`. Note that `gopDuration` must be less than or equal to + # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration}, + # and + # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration} + # must be divisible by `gopDuration`. Valid range is [2s, 20s]. + # + # All video streams in the same channel must have the same GOP size. + # + # Note: The following fields are mutually exclusive: `gop_duration`, `gop_frame_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vbv_size_bits + # @return [::Integer] + # Optional. Size of the Video Buffering Verifier (VBV) buffer in bits. Must + # be greater than zero. The default is equal to + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings#bitrate_bps bitrate_bps}. + # @!attribute [rw] vbv_fullness_bits + # @return [::Integer] + # Optional. Initial fullness of the Video Buffering Verifier (VBV) buffer + # in bits. Must be greater than zero. The default is equal to 90% of + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings#vbv_size_bits vbv_size_bits}. + # @!attribute [rw] b_pyramid + # @return [::Boolean] + # Optional. Allow B-pyramid for reference frame selection. This may not be + # supported on all decoders. The default is `false`. + # @!attribute [rw] b_frame_count + # @return [::Integer] + # Optional. The number of consecutive B-frames. Must be greater than or + # equal to zero. Must be less than + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings#gop_frame_count gop_frame_count} + # if set. The default is 0. + # @!attribute [rw] aq_strength + # @return [::Float] + # Optional. Specify the intensity of the adaptive quantizer (AQ). Must be + # between 0 and 1, where 0 disables the quantizer and 1 maximizes the + # quantizer. A higher value equals a lower bitrate but smoother image. The + # default is 0. + class H265CodecSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Audio stream resource. + # @!attribute [rw] transmux + # @return [::Boolean] + # Specifies whether pass through (transmuxing) is enabled or not. + # If set to `true`, the rest of the settings, other than `mapping`, will be + # ignored. The default is `false`. + # @!attribute [rw] codec + # @return [::String] + # The codec for this audio stream. The default is `aac`. + # + # Supported audio codecs: + # + # - `aac` + # @!attribute [rw] bitrate_bps + # @return [::Integer] + # Required. Audio bitrate in bits per second. Must be between 1 and + # 10,000,000. + # @!attribute [rw] channel_count + # @return [::Integer] + # Number of audio channels. Must be between 1 and 6. The default is 2. + # @!attribute [rw] channel_layout + # @return [::Array<::String>] + # A list of channel names specifying layout of the audio channels. + # This only affects the metadata embedded in the container headers, if + # supported by the specified format. The default is `[fl, fr]`. + # + # Supported channel names: + # + # - `fl` - Front left channel + # - `fr` - Front right channel + # - `sl` - Side left channel + # - `sr` - Side right channel + # - `fc` - Front center channel + # - `lfe` - Low frequency + # @!attribute [rw] mapping + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::AudioStream::AudioMapping>] + # The mapping for the input streams and audio channels. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # The audio sample rate in Hertz. The default is 48000 Hertz. + class AudioStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The mapping for the input streams and audio channels. + # @!attribute [rw] input_key + # @return [::String] + # Required. The `Channel` + # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} + # that identifies the input that this audio mapping applies to. If an + # active input doesn't have an audio mapping, the primary audio track in + # the input stream will be selected. + # @!attribute [rw] input_track + # @return [::Integer] + # Required. The zero-based index of the track in the input stream. + # All {::Google::Cloud::Video::LiveStream::V1::AudioStream#mapping mapping}s in + # the same {::Google::Cloud::Video::LiveStream::V1::AudioStream AudioStream} must + # have the same input track. + # @!attribute [rw] input_channel + # @return [::Integer] + # Required. The zero-based index of the channel in the input stream. + # @!attribute [rw] output_channel + # @return [::Integer] + # Required. The zero-based index of the channel in the output audio stream. + # Must be consistent with the + # {::Google::Cloud::Video::LiveStream::V1::AudioStream::AudioMapping#input_channel input_channel}. + # @!attribute [rw] gain_db + # @return [::Float] + # Audio volume control in dB. Negative values decrease volume, + # positive values increase. The default is 0. + class AudioMapping + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Encoding of a text stream. For example, closed captions or subtitles. + # @!attribute [rw] codec + # @return [::String] + # Required. The codec for this text stream. + # + # Supported text codecs: + # + # - `cea608` + # - `cea708` + # - `webvtt` + # @!attribute [rw] language_code + # @return [::String] + # Optional. The BCP-47 language code, such as `en-US` or `sr-Latn`. For more + # information, see + # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The name for this particular text stream that will be added to + # the HLS/DASH manifest. + # @!attribute [rw] output_cea_channel + # @return [::String] + # Optional. The channel of the closed caption in the output stream. + # This field should only be set when textstream is used for partner + # distribution. + # Must be one of `CC1`, `CC2`, `CC3`, and `CC4`, if the + # {::Google::Cloud::Video::LiveStream::V1::TextStream#codec codec} is `cea608`; + # Must be one between `SERVICE1` and `SERVICE63`, if the + # {::Google::Cloud::Video::LiveStream::V1::TextStream#codec codec} is `cea708`. + # @!attribute [rw] mapping + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::TextStream::TextMapping>] + # Optional. The mapping for the input streams and text tracks. + class TextStream + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The mapping for the input streams and text tracks. + # @!attribute [rw] input_key + # @return [::String] + # Optional. The `Channel` + # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} + # that identifies the input that this text mapping applies to. + # @!attribute [rw] input_track + # @return [::Integer] + # Optional. The zero-based index of the track in the input stream. + # @!attribute [rw] input_cea_channel + # @return [::String] + # Optional. The channel of the closed caption in the input stream. + # If this field is set, the output + # {::Google::Cloud::Video::LiveStream::V1::TextStream#codec codec} must be + # `webvtt`. Must be one of `CC1`, `CC2`, `CC3`, and `CC4`, if the codec of + # the input closed caption is `cea608`; Must be one between `SERVICE1` and + # `SERVICE64`, if the codec of the input closed caption is `cea708`. + # @!attribute [rw] from_language_code + # @return [::String] + # Optional. The BCP-47 source language code, such as `en-US` or `sr-Latn`. + # If differ from the textStream's language code, enable translation. For + # more information on BCP-47 language codes, see + # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + class TextMapping + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Segment settings for `fmp4` and `ts`. + # @!attribute [rw] segment_duration + # @return [::Google::Protobuf::Duration] + # Duration of the segments in seconds. The default is `6s`. Note that + # `segmentDuration` must be greater than or equal to + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#gop_duration gop_duration}, + # and `segmentDuration` must be divisible by + # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#gop_duration gop_duration}. + # Valid range is [2s, 20s]. + # + # All {::Google::Cloud::Video::LiveStream::V1::Manifest#mux_streams mux_streams} in + # the same manifest must have the same segment duration. + class SegmentSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Timecode configuration. + # @!attribute [rw] source + # @return [::Google::Cloud::Video::LiveStream::V1::TimecodeConfig::TimecodeSource] + # The source of the timecode that will later be used in outputs/manifests. + # It determines the initial timecode/timestamp (first frame) of output + # streams. + # @!attribute [rw] utc_offset + # @return [::Google::Protobuf::Duration] + # UTC offset. Must be whole seconds, between -18 hours and +18 hours. + # + # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone e.g. "America/Los_Angeles". + # + # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class TimecodeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The source of timecode. + module TimecodeSource + # The timecode source is not specified. + TIMECODE_SOURCE_UNSPECIFIED = 0 + + # Use input media timestamp. + MEDIA_TIMESTAMP = 1 + + # Use input embedded timecode e.g. picture timing SEI message. + EMBEDDED_TIMECODE = 2 + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb new file mode 100644 index 000000000000..5d4f8a305dd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb @@ -0,0 +1,1294 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + # Input resource represents the endpoint from which the channel ingests + # the input stream. + # @!attribute [rw] name + # @return [::String] + # The resource name of the input, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # User-defined key/value metadata. + # @!attribute [rw] type + # @return [::Google::Cloud::Video::LiveStream::V1::Input::Type] + # Source type. + # @!attribute [rw] tier + # @return [::Google::Cloud::Video::LiveStream::V1::Input::Tier] + # Tier defines the maximum input specification that is accepted by the + # video pipeline. The billing is charged based on the tier specified here. + # See [Pricing](https://cloud.google.com/livestream/pricing) for more detail. + # The default is `HD`. + # @!attribute [r] uri + # @return [::String] + # Output only. URI to push the input stream to. + # Its format depends on the input + # {::Google::Cloud::Video::LiveStream::V1::Input#type type}, for example: + # + # * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` + # * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` + # @!attribute [rw] preprocessing_config + # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig] + # Preprocessing configurations. + # @!attribute [rw] security_rules + # @return [::Google::Cloud::Video::LiveStream::V1::Input::SecurityRule] + # Security rule for access control. + # @!attribute [r] input_stream_property + # @return [::Google::Cloud::Video::LiveStream::V1::InputStreamProperty] + # Output only. The information for the input stream. This field will be + # present only when this input receives the input stream. + class Input + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Security rules for access control. Each field represents one security rule. + # Only when the source of the input stream satisfies all the fields, this + # input stream can be accepted. + # @!attribute [rw] ip_ranges + # @return [::Array<::String>] + # At least one ip range must match unless none specified. The IP range is + # defined by CIDR block: for example, `192.0.1.0/24` for a range and + # `192.0.1.0/32` for a single IP address. + class SecurityRule + 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 type of the input. + module Type + # Input type is not specified. + TYPE_UNSPECIFIED = 0 + + # Input will take an rtmp input stream. + RTMP_PUSH = 1 + + # Input will take an srt (Secure Reliable Transport) input stream. + SRT_PUSH = 2 + end + + # Tier of the input specification. + module Tier + # Tier is not specified. + TIER_UNSPECIFIED = 0 + + # Resolution < 1280x720. Bitrate <= 6 Mbps. FPS <= 60. + SD = 1 + + # Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. + HD = 2 + + # Resolution <= 4096x2160. Bitrate <= 50 Mbps. FPS <= 60. + UHD = 3 + + # Resolution <= 1280x720. Bitrate <= 6 Mbps. FPS <= 60. H265 codec. + SD_H265 = 4 + + # Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. H265 codec. + HD_H265 = 5 + + # Resolution <= 4096x2160. Bitrate <= 50 Mbps. FPS <= 60. H265 codec. + UHD_H265 = 6 + end + end + + # Channel resource represents the processor that does a user-defined + # "streaming" operation, which includes getting an input stream through an + # input, transcoding it to multiple renditions, and publishing output live + # streams in certain formats (for example, HLS or DASH) to the specified + # location. + # @!attribute [rw] name + # @return [::String] + # The resource name of the channel, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # User-defined key/value metadata. + # @!attribute [rw] input_attachments + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::InputAttachment>] + # A list of input attachments that this channel uses. + # One channel can have multiple inputs as the input sources. Only one + # input can be selected as the input source at one time. + # @!attribute [r] active_input + # @return [::String] + # Output only. The + # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} + # that serves as the current input source. The first input in the + # {::Google::Cloud::Video::LiveStream::V1::Channel#input_attachments input_attachments} + # is the initial input source. + # @!attribute [rw] output + # @return [::Google::Cloud::Video::LiveStream::V1::Channel::Output] + # Required. Information about the output (that is, the Cloud Storage bucket + # to store the generated live stream). + # @!attribute [rw] elementary_streams + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::ElementaryStream>] + # List of elementary streams. + # @!attribute [rw] mux_streams + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::MuxStream>] + # List of multiplexing settings for output streams. + # @!attribute [rw] manifests + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Manifest>] + # List of output manifests. + # @!attribute [rw] distribution_streams + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DistributionStream>] + # Optional. List of multiplexing settings of streams for distributions. + # @!attribute [rw] distributions + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Distribution>] + # Optional. List of distributions. + # @!attribute [rw] sprite_sheets + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::SpriteSheet>] + # List of output sprite sheets. + # @!attribute [r] streaming_state + # @return [::Google::Cloud::Video::LiveStream::V1::Channel::StreamingState] + # Output only. State of the streaming operation. + # @!attribute [r] streaming_error + # @return [::Google::Rpc::Status] + # Output only. A description of the reason for the streaming error. This + # property is always present when + # {::Google::Cloud::Video::LiveStream::V1::Channel#streaming_state streaming_state} + # is + # {::Google::Cloud::Video::LiveStream::V1::Channel::StreamingState::STREAMING_ERROR STREAMING_ERROR}. + # @!attribute [rw] log_config + # @return [::Google::Cloud::Video::LiveStream::V1::LogConfig] + # Configuration of platform logs for this channel. + # @!attribute [rw] timecode_config + # @return [::Google::Cloud::Video::LiveStream::V1::TimecodeConfig] + # Configuration of timecode for this channel. + # @!attribute [rw] encryptions + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Encryption>] + # Optional. Encryption configurations for this channel. Each configuration + # has an ID which is referred to by each MuxStream to indicate which + # configuration is used for that output. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Video::LiveStream::V1::InputConfig] + # The configuration for input sources defined in + # {::Google::Cloud::Video::LiveStream::V1::Channel#input_attachments input_attachments}. + # @!attribute [rw] retention_config + # @return [::Google::Cloud::Video::LiveStream::V1::RetentionConfig] + # Optional. Configuration for retention of output files for this channel. + # @!attribute [rw] static_overlays + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::StaticOverlay>] + # Optional. List of static overlay images. Those images display over the + # output content for the whole duration of the live stream. + # @!attribute [rw] auto_transcription_config + # @return [::Google::Cloud::Video::LiveStream::V1::AutoTranscriptionConfig] + # Optional. Advanced configurations for auto-generated text streams. + class Channel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Location of output file(s) in a Google Cloud Storage bucket. + # @!attribute [rw] uri + # @return [::String] + # URI for the output file(s). For example, `gs://my-bucket/outputs/`. + class Output + 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 + + # State of streaming operation that the channel is running. + module StreamingState + # Streaming state is not specified. + STREAMING_STATE_UNSPECIFIED = 0 + + # Channel is getting the input stream, generating the live streams to the + # specified output location. + STREAMING = 1 + + # Channel is waiting for the input stream through the input. + AWAITING_INPUT = 2 + + # Channel is running, but has trouble publishing the live streams onto the + # specified output location (for example, the specified Cloud Storage + # bucket is not writable). + STREAMING_ERROR = 4 + + # Channel is generating live streams with no input stream. Live streams are + # filled out with black screen, while input stream is missing. + # Not supported yet. + STREAMING_NO_INPUT = 5 + + # Channel is stopped, finishing live streams. + STOPPED = 6 + + # Channel is starting. + STARTING = 7 + + # Channel is stopping. + STOPPING = 8 + end + end + + # 2D normalized coordinates. + # @!attribute [rw] x + # @return [::Float] + # Optional. Normalized x coordinate. Valid range is [0.0, 1.0]. Default is 0. + # @!attribute [rw] y + # @return [::Float] + # Optional. Normalized y coordinate. Valid range is [0.0, 1.0]. Default is 0. + class NormalizedCoordinate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Normalized resolution. + # @!attribute [rw] w + # @return [::Float] + # Optional. Normalized width. Valid range is [0.0, 1.0]. Default is 0. + # @!attribute [rw] h + # @return [::Float] + # Optional. Normalized height. Valid range is [0.0, 1.0]. Default is 0. + class NormalizedResolution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the static overlay. + # @!attribute [rw] asset + # @return [::String] + # Required. Asset to use for the overlaid image. + # The asset must be represented in the form of: + # `projects/{project}/locations/{location}/assets/{assetId}`. + # The asset's resource type must be image. + # @!attribute [rw] resolution + # @return [::Google::Cloud::Video::LiveStream::V1::NormalizedResolution] + # Optional. Normalized image resolution, based on output video resolution. + # Valid values are [0.0, 1.0]. To respect the original image aspect ratio, + # set either `w` or `h` to 0. To use the original image resolution, set both + # `w` and `h` to 0. The default is \\{0, 0}. + # @!attribute [rw] position + # @return [::Google::Cloud::Video::LiveStream::V1::NormalizedCoordinate] + # Optional. Position of the image in terms of normalized coordinates of the + # upper-left corner of the image, based on output video resolution. For + # example, use the x and y coordinates \\{0, 0} to position the top-left corner + # of the overlay animation in the top-left corner of the output video. + # @!attribute [rw] opacity + # @return [::Float] + # Optional. Target image opacity. Valid values are from `1.0` (solid, + # default) to `0.0` (transparent), exclusive. Set this to a value greater + # than `0.0`. + class StaticOverlay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the input sources of a channel. + # @!attribute [rw] input_switch_mode + # @return [::Google::Cloud::Video::LiveStream::V1::InputConfig::InputSwitchMode] + # Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Input switch mode. + module InputSwitchMode + # The input switch mode is not specified. + INPUT_SWITCH_MODE_UNSPECIFIED = 0 + + # Automatic failover is enabled. The primary input stream is always + # preferred over its backup input streams configured using the + # {::Google::Cloud::Video::LiveStream::V1::InputAttachment::AutomaticFailover AutomaticFailover} + # field. + FAILOVER_PREFER_PRIMARY = 1 + + # Automatic failover is disabled. You must use the + # {::Google::Cloud::Video::LiveStream::V1::Event#input_switch inputSwitch} event + # to switch the active input source for the channel to stream from. When + # this mode is chosen, the + # {::Google::Cloud::Video::LiveStream::V1::InputAttachment::AutomaticFailover AutomaticFailover} + # field is ignored. + MANUAL = 3 + end + end + + # Configuration of platform logs. + # See [Using and managing platform + # logs](https://cloud.google.com/logging/docs/api/platform-logs#managing-logs) + # for more information about how to view platform logs through Cloud Logging. + # @!attribute [rw] log_severity + # @return [::Google::Cloud::Video::LiveStream::V1::LogConfig::LogSeverity] + # The severity level of platform logging for this resource. + class LogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The severity level of platform logging for this channel. Logs with a + # severity level higher than or equal to the chosen severity level will be + # logged and can be viewed through Cloud Logging. + # The severity level of a log is ranked as followed from low to high: DEBUG < + # INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY. + # See + # [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity) + # for more information. + module LogSeverity + # Log severity is not specified. This is the same as log severity is OFF. + LOG_SEVERITY_UNSPECIFIED = 0 + + # Log is turned off. + OFF = 1 + + # Log with severity higher than or equal to DEBUG are logged. + DEBUG = 100 + + # Logs with severity higher than or equal to INFO are logged. + INFO = 200 + + # Logs with severity higher than or equal to WARNING are logged. + WARNING = 400 + + # Logs with severity higher than or equal to ERROR are logged. + ERROR = 500 + end + end + + # Configuration for retention of output files. + # @!attribute [rw] retention_window_duration + # @return [::Google::Protobuf::Duration] + # The minimum duration for which the output files from the channel will + # remain in the output bucket. After this duration, output files are + # deleted asynchronously. + # + # When the channel is deleted, all output files are deleted from the output + # bucket asynchronously. + # + # If omitted or set to zero, output files will remain in the output bucket + # based on + # {::Google::Cloud::Video::LiveStream::V1::Manifest#segment_keep_duration Manifest.segment_keep_duration}, + # which defaults to 60s. + # + # If both retention_window_duration and + # {::Google::Cloud::Video::LiveStream::V1::Manifest#segment_keep_duration Manifest.segment_keep_duration} + # are set, retention_window_duration is used and + # {::Google::Cloud::Video::LiveStream::V1::Manifest#segment_keep_duration Manifest.segment_keep_duration} + # is ignored. + class RetentionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties of the input stream. + # @!attribute [rw] last_establish_time + # @return [::Google::Protobuf::Timestamp] + # The time that the current input stream is accepted and the connection is + # established. + # @!attribute [rw] video_streams + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::VideoStreamProperty>] + # Properties of the video streams. + # @!attribute [rw] audio_streams + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::AudioStreamProperty>] + # Properties of the audio streams. + class InputStreamProperty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties of the video stream. + # @!attribute [rw] index + # @return [::Integer] + # Index of this video stream. + # @!attribute [rw] video_format + # @return [::Google::Cloud::Video::LiveStream::V1::VideoFormat] + # Properties of the video format. + class VideoStreamProperty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties of the video format. + # @!attribute [rw] codec + # @return [::String] + # Video codec used in this video stream. + # @!attribute [rw] width_pixels + # @return [::Integer] + # The width of the video stream in pixels. + # @!attribute [rw] height_pixels + # @return [::Integer] + # The height of the video stream in pixels. + # @!attribute [rw] frame_rate + # @return [::Float] + # The frame rate of the input video stream. + class VideoFormat + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties of the audio stream. + # @!attribute [rw] index + # @return [::Integer] + # Index of this audio stream. + # @!attribute [rw] audio_format + # @return [::Google::Cloud::Video::LiveStream::V1::AudioFormat] + # Properties of the audio format. + class AudioStreamProperty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Properties of the audio format. + # @!attribute [rw] codec + # @return [::String] + # Audio codec used in this audio stream. + # @!attribute [rw] channel_count + # @return [::Integer] + # The number of audio channels. + # @!attribute [rw] channel_layout + # @return [::Array<::String>] + # A list of channel names specifying the layout of the audio channels. + class AudioFormat + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A group of information for attaching an input resource to this channel. + # @!attribute [rw] key + # @return [::String] + # A unique key for this input attachment. The key must be 1-63 + # characters in length. The key must begin and end with a letter (regardless + # of case) or a number, but can contain dashes or underscores in between. + # @!attribute [rw] input + # @return [::String] + # The resource name of an existing input, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # @!attribute [rw] automatic_failover + # @return [::Google::Cloud::Video::LiveStream::V1::InputAttachment::AutomaticFailover] + # Automatic failover configurations. + class InputAttachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configurations to follow when automatic failover happens. + # @!attribute [rw] input_keys + # @return [::Array<::String>] + # The + # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key}s + # of inputs to failover to when this input is disconnected. Currently, only + # up to one backup input is supported. + class AutomaticFailover + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Advanced configurations for auto-generated text streams. + # @!attribute [rw] display_timing + # @return [::Google::Cloud::Video::LiveStream::V1::AutoTranscriptionConfig::DisplayTiming] + # Optional. Whether auto-generated text streams are displayed synchronously + # or asynchronously with the original audio. + # @!attribute [rw] quality_preset + # @return [::Google::Cloud::Video::LiveStream::V1::AutoTranscriptionConfig::QualityPreset] + # Optional. Tunes the latency and quality of auto-generated captions. + class AutoTranscriptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Whether auto-generated text streams are displayed synchronously or + # asynchronously with the original audio. + module DisplayTiming + # Display timing is not specified. Caption display will be asynchronous by + # default. + DISPLAY_TIMING_UNSPECIFIED = 0 + + # Caption will be displayed asynchronous with audio. + ASYNC = 1 + + # Caption will be displayed synchronous with audio. This option increases + # overall media output latency, and reduces viewing latency between audio + # and auto-generated captions. + SYNC = 2 + end + + # Presets to tune the latency and quality of auto-generated captions. + module QualityPreset + # Quality Preset is not specified. By default, BALANCED_QUALITY will be + # used. + QUALITY_PRESET_UNSPECIFIED = 0 + + # Reduce the latency of auto-generated captions. This may reduce the + # quality of the captions. + LOW_LATENCY = 1 + + # Default behavior when QualityPreset is not specified. + BALANCED_QUALITY = 2 + + # Increases the quality of the auto-generated captions at the cost of + # higher latency. + IMPROVED_QUALITY = 3 + end + end + + # Event is a sub-resource of a channel, which can be scheduled by the user to + # execute operations on a channel resource without having to stop the channel. + # @!attribute [rw] name + # @return [::String] + # The resource name of the event, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # User-defined key/value metadata. + # @!attribute [rw] input_switch + # @return [::Google::Cloud::Video::LiveStream::V1::Event::InputSwitchTask] + # Switches to another input stream. + # + # Note: The following fields are mutually exclusive: `input_switch`, `ad_break`, `return_to_program`, `slate`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ad_break + # @return [::Google::Cloud::Video::LiveStream::V1::Event::AdBreakTask] + # Inserts a new ad opportunity. + # + # Note: The following fields are mutually exclusive: `ad_break`, `input_switch`, `return_to_program`, `slate`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] return_to_program + # @return [::Google::Cloud::Video::LiveStream::V1::Event::ReturnToProgramTask] + # Stops any running ad break. + # + # Note: The following fields are mutually exclusive: `return_to_program`, `input_switch`, `ad_break`, `slate`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] slate + # @return [::Google::Cloud::Video::LiveStream::V1::Event::SlateTask] + # Inserts a slate. + # + # Note: The following fields are mutually exclusive: `slate`, `input_switch`, `ad_break`, `return_to_program`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] mute + # @return [::Google::Cloud::Video::LiveStream::V1::Event::MuteTask] + # Mutes the stream. + # + # Note: The following fields are mutually exclusive: `mute`, `input_switch`, `ad_break`, `return_to_program`, `slate`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] unmute + # @return [::Google::Cloud::Video::LiveStream::V1::Event::UnmuteTask] + # Unmutes the stream. + # + # Note: The following fields are mutually exclusive: `unmute`, `input_switch`, `ad_break`, `return_to_program`, `slate`, `mute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] update_encryptions + # @return [::Google::Cloud::Video::LiveStream::V1::Event::UpdateEncryptionsTask] + # Updates encryption settings. + # + # Note: The following fields are mutually exclusive: `update_encryptions`, `input_switch`, `ad_break`, `return_to_program`, `slate`, `mute`, `unmute`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] execute_now + # @return [::Boolean] + # When this field is set to true, the event will be executed at the earliest + # time that the server can schedule the event and + # {::Google::Cloud::Video::LiveStream::V1::Event#execution_time execution_time} + # will be populated with the time that the server actually schedules the + # event. + # @!attribute [rw] execution_time + # @return [::Google::Protobuf::Timestamp] + # The time to execute the event. If you set + # {::Google::Cloud::Video::LiveStream::V1::Event#execute_now execute_now} to + # `true`, then do not set this field in the `CreateEvent` request. In + # this case, the server schedules the event and populates this field. If you + # set {::Google::Cloud::Video::LiveStream::V1::Event#execute_now execute_now} to + # `false`, then you must set this field to at least 10 seconds in the future + # or else the event can't be created. + # @!attribute [r] state + # @return [::Google::Cloud::Video::LiveStream::V1::Event::State] + # Output only. The state of the event. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. An error object that describes the reason for the failure. + # This property is always present when `state` is `FAILED`. + class Event + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Switches to another input stream. Automatic failover is then disabled. + # @!attribute [rw] input_key + # @return [::String] + # The + # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} + # of the input to switch to. + class InputSwitchTask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Inserts a new ad opportunity. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration of an ad opportunity. Must be greater than 0. + class AdBreakTask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Inserts a slate. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Optional. Duration of the slate. Must be greater than 0 if specified. + # Omit this field for a long running slate. + # @!attribute [rw] asset + # @return [::String] + # Slate asset to use for the duration. If its duration is less than the + # duration of the SlateTask, then the slate loops. The slate must be + # represented in the form of: + # `projects/{project}/locations/{location}/assets/{assetId}`. + class SlateTask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stops any events which are currently running. This only applies to events + # with a duration. + class ReturnToProgramTask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mutes the stream. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration for which the stream should be muted. If omitted, the stream + # will be muted until an UnmuteTask event is sent. + class MuteTask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Unmutes the stream. The task fails if the stream is not currently muted. + class UnmuteTask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Update encryption settings. + # @!attribute [rw] encryptions + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::EncryptionUpdate>] + # Required. A list of + # {::Google::Cloud::Video::LiveStream::V1::EncryptionUpdate EncryptionUpdate}s + # that updates the existing encryption settings. + class UpdateEncryptionsTask + 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 + + # State of the event + module State + # Event state is not specified. + STATE_UNSPECIFIED = 0 + + # Event is scheduled but not executed yet. + SCHEDULED = 1 + + # Event is being executed. + RUNNING = 2 + + # Event has been successfully executed. + SUCCEEDED = 3 + + # Event fails to be executed. + FAILED = 4 + + # Event has been created but not scheduled yet. + PENDING = 5 + + # Event was stopped before running for its full duration. + STOPPED = 6 + end + end + + # Clip is a sub-resource under channel. Each clip represents a clipping + # operation that generates a VOD playlist from its channel given a set of + # timestamp ranges. + # @!attribute [rw] name + # @return [::String] + # The resource name of the clip, in the following format: + # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. + # `{clipId}` is a user-specified resource id that conforms to the following + # criteria: + # + # 1. 1 character minimum, 63 characters maximum + # 2. Only contains letters, digits, underscores, and hyphens + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation timestamp of the clip resource. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the clip request starts to be processed. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp of the clip resource. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels associated with this resource. Each label is a key-value pair. + # @!attribute [r] state + # @return [::Google::Cloud::Video::LiveStream::V1::Clip::State] + # Output only. The state of the clip. + # @!attribute [rw] output_uri + # @return [::String] + # Specify the `output_uri` to determine where to place the clip segments and + # clip manifest files in Cloud Storage. The manifests specified in + # `clip_manifests` fields will be placed under this URI. The exact URI of the + # generated manifests will be provided in `clip_manifests.output_uri` for + # each manifest. + # Example: + # "output_uri": "gs://my-bucket/clip-outputs" + # "clip_manifests.output_uri": "gs://my-bucket/clip-outputs/main.m3u8" + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. An error object that describes the reason for the failure. + # This property only presents when `state` is `FAILED`. + # @!attribute [rw] slices + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Clip::Slice>] + # The specified ranges of segments to generate a clip. + # @!attribute [rw] clip_manifests + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Clip::ClipManifest>] + # Required. A list of clip manifests. Currently only one clip manifest is + # allowed. + # @!attribute [rw] output_type + # @return [::Google::Cloud::Video::LiveStream::V1::Clip::OutputType] + # Optional. OutputType of the clip. If not specified, the default value is + # MANIFEST. + class Clip + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # TimeSlice represents a tuple of Unix epoch timestamps that specifies a time + # range. + # @!attribute [rw] markin_time + # @return [::Google::Protobuf::Timestamp] + # The mark-in Unix epoch time in the original live stream manifest. + # @!attribute [rw] markout_time + # @return [::Google::Protobuf::Timestamp] + # The mark-out Unix epoch time in the original live stream manifest. + class TimeSlice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Slice represents a slice of the requested clip. + # @!attribute [rw] time_slice + # @return [::Google::Cloud::Video::LiveStream::V1::Clip::TimeSlice] + # A slice in form of a tuple of Unix epoch time. + class Slice + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ClipManifest identifies a source manifest for the generated clip manifest. + # @!attribute [rw] manifest_key + # @return [::String] + # Required. A unique key that identifies a manifest config in the parent + # channel. This key is the same as `channel.manifests.key` for the selected + # manifest. + # @!attribute [r] output_uri + # @return [::String] + # Output only. The output URI of the generated clip manifest. This field + # will be populated when the CreateClip request is accepted. Current output + # format is provided below but may change in the future. Please read this + # field to get the uri to the generated clip manifest. Format: + # \\{clip.output_uri}/\\{channel.manifest.fileName} Example: + # gs://my-bucket/clip-outputs/main.m3u8 + class ClipManifest + 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 + + # State of clipping operation. + module State + # State is not specified. + STATE_UNSPECIFIED = 0 + + # The operation is pending to be picked up by the server. + PENDING = 1 + + # The server admitted this create clip request, and + # outputs are under processing. + CREATING = 2 + + # Outputs are available in the specified Cloud Storage bucket. For + # additional information, see the `outputs` field. + SUCCEEDED = 3 + + # The operation has failed. For additional information, see the `error` + # field. + FAILED = 4 + end + + # OutputType represents the output type of the clip. + module OutputType + # OutputType is not specified. + OUTPUT_TYPE_UNSPECIFIED = 0 + + # OutputType is a VOD manifest. This is the default value. + MANIFEST = 1 + + # OutputType is an MP4 file. + MP4 = 2 + end + end + + # TimeInterval represents a time interval. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The start time of the interval. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The end time of the interval. + class TimeInterval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DvrSession is a sub-resource under channel. Each DvrSession represents a DVR + # recording of the live stream for a specific time range. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the DVR session, in the following format: + # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. + # `{dvrSessionId}` is a user-specified resource id that conforms to the + # following criteria: + # + # 1. 1 character minimum, 63 characters maximum + # 2. Only contains letters, digits, underscores, and hyphens + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. User-defined key/value metadata. + # @!attribute [r] state + # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession::State] + # Output only. The state of the clip. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. An error object that describes the reason for the failure. + # This property only presents when `state` is `FAILED`. + # @!attribute [rw] dvr_manifests + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DvrSession::DvrManifest>] + # Required. A list of DVR manifests. Currently only one DVR manifest is + # allowed. + # @!attribute [rw] dvr_windows + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DvrSession::DvrWindow>] + # Required. The specified ranges of segments to generate a DVR recording. + class DvrSession + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # DvrManifest identifies a source manifest and specifies a file name for the + # generated DVR manifest. + # @!attribute [rw] manifest_key + # @return [::String] + # Required. A unique key that identifies a manifest config in the parent + # channel. This key is the same as `channel.manifests.key` for the selected + # manifest. + # @!attribute [r] output_uri + # @return [::String] + # Output only. The output URI of the DVR manifest. The DVR output will be + # placed in a directory named `dvr/dvrSessionId/` under the parent + # channel's output uri. Format: + # \\{channel.output.uri}/dvr/\\{dvrSessionId}/\\{channel.manifests.fileName} + # Example: gs://my-bucket/outputs/dvr/my-dvr-session/main.m3u8 + class DvrManifest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DvrWindow represents a DVR window. + # @!attribute [rw] time_interval + # @return [::Google::Cloud::Video::LiveStream::V1::TimeInterval] + # A time interval in the form of a tuple of Unix epoch time. + class DvrWindow + 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 + + # State of the DVR session. + module State + # State is not specified. + STATE_UNSPECIFIED = 0 + + # The operation is pending to be picked up by the server. + PENDING = 1 + + # The session is being updated. + UPDATING = 2 + + # The session is scheduled and waiting for the start time. + SCHEDULED = 3 + + # The session is currently in progress and the outputs are available in the + # specified Cloud Storage bucket. For additional information, see the + # `dvr_manifests.output_uri` field. + LIVE = 4 + + # Outputs are available in the specified Cloud Storage bucket. For + # additional information, see the `dvr_manifests.output_uri` field. + FINISHED = 5 + + # The operation has failed. For additional information, see the `error` + # field. + FAILED = 6 + + # The session is being deleted. + DELETING = 7 + + # The session is being post processed. + POST_PROCESSING = 8 + + # The session is in cooldown. The cooldown period lasts for 60 seconds. + # When the DVR session is updated by the user to have a new end time that + # is likely already in the past, the DVR manifest will end as soon as + # possible and the DVR session will move to this state. This is done to + # prevent the players to receive a manifest update that removes a segment + # that has already been played. After the cooldown period ends, a new + # manifest is generated that honors the new end time. + COOLDOWN = 9 + + # The session is being stopped. The session will move to STOPPING state, if + # the parent channel is updated. + STOPPING = 10 + end + end + + # An asset represents a video or an image. + # @!attribute [rw] name + # @return [::String] + # The resource name of the asset, in the form of: + # `projects/{project}/locations/{location}/assets/{assetId}`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # User-defined key/value metadata. + # @!attribute [rw] video + # @return [::Google::Cloud::Video::LiveStream::V1::Asset::VideoAsset] + # VideoAsset represents a video. + # + # Note: The following fields are mutually exclusive: `video`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image + # @return [::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset] + # ImageAsset represents an image. + # + # Note: The following fields are mutually exclusive: `image`, `video`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] crc32c + # @return [::String] + # Based64-encoded CRC32c checksum of the asset file. For more information, + # see the crc32c checksum of the [Cloud Storage Objects + # resource](https://cloud.google.com/storage/docs/json_api/v1/objects). + # If crc32c is omitted or left empty when the asset is created, this field is + # filled by the crc32c checksum of the Cloud Storage object indicated by + # {::Google::Cloud::Video::LiveStream::V1::Asset::VideoAsset#uri VideoAsset.uri} or + # {::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset#uri ImageAsset.uri}. If + # crc32c is set, the asset can't be created if the crc32c value does not + # match with the crc32c checksum of the Cloud Storage object indicated by + # {::Google::Cloud::Video::LiveStream::V1::Asset::VideoAsset#uri VideoAsset.uri} or + # {::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset#uri ImageAsset.uri}. + # @!attribute [r] state + # @return [::Google::Cloud::Video::LiveStream::V1::Asset::State] + # Output only. The state of the asset resource. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Only present when `state` is `ERROR`. The reason for the error + # state of the asset. + class Asset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # VideoAsset represents a video. The supported formats are MP4, MPEG-TS, and + # FLV. The supported video codec is H264. The supported audio codecs are + # AAC, AC3, MP2, and MP3. + # @!attribute [rw] uri + # @return [::String] + # Cloud Storage URI of the video. The format is `gs://my-bucket/my-object`. + class VideoAsset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Image represents an image. The supported formats are JPEG, PNG. + # @!attribute [rw] uri + # @return [::String] + # Cloud Storage URI of the image. The format is `gs://my-bucket/my-object`. + class ImageAsset + 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 + + # State of the asset resource. + module State + # State is not specified. + STATE_UNSPECIFIED = 0 + + # The asset is being created. + CREATING = 1 + + # The asset is ready for use. + ACTIVE = 2 + + # The asset is being deleted. + DELETING = 3 + + # The asset has an error. + ERROR = 4 + end + end + + # Encryption settings. + # @!attribute [rw] id + # @return [::String] + # Required. Identifier for this set of encryption options. The ID must be + # 1-63 characters in length. The ID must begin and end with a letter + # (regardless of case) or a number, but can contain dashes or underscores in + # between. + # @!attribute [rw] secret_manager_key_source + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SecretManagerSource] + # For keys stored in Google Secret Manager. + # @!attribute [rw] drm_systems + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::DrmSystems] + # Required. Configuration for DRM systems. + # @!attribute [rw] aes128 + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Aes128Encryption] + # Configuration for HLS AES-128 encryption. + # + # Note: The following fields are mutually exclusive: `aes128`, `sample_aes`, `mpeg_cenc`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] sample_aes + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SampleAesEncryption] + # Configuration for HLS SAMPLE-AES encryption. + # + # Note: The following fields are mutually exclusive: `sample_aes`, `aes128`, `mpeg_cenc`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] mpeg_cenc + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::MpegCommonEncryption] + # Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + # + # Note: The following fields are mutually exclusive: `mpeg_cenc`, `aes128`, `sample_aes`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Encryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for secrets stored in Google Secret Manager. + # @!attribute [rw] secret_version + # @return [::String] + # Required. The name of the Secret Version containing the encryption key. + # `projects/{project}/secrets/{secret_id}/versions/{version_number}` + class SecretManagerSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Widevine configuration. + class Widevine + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Fairplay configuration. + class Fairplay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Playready configuration. + class Playready + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Clearkey configuration. + class Clearkey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines configuration for DRM systems in use. If a field is omitted, + # that DRM system will be considered to be disabled. + # @!attribute [rw] widevine + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Widevine] + # Optional. Widevine configuration. + # @!attribute [rw] fairplay + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Fairplay] + # Optional. Fairplay configuration. + # @!attribute [rw] playready + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Playready] + # Optional. Playready configuration. + # @!attribute [rw] clearkey + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Clearkey] + # Optional. Clearkey configuration. + class DrmSystems + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for HLS AES-128 encryption. + class Aes128Encryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for HLS SAMPLE-AES encryption. + class SampleAesEncryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for MPEG-Dash Common Encryption (MPEG-CENC). + # @!attribute [rw] scheme + # @return [::String] + # Required. Specify the encryption scheme, supported schemes: + # - `cenc` - AES-CTR subsample + # - `cbcs`- AES-CBC subsample pattern + class MpegCommonEncryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Encryption setting when updating encryption. + # @!attribute [rw] id + # @return [::String] + # Required. Identifier for the encryption option to be updated. + # @!attribute [rw] secret_manager_key_source + # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SecretManagerSource] + # For keys stored in Google Secret Manager. + class EncryptionUpdate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pool resource defines the configuration of Live Stream pools for a specific + # location. Currently we support only one pool resource per project per + # location. After the creation of the first input, a default pool is created + # automatically at "projects/\\{project}/locations/\\{location}/pools/default". + # @!attribute [rw] name + # @return [::String] + # The resource name of the pool, in the form of: + # `projects/{project}/locations/{location}/pools/{poolId}`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # User-defined key/value metadata. + # @!attribute [rw] network_config + # @return [::Google::Cloud::Video::LiveStream::V1::Pool::NetworkConfig] + # Network configuration for the pool. + class Pool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines the network configuration for the pool. + # @!attribute [rw] peered_network + # @return [::String] + # peered_network is the network resource URL of the network that is peered + # to the service provider network. Must be of the format + # projects/NETWORK_PROJECT_NUMBER/global/networks/NETWORK_NAME, where + # NETWORK_PROJECT_NUMBER is the project number of the Cloud project that + # holds your VPC network and NETWORK_NAME is the name of your VPC network. + # If peered_network is omitted or empty, the pool will use endpoints that + # are publicly available. + class NetworkConfig + 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 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb new file mode 100644 index 000000000000..47f17459c530 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb @@ -0,0 +1,1032 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video + module LiveStream + module V1 + # Request message for "LivestreamService.CreateAsset". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] asset + # @return [::Google::Cloud::Video::LiveStream::V1::Asset] + # Required. The asset resource to be created. + # @!attribute [rw] asset_id + # @return [::String] + # Required. The ID of the asset resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class CreateAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.DeleteAsset". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the asset resource, in the form of: + # `projects/{project}/locations/{location}/assets/{assetId}`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class DeleteAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.ListAssets". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results + class ListAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for "LivestreamService.ListAssets". + # @!attribute [rw] assets + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Asset>] + # The list of Assets + # @!attribute [rw] next_page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.GetAsset". + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/assets/{asset}`. + class GetAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.CreateChannel". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] channel + # @return [::Google::Cloud::Video::LiveStream::V1::Channel] + # Required. The channel resource to be created. + # @!attribute [rw] channel_id + # @return [::String] + # Required. The ID of the channel resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class CreateChannelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.ListChannels". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + # @!attribute [rw] filter + # @return [::String] + # The filter to apply to list results. + # @!attribute [rw] order_by + # @return [::String] + # Specifies the ordering of results following syntax at + # https://cloud.google.com/apis/design/design_patterns#sorting_order. + class ListChannelsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for "LivestreamService.ListChannels". + # @!attribute [rw] channels + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Channel>] + # A list of channels. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListChannelsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.GetChannel". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + class GetChannelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.DeleteChannel". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + # @!attribute [rw] force + # @return [::Boolean] + # If the `force` field is set to the default value of `false`, you must + # delete all of a channel's events before you can delete the channel itself. + # If the field is set to `true`, requests to delete a channel also delete + # associated channel events. + class DeleteChannelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.UpdateChannel". + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the Channel + # resource by the update. You can only update the following fields: + # + # * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) + # * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) + # * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) + # * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) + # * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) + # * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) + # * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) + # * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) + # * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) + # * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the mask is not present, then each field from the list above is updated + # if the field appears in the request payload. To unset a field, add the + # field to the update mask and remove it from the request payload. + # @!attribute [rw] channel + # @return [::Google::Cloud::Video::LiveStream::V1::Channel] + # Required. The channel resource to be updated. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class UpdateChannelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.StartChannel". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class StartChannelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.StopChannel". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class StopChannelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.StartDistribution". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] distribution_keys + # @return [::Array<::String>] + # Optional. A list of keys to identify the distribution configuration in the + # channel resource. If left empty, all the distributions in the channel + # specification will be started. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class StartDistributionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.StopDistribution". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the channel resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] distribution_keys + # @return [::Array<::String>] + # Optional. A list of key to identify the distribution configuration in the + # channel resource. If left empty, all the distributions in the channel + # specification will be stopped. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class StopDistributionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.CreateInput". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] input + # @return [::Google::Cloud::Video::LiveStream::V1::Input] + # Required. The input resource to be created. + # @!attribute [rw] input_id + # @return [::String] + # Required. The ID of the input resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class CreateInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.ListInputs". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent location for the resource, in the form of: + # `projects/{project}/locations/{location}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListInputsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + # @!attribute [rw] filter + # @return [::String] + # The filter to apply to list results. + # @!attribute [rw] order_by + # @return [::String] + # Specifies the ordering of results following syntax at [Sorting + # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). + class ListInputsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for "LivestreamService.ListInputs". + # @!attribute [rw] inputs + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Input>] + # A list of inputs. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListInputsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.GetInput". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + class GetInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.DeleteInput". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class DeleteInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.UpdateInput". + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the Input + # resource by the update. You can only update the following fields: + # + # * [`tier`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#Tier) + # * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) + # * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # + # If the mask is not present, then each field from the list above is updated + # if the field appears in the request payload. To unset a field, add the + # field to the update mask and remove it from the request payload. + # @!attribute [rw] input + # @return [::Google::Cloud::Video::LiveStream::V1::Input] + # Required. The input resource to be updated. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class UpdateInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.CreateEvent". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent channel for the resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] event + # @return [::Google::Cloud::Video::LiveStream::V1::Event] + # Required. The event resource to be created. + # @!attribute [rw] event_id + # @return [::String] + # Required. The ID of the event resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class CreateEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.ListEvents". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent channel for the resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. If unspecified, server + # will pick an appropriate default. Server may return fewer items than + # requested. A caller should only rely on response's + # {::Google::Cloud::Video::LiveStream::V1::ListEventsResponse#next_page_token next_page_token} + # to determine if there are more items left to be queried. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous List request, if any. + # @!attribute [rw] filter + # @return [::String] + # The filter to apply to list results. + # @!attribute [rw] order_by + # @return [::String] + # Specifies the ordering of results following syntax at + # https://cloud.google.com/apis/design/design_patterns#sorting_order. + class ListEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for "LivestreamService.ListEvents". + # @!attribute [rw] events + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Event>] + # A list of events. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.GetEvent". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + class GetEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.DeleteEvent". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class DeleteEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for Start/Stop Channel long-running operations. + class ChannelOperationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.ListClips". + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListClipsRequest + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results + class ListClipsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for "LivestreamService.ListClips". + # @!attribute [rw] clips + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Clip>] + # The list of Clip + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListClipsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.GetClip". + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`. + class GetClipRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.CreateClip". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, in the following form: + # `projects/{project}/locations/{location}/channels/{channel}`. + # @!attribute [rw] clip_id + # @return [::String] + # Required. The ID of the clip resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @!attribute [rw] clip + # @return [::Google::Cloud::Video::LiveStream::V1::Clip] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateClipRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.DeleteClip". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the clip resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class DeleteClipRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.ListDvrSessions". + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListDvrSessionsRequest + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results + class ListDvrSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for "LivestreamService.ListDvrSessions". + # @!attribute [rw] dvr_sessions + # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DvrSession>] + # The list of DVR sessions + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListDvrSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.GetDvrSession". + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource, in the following form: + # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. + class GetDvrSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.CreateDvrSession". + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, in the following form: + # `projects/{project}/locations/{location}/channels/{channelId}`. + # @!attribute [rw] dvr_session_id + # @return [::String] + # Required. The ID of the DVR session resource to be created. + # + # This value must be 1-63 characters, begin and end with a lower-case letter + # or a number, and consist of only lower-case letters, numbers, and hyphens. + # In other words, it must match the following regex: + # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + # @!attribute [rw] dvr_session + # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateDvrSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.DeleteDvrSession". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the event resource, in the form of: + # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class DeleteDvrSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.UpdateDvrSession". + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # DvrSession resource by the update. You can only update the following + # fields: + # + # * `dvrWindows` + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # @!attribute [rw] dvr_session + # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] + # Required. The DVR session resource to be updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class UpdateDvrSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have + # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.GetPool". + # @!attribute [rw] name + # @return [::String] + # Required. The name of the pool resource, in the form of: + # `projects/{project}/locations/{location}/pools/{poolId}`. + class GetPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.UpdatePool". + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the Pool + # resource by the update. You can only update the following fields: + # + # * `networkConfig` + # + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. + # @!attribute [rw] pool + # @return [::Google::Cloud::Video::LiveStream::V1::Pool] + # Required. The pool resource to be updated. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported `(00000000-0000-0000-0000-000000000000)`. + class UpdatePoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for "LivestreamService.PreviewInput" + # @!attribute [rw] name + # @return [::String] + # Required. The name of the input resource, in the form of: + # `projects/{project}/locations/{location}/inputs/{inputId}`. + class PreviewInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for "LivestreamService.PreviewInput" + # @!attribute [rw] uri + # @return [::String] + # URI to display the preview content. + # @!attribute [rw] bearer_token + # @return [::String] + # A bearer token used to authenticate connections that display the preview + # content. The token expires after one hour. For HTTP connections, this token + # should be included as a bearer token inside the Authorization header. + class PreviewInputResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-video-live_stream-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb new file mode 100644 index 000000000000..d15ba7af54e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 civil time (or occasionally physical time). + # + # This type can represent a civil time in one of a few possible ways: + # + # * When utc_offset is set and time_zone is unset: a civil time on a calendar + # day with a particular offset from UTC. + # * When time_zone is set and utc_offset is unset: a civil time on a calendar + # day in a particular time zone. + # * When neither time_zone nor utc_offset is set: a civil time on a calendar + # day in local time. + # + # The date is relative to the Proleptic Gregorian Calendar. + # + # If year is 0, the DateTime is considered not to have a specific year. month + # and day must have valid, non-zero values. + # + # This type may also be used to represent a physical time if all the date and + # time fields are set and either case of the `time_offset` oneof is set. + # Consider using `Timestamp` message for physical time instead. If your use + # case also would like to store the user's timezone, that can be done in + # another field. + # + # This type is more flexible than some applications may want. Make sure to + # document and validate your application's limitations. + # @!attribute [rw] year + # @return [::Integer] + # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + # datetime without a year. + # @!attribute [rw] month + # @return [::Integer] + # Required. Month of year. Must be from 1 to 12. + # @!attribute [rw] day + # @return [::Integer] + # Required. Day of month. Must be from 1 to 31 and valid for the year and + # month. + # @!attribute [rw] hours + # @return [::Integer] + # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API + # may choose to allow the value "24:00:00" for scenarios like business + # closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Required. Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An + # API may allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Required. Fractions of seconds in nanoseconds. Must be from 0 to + # 999,999,999. + # @!attribute [rw] utc_offset + # @return [::Google::Protobuf::Duration] + # UTC offset. Must be whole seconds, between -18 hours and +18 hours. + # For example, a UTC offset of -4:00 would be represented as + # { seconds: -14400 }. + # + # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone. + # + # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class DateTime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a time zone from the + # [IANA Time Zone Database](https://www.iana.org/time-zones). + # @!attribute [rw] id + # @return [::String] + # IANA Time Zone Database time zone, e.g. "America/New_York". + # @!attribute [rw] version + # @return [::String] + # Optional. IANA Time Zone Database version number, e.g. "2019a". + class TimeZone + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile new file mode 100644 index 000000000000..ce646e3d1d3b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1", path: "../" +else + gem "google-cloud-video-live_stream-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-video-live_stream-v1/snippets/livestream_service/create_asset.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb new file mode 100644 index 000000000000..1cd597923642 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateAsset_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the create_asset call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_asset. +# +def create_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new + + # Call the create_asset method. + result = client.create_asset 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 livestream_v1_generated_LivestreamService_CreateAsset_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb new file mode 100644 index 000000000000..dac75f9c51b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateChannel_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the create_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_channel. +# +def create_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new + + # Call the create_channel method. + result = client.create_channel 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 livestream_v1_generated_LivestreamService_CreateChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb new file mode 100644 index 000000000000..263b1fbd6a78 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateClip_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the create_clip call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_clip. +# +def create_clip + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new + + # Call the create_clip method. + result = client.create_clip 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 livestream_v1_generated_LivestreamService_CreateClip_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb new file mode 100644 index 000000000000..be10cb5c574b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateDvrSession_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the create_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_dvr_session. +# +def create_dvr_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new + + # Call the create_dvr_session method. + result = client.create_dvr_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 livestream_v1_generated_LivestreamService_CreateDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb new file mode 100644 index 000000000000..6ef860baaa1f --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateEvent_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the create_event call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_event. +# +def create_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new + + # Call the create_event method. + result = client.create_event request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + p result +end +# [END livestream_v1_generated_LivestreamService_CreateEvent_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb new file mode 100644 index 000000000000..2e25d9fe3e52 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateInput_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the create_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_input. +# +def create_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new + + # Call the create_input method. + result = client.create_input 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 livestream_v1_generated_LivestreamService_CreateInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb new file mode 100644 index 000000000000..c85eed4d8460 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteAsset_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the delete_asset call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_asset. +# +def delete_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new + + # Call the delete_asset method. + result = client.delete_asset 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 livestream_v1_generated_LivestreamService_DeleteAsset_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb new file mode 100644 index 000000000000..d78c007e161b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteChannel_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the delete_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_channel. +# +def delete_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new + + # Call the delete_channel method. + result = client.delete_channel 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 livestream_v1_generated_LivestreamService_DeleteChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb new file mode 100644 index 000000000000..be654078b442 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteClip_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the delete_clip call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_clip. +# +def delete_clip + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new + + # Call the delete_clip method. + result = client.delete_clip 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 livestream_v1_generated_LivestreamService_DeleteClip_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb new file mode 100644 index 000000000000..733d7fa61a1c --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteDvrSession_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the delete_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_dvr_session. +# +def delete_dvr_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.new + + # Call the delete_dvr_session method. + result = client.delete_dvr_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 livestream_v1_generated_LivestreamService_DeleteDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb new file mode 100644 index 000000000000..bf4b8ad1c01d --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteEvent_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the delete_event call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_event. +# +def delete_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new + + # Call the delete_event method. + result = client.delete_event request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END livestream_v1_generated_LivestreamService_DeleteEvent_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb new file mode 100644 index 000000000000..7f32c9a49824 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteInput_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the delete_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_input. +# +def delete_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new + + # Call the delete_input method. + result = client.delete_input 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 livestream_v1_generated_LivestreamService_DeleteInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb new file mode 100644 index 000000000000..4f9f71971649 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetAsset_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the get_asset call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_asset. +# +def get_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new + + # Call the get_asset method. + result = client.get_asset request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset. + p result +end +# [END livestream_v1_generated_LivestreamService_GetAsset_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb new file mode 100644 index 000000000000..98a538f10b25 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetChannel_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the get_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_channel. +# +def get_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new + + # Call the get_channel method. + result = client.get_channel request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. + p result +end +# [END livestream_v1_generated_LivestreamService_GetChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb new file mode 100644 index 000000000000..62488fe46f26 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetClip_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the get_clip call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_clip. +# +def get_clip + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new + + # Call the get_clip method. + result = client.get_clip request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip. + p result +end +# [END livestream_v1_generated_LivestreamService_GetClip_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb new file mode 100644 index 000000000000..6a651d07ac87 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetDvrSession_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the get_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_dvr_session. +# +def get_dvr_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new + + # Call the get_dvr_session method. + result = client.get_dvr_session request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::DvrSession. + p result +end +# [END livestream_v1_generated_LivestreamService_GetDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb new file mode 100644 index 000000000000..e0376dfa6af5 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetEvent_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the get_event call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_event. +# +def get_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new + + # Call the get_event method. + result = client.get_event request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + p result +end +# [END livestream_v1_generated_LivestreamService_GetEvent_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb new file mode 100644 index 000000000000..2b5a8ccf03f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetInput_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the get_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_input. +# +def get_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new + + # Call the get_input method. + result = client.get_input request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. + p result +end +# [END livestream_v1_generated_LivestreamService_GetInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb new file mode 100644 index 000000000000..8ea9da19a6cf --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetPool_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the get_pool call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_pool. +# +def get_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new + + # Call the get_pool method. + result = client.get_pool request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool. + p result +end +# [END livestream_v1_generated_LivestreamService_GetPool_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb new file mode 100644 index 000000000000..3756f6096bdb --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListAssets_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the list_assets call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_assets. +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new + + # Call the list_assets method. + result = client.list_assets 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::Video::LiveStream::V1::Asset. + p item + end +end +# [END livestream_v1_generated_LivestreamService_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb new file mode 100644 index 000000000000..d91e8936af0b --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListChannels_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the list_channels call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_channels. +# +def list_channels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new + + # Call the list_channels method. + result = client.list_channels 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::Video::LiveStream::V1::Channel. + p item + end +end +# [END livestream_v1_generated_LivestreamService_ListChannels_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb new file mode 100644 index 000000000000..c38a77a4210e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListClips_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the list_clips call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_clips. +# +def list_clips + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new + + # Call the list_clips method. + result = client.list_clips 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::Video::LiveStream::V1::Clip. + p item + end +end +# [END livestream_v1_generated_LivestreamService_ListClips_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb new file mode 100644 index 000000000000..f3882aac3b1f --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListDvrSessions_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the list_dvr_sessions call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_dvr_sessions. +# +def list_dvr_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.new + + # Call the list_dvr_sessions method. + result = client.list_dvr_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::Video::LiveStream::V1::DvrSession. + p item + end +end +# [END livestream_v1_generated_LivestreamService_ListDvrSessions_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb new file mode 100644 index 000000000000..ad81a5f24b7f --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListEvents_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the list_events call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_events. +# +def list_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new + + # Call the list_events method. + result = client.list_events 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::Video::LiveStream::V1::Event. + p item + end +end +# [END livestream_v1_generated_LivestreamService_ListEvents_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb new file mode 100644 index 000000000000..3806909b0944 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListInputs_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the list_inputs call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_inputs. +# +def list_inputs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new + + # Call the list_inputs method. + result = client.list_inputs 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::Video::LiveStream::V1::Input. + p item + end +end +# [END livestream_v1_generated_LivestreamService_ListInputs_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb new file mode 100644 index 000000000000..d550a09e0211 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_PreviewInput_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the preview_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#preview_input. +# +def preview_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new + + # Call the preview_input method. + result = client.preview_input request + + # The returned object is of type Google::Cloud::Video::LiveStream::V1::PreviewInputResponse. + p result +end +# [END livestream_v1_generated_LivestreamService_PreviewInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb new file mode 100644 index 000000000000..df968f3cb54a --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StartChannel_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the start_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#start_channel. +# +def start_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new + + # Call the start_channel method. + result = client.start_channel 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 livestream_v1_generated_LivestreamService_StartChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb new file mode 100644 index 000000000000..844445f7f9b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StartDistribution_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the start_distribution call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#start_distribution. +# +def start_distribution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new + + # Call the start_distribution method. + result = client.start_distribution 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 livestream_v1_generated_LivestreamService_StartDistribution_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb new file mode 100644 index 000000000000..8c3b49c350c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StopChannel_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the stop_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#stop_channel. +# +def stop_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new + + # Call the stop_channel method. + result = client.stop_channel 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 livestream_v1_generated_LivestreamService_StopChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb new file mode 100644 index 000000000000..e6250762bc48 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StopDistribution_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the stop_distribution call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#stop_distribution. +# +def stop_distribution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new + + # Call the stop_distribution method. + result = client.stop_distribution 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 livestream_v1_generated_LivestreamService_StopDistribution_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb new file mode 100644 index 000000000000..69b1b71701ab --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdateChannel_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the update_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_channel. +# +def update_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new + + # Call the update_channel method. + result = client.update_channel 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 livestream_v1_generated_LivestreamService_UpdateChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb new file mode 100644 index 000000000000..71198791fe7c --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdateDvrSession_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the update_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_dvr_session. +# +def update_dvr_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new + + # Call the update_dvr_session method. + result = client.update_dvr_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 livestream_v1_generated_LivestreamService_UpdateDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb new file mode 100644 index 000000000000..ecbc94e34893 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdateInput_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the update_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_input. +# +def update_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new + + # Call the update_input method. + result = client.update_input 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 livestream_v1_generated_LivestreamService_UpdateInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb new file mode 100644 index 000000000000..07fb543dd597 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdatePool_sync] +require "google/cloud/video/live_stream/v1" + +## +# Snippet for the update_pool call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_pool. +# +def update_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new + + # Call the update_pool method. + result = client.update_pool 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 livestream_v1_generated_LivestreamService_UpdatePool_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json new file mode 100644 index 000000000000..7a2c0afa9929 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json @@ -0,0 +1,1375 @@ +{ + "client_library": { + "name": "google-cloud-video-live_stream-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.video.livestream.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "livestream_v1_generated_LivestreamService_CreateChannel_sync", + "title": "Snippet for the create_channel call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_channel.", + "file": "livestream_service/create_channel.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_channel", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_channel", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "CreateChannel", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_ListChannels_sync", + "title": "Snippet for the list_channels call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_channels.", + "file": "livestream_service/list_channels.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_channels", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_channels", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "ListChannels", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_GetChannel_sync", + "title": "Snippet for the get_channel call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_channel.", + "file": "livestream_service/get_channel.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_channel", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_channel", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::GetChannelRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::Channel", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "GetChannel", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_DeleteChannel_sync", + "title": "Snippet for the delete_channel call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_channel.", + "file": "livestream_service/delete_channel.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_channel", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_channel", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "DeleteChannel", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_UpdateChannel_sync", + "title": "Snippet for the update_channel call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_channel.", + "file": "livestream_service/update_channel.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_channel", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_channel", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "UpdateChannel", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_StartChannel_sync", + "title": "Snippet for the start_channel call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_channel.", + "file": "livestream_service/start_channel.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_channel", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_channel", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::StartChannelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "StartChannel", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_StopChannel_sync", + "title": "Snippet for the stop_channel call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_channel.", + "file": "livestream_service/stop_channel.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_channel", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_channel", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::StopChannelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "StopChannel", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_StartDistribution_sync", + "title": "Snippet for the start_distribution call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_distribution.", + "file": "livestream_service/start_distribution.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_distribution", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_distribution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "StartDistribution", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.StartDistribution", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_StopDistribution_sync", + "title": "Snippet for the stop_distribution call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_distribution.", + "file": "livestream_service/stop_distribution.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_distribution", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_distribution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "StopDistribution", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.StopDistribution", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_CreateInput_sync", + "title": "Snippet for the create_input call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_input.", + "file": "livestream_service/create_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_input", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::CreateInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "CreateInput", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_ListInputs_sync", + "title": "Snippet for the list_inputs call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_inputs.", + "file": "livestream_service/list_inputs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_inputs", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_inputs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::ListInputsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::ListInputsResponse", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "ListInputs", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_GetInput_sync", + "title": "Snippet for the get_input call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_input.", + "file": "livestream_service/get_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_input", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::GetInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::Input", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "GetInput", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetInput", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_DeleteInput_sync", + "title": "Snippet for the delete_input call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_input.", + "file": "livestream_service/delete_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_input", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "DeleteInput", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_UpdateInput_sync", + "title": "Snippet for the update_input call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_input.", + "file": "livestream_service/update_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_input", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "UpdateInput", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_PreviewInput_sync", + "title": "Snippet for the preview_input call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#preview_input.", + "file": "livestream_service/preview_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "preview_input", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#preview_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "PreviewInput", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.PreviewInput", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_CreateEvent_sync", + "title": "Snippet for the create_event call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_event.", + "file": "livestream_service/create_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_event", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::CreateEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::Event", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "CreateEvent", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_ListEvents_sync", + "title": "Snippet for the list_events call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_events.", + "file": "livestream_service/list_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_events", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::ListEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::ListEventsResponse", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "ListEvents", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_GetEvent_sync", + "title": "Snippet for the get_event call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_event.", + "file": "livestream_service/get_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_event", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::GetEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::Event", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "GetEvent", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_DeleteEvent_sync", + "title": "Snippet for the delete_event call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_event.", + "file": "livestream_service/delete_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_event", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "DeleteEvent", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_ListClips_sync", + "title": "Snippet for the list_clips call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_clips.", + "file": "livestream_service/list_clips.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clips", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_clips", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::ListClipsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::ListClipsResponse", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "ListClips", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListClips", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_GetClip_sync", + "title": "Snippet for the get_clip call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_clip.", + "file": "livestream_service/get_clip.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_clip", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_clip", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::GetClipRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::Clip", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "GetClip", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetClip", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_CreateClip_sync", + "title": "Snippet for the create_clip call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_clip.", + "file": "livestream_service/create_clip.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_clip", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_clip", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::CreateClipRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "CreateClip", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateClip", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_DeleteClip_sync", + "title": "Snippet for the delete_clip call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_clip.", + "file": "livestream_service/delete_clip.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_clip", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_clip", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "DeleteClip", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteClip", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_CreateDvrSession_sync", + "title": "Snippet for the create_dvr_session call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_dvr_session.", + "file": "livestream_service/create_dvr_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_dvr_session", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_dvr_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "CreateDvrSession", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateDvrSession", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_ListDvrSessions_sync", + "title": "Snippet for the list_dvr_sessions call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_dvr_sessions.", + "file": "livestream_service/list_dvr_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_dvr_sessions", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_dvr_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "ListDvrSessions", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListDvrSessions", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_GetDvrSession_sync", + "title": "Snippet for the get_dvr_session call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_dvr_session.", + "file": "livestream_service/get_dvr_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dvr_session", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_dvr_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::DvrSession", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "GetDvrSession", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetDvrSession", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_DeleteDvrSession_sync", + "title": "Snippet for the delete_dvr_session call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_dvr_session.", + "file": "livestream_service/delete_dvr_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_dvr_session", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_dvr_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "DeleteDvrSession", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteDvrSession", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_UpdateDvrSession_sync", + "title": "Snippet for the update_dvr_session call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_dvr_session.", + "file": "livestream_service/update_dvr_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_dvr_session", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_dvr_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "UpdateDvrSession", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdateDvrSession", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_CreateAsset_sync", + "title": "Snippet for the create_asset call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_asset.", + "file": "livestream_service/create_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_asset", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "CreateAsset", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateAsset", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_DeleteAsset_sync", + "title": "Snippet for the delete_asset call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_asset.", + "file": "livestream_service/delete_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_asset", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "DeleteAsset", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteAsset", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_GetAsset_sync", + "title": "Snippet for the get_asset call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_asset.", + "file": "livestream_service/get_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_asset", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::GetAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::Asset", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "GetAsset", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetAsset", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_ListAssets_sync", + "title": "Snippet for the list_assets call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_assets.", + "file": "livestream_service/list_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_assets", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "ListAssets", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListAssets", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_GetPool_sync", + "title": "Snippet for the get_pool call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_pool.", + "file": "livestream_service/get_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_pool", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::GetPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Video::LiveStream::V1::Pool", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "GetPool", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetPool", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "livestream_v1_generated_LivestreamService_UpdatePool_sync", + "title": "Snippet for the update_pool call in the LivestreamService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_pool.", + "file": "livestream_service/update_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_pool", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LivestreamService::Client", + "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" + }, + "method": { + "short_name": "UpdatePool", + "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdatePool", + "service": { + "short_name": "LivestreamService", + "full_name": "google.cloud.video.livestream.v1.LivestreamService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb new file mode 100644 index 000000000000..6d395ffb507e --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" +require "google/cloud/video/livestream/v1/service_services_pb" +require "google/cloud/video/live_stream/v1/livestream_service" + +class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb new file mode 100644 index 000000000000..ae4c7b52909c --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/livestream_service" + +class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_asset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.asset_path project: "value0", location: "value1", asset: "value2" + assert_equal "projects/value0/locations/value1/assets/value2", path + end + end + + def test_channel_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.channel_path project: "value0", location: "value1", channel: "value2" + assert_equal "projects/value0/locations/value1/channels/value2", path + end + end + + def test_clip_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.clip_path project: "value0", location: "value1", channel: "value2", clip: "value3" + assert_equal "projects/value0/locations/value1/channels/value2/clips/value3", path + end + end + + def test_dvr_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::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dvr_session_path project: "value0", location: "value1", channel: "value2", dvr_session: "value3" + assert_equal "projects/value0/locations/value1/channels/value2/dvrSessions/value3", path + end + end + + def test_event_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_path project: "value0", location: "value1", channel: "value2", event: "value3" + assert_equal "projects/value0/locations/value1/channels/value2/events/value3", path + end + end + + def test_input_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.input_path project: "value0", location: "value1", input: "value2" + assert_equal "projects/value0/locations/value1/inputs/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::Video::LiveStream::V1::LivestreamService::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_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end + + def test_pool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.pool_path project: "value0", location: "value1", pool: "value2" + assert_equal "projects/value0/locations/value1/pools/value2", path + end + end + + def test_secret_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_version_path project: "value0", secret: "value1", version: "value2" + assert_equal "projects/value0/secrets/value1/versions/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb new file mode 100644 index 000000000000..c116c36189e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb @@ -0,0 +1,1998 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" +require "google/cloud/video/live_stream/v1/livestream_service/rest" + + +class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_channel + # 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" + channel = {} + channel_id = "hello world" + request_id = "hello world" + + create_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_channel_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_channel({ parent: parent, channel: channel, channel_id: channel_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_channel parent: parent, channel: channel, channel_id: channel_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_channel ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_channel({ parent: parent, channel: channel, channel_id: channel_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_channel(::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_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_channel_client_stub.call_count + end + end + end + + def test_list_channels + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.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_channels_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_channels_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_channels_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_channels({ 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_channels 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_channels ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels({ 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_channels(::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels_client_stub.call_count + end + end + end + + def test_get_channel + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::Channel.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_channel_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_channel({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_channel name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_channel ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_channel({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_channel(::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_channel_client_stub.call_count + end + end + end + + def test_delete_channel + # 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" + force = true + + delete_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_channel_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_channel({ name: name, request_id: request_id, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_channel name: name, request_id: request_id, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_channel ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_channel({ name: name, request_id: request_id, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_channel(::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_channel_client_stub.call_count + end + end + end + + def test_update_channel + # 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. + update_mask = {} + channel = {} + request_id = "hello world" + + update_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_channel_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_channel({ update_mask: update_mask, channel: channel, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_channel update_mask: update_mask, channel: channel, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_channel ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_channel({ update_mask: update_mask, channel: channel, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_channel(::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_channel_client_stub.call_count + end + end + end + + def test_start_channel + # 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" + + start_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_start_channel_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_channel({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_channel name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_channel ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_channel({ 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.start_channel(::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.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, start_channel_client_stub.call_count + end + end + end + + def test_stop_channel + # 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" + + stop_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_stop_channel_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_channel({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_channel name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_channel ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_channel({ 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.stop_channel(::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.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, stop_channel_client_stub.call_count + end + end + end + + def test_start_distribution + # 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" + distribution_keys = ["hello world"] + request_id = "hello world" + + start_distribution_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_start_distribution_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_distribution_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_distribution name: name, distribution_keys: distribution_keys, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_distribution ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_distribution(::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_distribution_client_stub.call_count + end + end + end + + def test_stop_distribution + # 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" + distribution_keys = ["hello world"] + request_id = "hello world" + + stop_distribution_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_stop_distribution_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_distribution_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_distribution name: name, distribution_keys: distribution_keys, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_distribution ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.stop_distribution(::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, stop_distribution_client_stub.call_count + end + end + end + + def test_create_input + # 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" + input = {} + input_id = "hello world" + request_id = "hello world" + + create_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_input({ parent: parent, input: input, input_id: input_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_input parent: parent, input: input, input_id: input_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_input ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_input({ parent: parent, input: input, input_id: input_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_input(::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_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_input_client_stub.call_count + end + end + end + + def test_list_inputs + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.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_inputs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_inputs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_inputs_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_inputs({ 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_inputs 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_inputs ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs({ 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_inputs(::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs_client_stub.call_count + end + end + end + + def test_get_input + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::Input.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_input({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_input name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_input ::Google::Cloud::Video::LiveStream::V1::GetInputRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_input({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_input(::Google::Cloud::Video::LiveStream::V1::GetInputRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_input_client_stub.call_count + end + end + end + + def test_delete_input + # 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_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_input({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_input name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_input ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input({ 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_input(::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input_client_stub.call_count + end + end + end + + def test_update_input + # 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. + update_mask = {} + input = {} + request_id = "hello world" + + update_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_input({ update_mask: update_mask, input: input, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_input update_mask: update_mask, input: input, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_input ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_input({ update_mask: update_mask, input: input, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_input(::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_input_client_stub.call_count + end + end + end + + def test_preview_input + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + preview_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_preview_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, preview_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.preview_input({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.preview_input name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.preview_input ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.preview_input({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.preview_input(::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, preview_input_client_stub.call_count + end + end + end + + def test_create_event + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::Event.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + event = {} + event_id = "hello world" + request_id = "hello world" + + create_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_event_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_event({ parent: parent, event: event, event_id: event_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_event parent: parent, event: event, event_id: event_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_event ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_event({ parent: parent, event: event, event_id: event_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_event(::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_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_event_client_stub.call_count + end + end + end + + def test_list_events + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.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_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_events_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_events({ 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_events 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_events ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events_client_stub.call_count + end + end + end + + def test_get_event + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::Event.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_event_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_event({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_event name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_event ::Google::Cloud::Video::LiveStream::V1::GetEventRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_event({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_event(::Google::Cloud::Video::LiveStream::V1::GetEventRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_event_client_stub.call_count + end + end + end + + def test_delete_event + # 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" + request_id = "hello world" + + delete_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_event_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_event({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_event name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_event ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.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_event({ 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_event(::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.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_event_client_stub.call_count + end + end + end + + def test_list_clips + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse.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_clips_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_clips_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clips_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clips({ 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_clips 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_clips ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips({ 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_clips(::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips_client_stub.call_count + end + end + end + + def test_get_clip + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::Clip.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_clip_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_clip_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_clip_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_clip({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_clip name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_clip ::Google::Cloud::Video::LiveStream::V1::GetClipRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_clip({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_clip(::Google::Cloud::Video::LiveStream::V1::GetClipRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_clip_client_stub.call_count + end + end + end + + def test_create_clip + # 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" + clip_id = "hello world" + clip = {} + request_id = "hello world" + + create_clip_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_clip_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_clip_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_clip({ parent: parent, clip_id: clip_id, clip: clip, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_clip parent: parent, clip_id: clip_id, clip: clip, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_clip ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_clip({ parent: parent, clip_id: clip_id, clip: clip, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_clip(::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_clip_client_stub.call_count + end + end + end + + def test_delete_clip + # 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_clip_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_clip_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_clip_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_clip({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_clip name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_clip ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip({ 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_clip(::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip_client_stub.call_count + end + end + end + + def test_create_dvr_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" + dvr_session_id = "hello world" + dvr_session = {} + request_id = "hello world" + + create_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_dvr_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_dvr_session parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_dvr_session ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_dvr_session(::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_dvr_session_client_stub.call_count + end + end + end + + def test_list_dvr_sessions + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse.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_dvr_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_dvr_sessions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_dvr_sessions_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_dvr_sessions({ 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_dvr_sessions 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_dvr_sessions ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions({ 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_dvr_sessions(::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions_client_stub.call_count + end + end + end + + def test_get_dvr_session + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::DvrSession.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_dvr_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dvr_session({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dvr_session name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dvr_session ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dvr_session({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dvr_session(::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dvr_session_client_stub.call_count + end + end + end + + def test_delete_dvr_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_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_dvr_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_dvr_session({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_dvr_session name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_dvr_session ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_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_dvr_session(::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_session_client_stub.call_count + end + end + end + + def test_update_dvr_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. + update_mask = {} + dvr_session = {} + request_id = "hello world" + + update_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_dvr_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_dvr_session update_mask: update_mask, dvr_session: dvr_session, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_dvr_session ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_dvr_session(::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_dvr_session_client_stub.call_count + end + end + end + + def test_create_asset + # 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" + asset = {} + asset_id = "hello world" + request_id = "hello world" + + create_asset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_asset_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_asset({ parent: parent, asset: asset, asset_id: asset_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_asset parent: parent, asset: asset, asset_id: asset_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_asset ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_asset({ parent: parent, asset: asset, asset_id: asset_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_asset(::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_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_asset_client_stub.call_count + end + end + end + + def test_delete_asset + # 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_asset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_asset_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_asset({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_asset name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_asset ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset({ 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_asset(::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset_client_stub.call_count + end + end + end + + def test_get_asset + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::Asset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_asset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_asset_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_asset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_asset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_asset ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_asset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_asset(::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_asset_client_stub.call_count + end + end + end + + def test_list_assets + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.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_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_assets({ 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_assets 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_assets ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets_client_stub.call_count + end + end + end + + def test_get_pool + # Create test objects. + client_result = ::Google::Cloud::Video::LiveStream::V1::Pool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_pool_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_pool({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_pool name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_pool ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_pool({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_pool(::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_pool_client_stub.call_count + end + end + end + + def test_update_pool + # 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. + update_mask = {} + pool = {} + request_id = "hello world" + + update_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_pool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_pool_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_pool({ update_mask: update_mask, pool: pool, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_pool update_mask: update_mask, pool: pool, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_pool ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_pool({ update_mask: update_mask, pool: pool, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_pool(::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_pool_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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb new file mode 100644 index 000000000000..bf117eb14fe0 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb @@ -0,0 +1,2336 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" +require "google/cloud/video/live_stream/v1/livestream_service" + +class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_channel + # 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" + channel = {} + channel_id = "hello world" + request_id = "hello world" + + create_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_channel, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Channel), request["channel"] + assert_equal "hello world", request["channel_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_channel({ parent: parent, channel: channel, channel_id: channel_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_channel parent: parent, channel: channel, channel_id: channel_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_channel ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_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_channel({ parent: parent, channel: channel, channel_id: channel_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_channel(::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_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_channel_client_stub.call_rpc_count + end + end + + def test_list_channels + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.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_channels_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_channels, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, 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_channels_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_channels({ 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_channels 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_channels ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels({ 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_channels(::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels_client_stub.call_rpc_count + end + end + + def test_get_channel + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::Channel.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_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_channel, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_channel({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_channel name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_channel ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_channel({ 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_channel(::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.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_channel_client_stub.call_rpc_count + end + end + + def test_delete_channel + # 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" + force = true + + delete_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_channel, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_channel({ name: name, request_id: request_id, force: force }) 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_channel name: name, request_id: request_id, force: force 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_channel ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force) 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_channel({ name: name, request_id: request_id, force: force }, 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_channel(::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force), 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_channel_client_stub.call_rpc_count + end + end + + def test_update_channel + # 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. + update_mask = {} + channel = {} + request_id = "hello world" + + update_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_channel, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Channel), request["channel"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_channel({ update_mask: update_mask, channel: channel, 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_channel update_mask: update_mask, channel: channel, 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_channel ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, 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_channel({ update_mask: update_mask, channel: channel, 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_channel(::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, 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_channel_client_stub.call_rpc_count + end + end + + def test_start_channel + # 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" + + start_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_channel, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_channel({ 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.start_channel 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.start_channel ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.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.start_channel({ 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.start_channel(::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.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, start_channel_client_stub.call_rpc_count + end + end + + def test_stop_channel + # 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" + + stop_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_channel, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_channel_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_channel({ 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.stop_channel 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.stop_channel ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.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.stop_channel({ 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.stop_channel(::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.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, stop_channel_client_stub.call_rpc_count + end + end + + def test_start_distribution + # 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" + distribution_keys = ["hello world"] + request_id = "hello world" + + start_distribution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_distribution, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["distribution_keys"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_distribution_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution name: name, distribution_keys: distribution_keys, 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_distribution ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution(::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution_client_stub.call_rpc_count + end + end + + def test_stop_distribution + # 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" + distribution_keys = ["hello world"] + request_id = "hello world" + + stop_distribution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_distribution, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["distribution_keys"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_distribution_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution name: name, distribution_keys: distribution_keys, 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_distribution ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution(::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution_client_stub.call_rpc_count + end + end + + def test_create_input + # 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" + input = {} + input_id = "hello world" + request_id = "hello world" + + create_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_input, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Input), request["input"] + assert_equal "hello world", request["input_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_input({ parent: parent, input: input, input_id: input_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_input parent: parent, input: input, input_id: input_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_input ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_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_input({ parent: parent, input: input, input_id: input_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_input(::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_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_input_client_stub.call_rpc_count + end + end + + def test_list_inputs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.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_inputs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_inputs, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, 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_inputs_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_inputs({ 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_inputs 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_inputs ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs({ 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_inputs(::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs_client_stub.call_rpc_count + end + end + + def test_get_input + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::Input.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_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_input, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetInputRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_input({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_input name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_input ::Google::Cloud::Video::LiveStream::V1::GetInputRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_input({ 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_input(::Google::Cloud::Video::LiveStream::V1::GetInputRequest.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_input_client_stub.call_rpc_count + end + end + + def test_delete_input + # 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_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_input, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_input({ 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_input 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_input ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input({ 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_input(::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input_client_stub.call_rpc_count + end + end + + def test_update_input + # 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. + update_mask = {} + input = {} + request_id = "hello world" + + update_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_input, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Input), request["input"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_input({ update_mask: update_mask, input: input, 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_input update_mask: update_mask, input: input, 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_input ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, 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_input({ update_mask: update_mask, input: input, 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_input(::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, 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_input_client_stub.call_rpc_count + end + end + + def test_preview_input + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse.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" + + preview_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :preview_input, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, preview_input_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.preview_input({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.preview_input name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.preview_input ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.preview_input({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.preview_input(::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.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, preview_input_client_stub.call_rpc_count + end + end + + def test_create_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::Event.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" + event = {} + event_id = "hello world" + request_id = "hello world" + + create_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_event, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Event), request["event"] + assert_equal "hello world", request["event_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_event_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_event({ parent: parent, event: event, event_id: event_id, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_event parent: parent, event: event, event_id: event_id, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_event ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_id, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_event({ parent: parent, event: event, event_id: event_id, 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.create_event(::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_id, 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, create_event_client_stub.call_rpc_count + end + end + + def test_list_events + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.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_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_events, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, 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_events_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_events({ 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_events 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_events ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events_client_stub.call_rpc_count + end + end + + def test_get_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::Event.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_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_event, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetEventRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_event_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_event({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_event name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_event ::Google::Cloud::Video::LiveStream::V1::GetEventRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_event({ 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_event(::Google::Cloud::Video::LiveStream::V1::GetEventRequest.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_event_client_stub.call_rpc_count + end + end + + def test_delete_event + # 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" + request_id = "hello world" + + delete_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_event, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_event_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_event({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_event name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_event ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_event({ name: name, 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.delete_event(::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new(name: name, 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, delete_event_client_stub.call_rpc_count + end + end + + def test_list_clips + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse.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_clips_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clips, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, 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_clips_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clips({ 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_clips 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_clips ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips({ 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_clips(::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips_client_stub.call_rpc_count + end + end + + def test_get_clip + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::Clip.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_clip_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_clip, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetClipRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_clip_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_clip({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_clip name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_clip ::Google::Cloud::Video::LiveStream::V1::GetClipRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_clip({ 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_clip(::Google::Cloud::Video::LiveStream::V1::GetClipRequest.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_clip_client_stub.call_rpc_count + end + end + + def test_create_clip + # 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" + clip_id = "hello world" + clip = {} + request_id = "hello world" + + create_clip_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_clip, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["clip_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Clip), request["clip"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_clip_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_clip({ parent: parent, clip_id: clip_id, clip: clip, 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_clip parent: parent, clip_id: clip_id, clip: clip, 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_clip ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, 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_clip({ parent: parent, clip_id: clip_id, clip: clip, 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_clip(::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, 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_clip_client_stub.call_rpc_count + end + end + + def test_delete_clip + # 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_clip_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_clip, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_clip_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_clip({ 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_clip 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_clip ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip({ 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_clip(::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip_client_stub.call_rpc_count + end + end + + def test_create_dvr_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" + dvr_session_id = "hello world" + dvr_session = {} + request_id = "hello world" + + create_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_dvr_session, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["dvr_session_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::DvrSession), request["dvr_session"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session(::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session_client_stub.call_rpc_count + end + end + + def test_list_dvr_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse.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_dvr_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_dvr_sessions, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, 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_dvr_sessions_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_dvr_sessions({ 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_dvr_sessions 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_dvr_sessions ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions({ 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_dvr_sessions(::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions_client_stub.call_rpc_count + end + end + + def test_get_dvr_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::DvrSession.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_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dvr_session, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dvr_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dvr_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dvr_session ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dvr_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_dvr_session(::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.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_dvr_session_client_stub.call_rpc_count + end + end + + def test_delete_dvr_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_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_dvr_session, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_dvr_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_dvr_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_dvr_session ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_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_dvr_session(::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_session_client_stub.call_rpc_count + end + end + + def test_update_dvr_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. + update_mask = {} + dvr_session = {} + request_id = "hello world" + + update_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_dvr_session, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::DvrSession), request["dvr_session"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_dvr_session_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session(::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session_client_stub.call_rpc_count + end + end + + def test_create_asset + # 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" + asset = {} + asset_id = "hello world" + request_id = "hello world" + + create_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_asset, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Asset), request["asset"] + assert_equal "hello world", request["asset_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_asset_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_asset({ parent: parent, asset: asset, asset_id: asset_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_asset parent: parent, asset: asset, asset_id: asset_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_asset ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_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_asset({ parent: parent, asset: asset, asset_id: asset_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_asset(::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_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_asset_client_stub.call_rpc_count + end + end + + def test_delete_asset + # 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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_asset, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_asset_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_asset({ 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_asset 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_asset ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset({ 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_asset(::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset_client_stub.call_rpc_count + end + end + + def test_get_asset + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::Asset.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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_asset, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_asset_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_asset({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_asset name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_asset ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_asset({ 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_asset(::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.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_asset_client_stub.call_rpc_count + end + end + + def test_list_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.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_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_assets, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, 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_assets_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_assets({ 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_assets 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_assets ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets_client_stub.call_rpc_count + end + end + + def test_get_pool + # Create GRPC objects. + grpc_response = ::Google::Cloud::Video::LiveStream::V1::Pool.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_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_pool, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_pool_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_pool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_pool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_pool ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_pool({ 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_pool(::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.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_pool_client_stub.call_rpc_count + end + end + + def test_update_pool + # 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. + update_mask = {} + pool = {} + request_id = "hello world" + + update_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_pool, name + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Pool), request["pool"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_pool_client_stub do + # Create client + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_pool({ update_mask: update_mask, pool: pool, 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_pool update_mask: update_mask, pool: pool, 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_pool ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, 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_pool({ update_mask: update_mask, pool: pool, 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_pool(::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, 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_pool_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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client, client + assert_equal creds, client.configure.credentials + end + 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::Video::LiveStream::V1::LivestreamService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 789d80c11dfedfa4e9cb257f8cc7e70dd6db28e1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 5 Jan 2026 22:34:11 +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 --- google-cloud-translate/AUTHENTICATION.md | 20 +- .../google-cloud-support/.gitignore | 22 - .../google-cloud-support/.repo-metadata.json | 17 - .../google-cloud-support/.rubocop.yml | 39 - owl-bot-staging/google-cloud-support/.toys.rb | 28 - .../google-cloud-support/.yardopts | 11 - .../google-cloud-support/AUTHENTICATION.md | 122 - .../google-cloud-support/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-support/Gemfile | 28 - .../google-cloud-support/LICENSE.md | 201 - .../google-cloud-support/README.md | 142 - owl-bot-staging/google-cloud-support/Rakefile | 169 - .../google-cloud-support.gemspec | 27 - .../lib/google-cloud-support.rb | 19 - .../lib/google/cloud/support.rb | 269 - .../lib/google/cloud/support/version.rb | 26 - .../test/google/cloud/support/client_test.rb | 75 - .../test/google/cloud/support/version_test.rb | 26 - .../google-cloud-support/test/helper.rb | 25 - .../google-cloud-talent-v4/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-talent-v4/.rubocop.yml | 33 - .../google-cloud-talent-v4/.toys.rb | 28 - .../google-cloud-talent-v4/.yardopts | 12 - .../google-cloud-talent-v4/AUTHENTICATION.md | 122 - .../google-cloud-talent-v4/CHANGELOG.md | 2 - .../google-cloud-talent-v4/Gemfile | 11 - .../google-cloud-talent-v4/LICENSE.md | 201 - .../google-cloud-talent-v4/README.md | 154 - .../google-cloud-talent-v4/Rakefile | 169 - .../gapic_metadata.json | 164 - .../google-cloud-talent-v4.gemspec | 28 - .../lib/google-cloud-talent-v4.rb | 21 - .../lib/google/cloud/talent/v4.rb | 49 - .../lib/google/cloud/talent/v4/common_pb.rb | 79 - .../lib/google/cloud/talent/v4/company_pb.rb | 48 - .../google/cloud/talent/v4/company_service.rb | 55 - .../cloud/talent/v4/company_service/client.rb | 909 ---- .../talent/v4/company_service/credentials.rb | 52 - .../cloud/talent/v4/company_service/paths.rb | 69 - .../cloud/talent/v4/company_service/rest.rb | 52 - .../talent/v4/company_service/rest/client.rb | 831 --- .../v4/company_service/rest/service_stub.rb | 388 -- .../cloud/talent/v4/company_service_pb.rb | 59 - .../talent/v4/company_service_services_pb.rb | 54 - .../lib/google/cloud/talent/v4/completion.rb | 55 - .../cloud/talent/v4/completion/client.rb | 510 -- .../cloud/talent/v4/completion/credentials.rb | 52 - .../cloud/talent/v4/completion/paths.rb | 69 - .../google/cloud/talent/v4/completion/rest.rb | 52 - .../cloud/talent/v4/completion/rest/client.rb | 460 -- .../talent/v4/completion/rest/service_stub.rb | 142 - .../cloud/talent/v4/completion_service_pb.rb | 53 - .../v4/completion_service_services_pb.rb | 46 - .../lib/google/cloud/talent/v4/event_pb.rb | 48 - .../google/cloud/talent/v4/event_service.rb | 55 - .../cloud/talent/v4/event_service/client.rb | 488 -- .../talent/v4/event_service/credentials.rb | 52 - .../cloud/talent/v4/event_service/paths.rb | 50 - .../cloud/talent/v4/event_service/rest.rb | 52 - .../talent/v4/event_service/rest/client.rb | 438 -- .../v4/event_service/rest/service_stub.rb | 143 - .../cloud/talent/v4/event_service_pb.rb | 49 - .../talent/v4/event_service_services_pb.rb | 51 - .../lib/google/cloud/talent/v4/filters_pb.rb | 58 - .../google/cloud/talent/v4/histogram_pb.rb | 43 - .../lib/google/cloud/talent/v4/job_pb.rb | 52 - .../lib/google/cloud/talent/v4/job_service.rb | 56 - .../cloud/talent/v4/job_service/client.rb | 2062 -------- .../talent/v4/job_service/credentials.rb | 52 - .../cloud/talent/v4/job_service/operations.rb | 841 --- .../cloud/talent/v4/job_service/paths.rb | 88 - .../cloud/talent/v4/job_service/rest.rb | 53 - .../talent/v4/job_service/rest/client.rb | 1949 ------- .../talent/v4/job_service/rest/operations.rb | 925 ---- .../v4/job_service/rest/service_stub.rb | 698 --- .../google/cloud/talent/v4/job_service_pb.rb | 86 - .../talent/v4/job_service_services_pb.rb | 90 - .../lib/google/cloud/talent/v4/rest.rb | 41 - .../lib/google/cloud/talent/v4/tenant_pb.rb | 45 - .../google/cloud/talent/v4/tenant_service.rb | 55 - .../cloud/talent/v4/tenant_service/client.rb | 897 ---- .../talent/v4/tenant_service/credentials.rb | 52 - .../cloud/talent/v4/tenant_service/paths.rb | 64 - .../cloud/talent/v4/tenant_service/rest.rb | 52 - .../talent/v4/tenant_service/rest/client.rb | 819 --- .../v4/tenant_service/rest/service_stub.rb | 388 -- .../cloud/talent/v4/tenant_service_pb.rb | 59 - .../talent/v4/tenant_service_services_pb.rb | 53 - .../lib/google/cloud/talent/v4/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/talent/v4/common.rb | 959 ---- .../google/cloud/talent/v4/company.rb | 123 - .../google/cloud/talent/v4/company_service.rb | 133 - .../cloud/talent/v4/completion_service.rb | 148 - .../google/cloud/talent/v4/event.rb | 179 - .../google/cloud/talent/v4/event_service.rb | 42 - .../google/cloud/talent/v4/filters.rb | 392 -- .../google/cloud/talent/v4/histogram.rb | 72 - .../proto_docs/google/cloud/talent/v4/job.rb | 392 -- .../google/cloud/talent/v4/job_service.rb | 929 ---- .../google/cloud/talent/v4/tenant.rb | 50 - .../google/cloud/talent/v4/tenant_service.rb | 121 - .../google/longrunning/operations.rb | 191 - .../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/latlng.rb | 38 - .../proto_docs/google/type/money.rb | 43 - .../proto_docs/google/type/postal_address.rb | 135 - .../proto_docs/google/type/timeofday.rb | 45 - .../google-cloud-talent-v4/snippets/Gemfile | 32 - .../company_service/create_company.rb | 47 - .../company_service/delete_company.rb | 47 - .../snippets/company_service/get_company.rb | 47 - .../company_service/list_companies.rb | 51 - .../company_service/update_company.rb | 47 - .../snippets/completion/complete_query.rb | 47 - .../event_service/create_client_event.rb | 47 - .../snippets/job_service/batch_create_jobs.rb | 54 - .../snippets/job_service/batch_delete_jobs.rb | 54 - .../snippets/job_service/batch_update_jobs.rb | 54 - .../snippets/job_service/create_job.rb | 47 - .../snippets/job_service/delete_job.rb | 47 - .../snippets/job_service/get_job.rb | 47 - .../snippets/job_service/list_jobs.rb | 51 - .../snippets/job_service/search_jobs.rb | 47 - .../job_service/search_jobs_for_alert.rb | 47 - .../snippets/job_service/update_job.rb | 47 - ...ippet_metadata_google.cloud.talent.v4.json | 895 ---- .../snippets/tenant_service/create_tenant.rb | 47 - .../snippets/tenant_service/delete_tenant.rb | 47 - .../snippets/tenant_service/get_tenant.rb | 47 - .../snippets/tenant_service/list_tenants.rb | 51 - .../snippets/tenant_service/update_tenant.rb | 47 - .../talent/v4/company_service_paths_test.rb | 67 - .../talent/v4/company_service_rest_test.rb | 374 -- .../cloud/talent/v4/company_service_test.rb | 409 -- .../cloud/talent/v4/completion_paths_test.rb | 67 - .../cloud/talent/v4/completion_rest_test.rb | 159 - .../google/cloud/talent/v4/completion_test.rb | 174 - .../talent/v4/event_service_paths_test.rb | 55 - .../talent/v4/event_service_rest_test.rb | 154 - .../cloud/talent/v4/event_service_test.rb | 164 - .../talent/v4/job_service_operations_test.rb | 400 -- .../cloud/talent/v4/job_service_paths_test.rb | 79 - .../cloud/talent/v4/job_service_rest_test.rb | 679 --- .../cloud/talent/v4/job_service_test.rb | 798 --- .../talent/v4/tenant_service_paths_test.rb | 67 - .../talent/v4/tenant_service_rest_test.rb | 373 -- .../cloud/talent/v4/tenant_service_test.rb | 407 -- .../google-cloud-talent-v4/test/helper.rb | 25 - .../google-cloud-talent-v4beta1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-talent-v4beta1/.rubocop.yml | 33 - .../google-cloud-talent-v4beta1/.toys.rb | 28 - .../google-cloud-talent-v4beta1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-talent-v4beta1/CHANGELOG.md | 2 - .../google-cloud-talent-v4beta1/Gemfile | 11 - .../google-cloud-talent-v4beta1/LICENSE.md | 201 - .../google-cloud-talent-v4beta1/README.md | 154 - .../google-cloud-talent-v4beta1/Rakefile | 169 - .../gapic_metadata.json | 164 - .../google-cloud-talent-v4beta1.gemspec | 28 - .../lib/google-cloud-talent-v4beta1.rb | 21 - .../lib/google/cloud/talent/v4beta1.rb | 49 - .../google/cloud/talent/v4beta1/batch_pb.rb | 41 - .../google/cloud/talent/v4beta1/common_pb.rb | 79 - .../google/cloud/talent/v4beta1/company_pb.rb | 48 - .../cloud/talent/v4beta1/company_service.rb | 55 - .../talent/v4beta1/company_service/client.rb | 920 ---- .../v4beta1/company_service/credentials.rb | 52 - .../talent/v4beta1/company_service/paths.rb | 105 - .../talent/v4beta1/company_service/rest.rb | 52 - .../v4beta1/company_service/rest/client.rb | 842 --- .../company_service/rest/service_stub.rb | 425 -- .../talent/v4beta1/company_service_pb.rb | 59 - .../v4beta1/company_service_services_pb.rb | 54 - .../google/cloud/talent/v4beta1/completion.rb | 55 - .../cloud/talent/v4beta1/completion/client.rb | 516 -- .../talent/v4beta1/completion/credentials.rb | 52 - .../cloud/talent/v4beta1/completion/paths.rb | 105 - .../cloud/talent/v4beta1/completion/rest.rb | 52 - .../talent/v4beta1/completion/rest/client.rb | 466 -- .../v4beta1/completion/rest/service_stub.rb | 149 - .../talent/v4beta1/completion_service_pb.rb | 53 - .../v4beta1/completion_service_services_pb.rb | 46 - .../google/cloud/talent/v4beta1/event_pb.rb | 48 - .../cloud/talent/v4beta1/event_service.rb | 55 - .../talent/v4beta1/event_service/client.rb | 489 -- .../v4beta1/event_service/credentials.rb | 52 - .../talent/v4beta1/event_service/paths.rb | 64 - .../talent/v4beta1/event_service/rest.rb | 52 - .../v4beta1/event_service/rest/client.rb | 439 -- .../event_service/rest/service_stub.rb | 151 - .../cloud/talent/v4beta1/event_service_pb.rb | 49 - .../v4beta1/event_service_services_pb.rb | 51 - .../google/cloud/talent/v4beta1/filters_pb.rb | 58 - .../cloud/talent/v4beta1/histogram_pb.rb | 43 - .../lib/google/cloud/talent/v4beta1/job_pb.rb | 52 - .../cloud/talent/v4beta1/job_service.rb | 56 - .../talent/v4beta1/job_service/client.rb | 2083 -------- .../talent/v4beta1/job_service/credentials.rb | 52 - .../talent/v4beta1/job_service/operations.rb | 841 --- .../cloud/talent/v4beta1/job_service/paths.rb | 146 - .../cloud/talent/v4beta1/job_service/rest.rb | 53 - .../talent/v4beta1/job_service/rest/client.rb | 1970 ------- .../v4beta1/job_service/rest/operations.rb | 925 ---- .../v4beta1/job_service/rest/service_stub.rb | 774 --- .../cloud/talent/v4beta1/job_service_pb.rb | 84 - .../talent/v4beta1/job_service_services_pb.rb | 90 - .../lib/google/cloud/talent/v4beta1/rest.rb | 41 - .../google/cloud/talent/v4beta1/tenant_pb.rb | 46 - .../cloud/talent/v4beta1/tenant_service.rb | 55 - .../talent/v4beta1/tenant_service/client.rb | 899 ---- .../v4beta1/tenant_service/credentials.rb | 52 - .../talent/v4beta1/tenant_service/paths.rb | 64 - .../talent/v4beta1/tenant_service/rest.rb | 52 - .../v4beta1/tenant_service/rest/client.rb | 821 --- .../tenant_service/rest/service_stub.rb | 388 -- .../cloud/talent/v4beta1/tenant_service_pb.rb | 59 - .../v4beta1/tenant_service_services_pb.rb | 53 - .../google/cloud/talent/v4beta1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/talent/v4beta1/common.rb | 955 ---- .../google/cloud/talent/v4beta1/company.rb | 126 - .../cloud/talent/v4beta1/company_service.rb | 144 - .../talent/v4beta1/completion_service.rb | 154 - .../google/cloud/talent/v4beta1/event.rb | 188 - .../cloud/talent/v4beta1/event_service.rb | 43 - .../google/cloud/talent/v4beta1/filters.rb | 404 -- .../google/cloud/talent/v4beta1/histogram.rb | 74 - .../google/cloud/talent/v4beta1/job.rb | 389 -- .../cloud/talent/v4beta1/job_service.rb | 914 ---- .../google/cloud/talent/v4beta1/tenant.rb | 81 - .../cloud/talent/v4beta1/tenant_service.rb | 123 - .../google/longrunning/operations.rb | 191 - .../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/latlng.rb | 38 - .../proto_docs/google/type/money.rb | 43 - .../proto_docs/google/type/postal_address.rb | 135 - .../proto_docs/google/type/timeofday.rb | 45 - .../snippets/Gemfile | 32 - .../company_service/create_company.rb | 47 - .../company_service/delete_company.rb | 47 - .../snippets/company_service/get_company.rb | 47 - .../company_service/list_companies.rb | 51 - .../company_service/update_company.rb | 47 - .../snippets/completion/complete_query.rb | 47 - .../event_service/create_client_event.rb | 47 - .../snippets/job_service/batch_create_jobs.rb | 54 - .../snippets/job_service/batch_delete_jobs.rb | 47 - .../snippets/job_service/batch_update_jobs.rb | 54 - .../snippets/job_service/create_job.rb | 47 - .../snippets/job_service/delete_job.rb | 47 - .../snippets/job_service/get_job.rb | 47 - .../snippets/job_service/list_jobs.rb | 51 - .../snippets/job_service/search_jobs.rb | 47 - .../job_service/search_jobs_for_alert.rb | 47 - .../snippets/job_service/update_job.rb | 47 - ..._metadata_google.cloud.talent.v4beta1.json | 895 ---- .../snippets/tenant_service/create_tenant.rb | 47 - .../snippets/tenant_service/delete_tenant.rb | 47 - .../snippets/tenant_service/get_tenant.rb | 47 - .../snippets/tenant_service/list_tenants.rb | 51 - .../snippets/tenant_service/update_tenant.rb | 47 - .../v4beta1/company_service_paths_test.rb | 82 - .../v4beta1/company_service_rest_test.rb | 374 -- .../talent/v4beta1/company_service_test.rb | 409 -- .../talent/v4beta1/completion_paths_test.rb | 82 - .../talent/v4beta1/completion_rest_test.rb | 159 - .../cloud/talent/v4beta1/completion_test.rb | 174 - .../v4beta1/event_service_paths_test.rb | 67 - .../talent/v4beta1/event_service_rest_test.rb | 154 - .../talent/v4beta1/event_service_test.rb | 164 - .../v4beta1/job_service_operations_test.rb | 400 -- .../talent/v4beta1/job_service_paths_test.rb | 97 - .../talent/v4beta1/job_service_rest_test.rb | 681 --- .../cloud/talent/v4beta1/job_service_test.rb | 797 --- .../v4beta1/tenant_service_paths_test.rb | 67 - .../v4beta1/tenant_service_rest_test.rb | 373 -- .../talent/v4beta1/tenant_service_test.rb | 407 -- .../test/helper.rb | 25 - .../google-cloud-talent/.gitignore | 22 - .../google-cloud-talent/.repo-metadata.json | 18 - .../google-cloud-talent/.rubocop.yml | 39 - owl-bot-staging/google-cloud-talent/.toys.rb | 28 - owl-bot-staging/google-cloud-talent/.yardopts | 11 - .../google-cloud-talent/AUTHENTICATION.md | 122 - .../google-cloud-talent/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-talent/Gemfile | 28 - .../google-cloud-talent/LICENSE.md | 201 - owl-bot-staging/google-cloud-talent/README.md | 142 - owl-bot-staging/google-cloud-talent/Rakefile | 169 - .../google-cloud-talent.gemspec | 27 - .../lib/google-cloud-talent.rb | 19 - .../lib/google/cloud/talent.rb | 436 -- .../lib/google/cloud/talent/version.rb | 26 - .../test/google/cloud/talent/client_test.rb | 148 - .../test/google/cloud/talent/version_test.rb | 26 - .../google-cloud-talent/test/helper.rb | 25 - .../google-cloud-tasks-v2/.gitignore | 22 - .../google-cloud-tasks-v2/.repo-metadata.json | 18 - .../google-cloud-tasks-v2/.rubocop.yml | 33 - .../google-cloud-tasks-v2/.toys.rb | 28 - .../google-cloud-tasks-v2/.yardopts | 12 - .../google-cloud-tasks-v2/AUTHENTICATION.md | 122 - .../google-cloud-tasks-v2/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-tasks-v2/Gemfile | 11 - .../google-cloud-tasks-v2/LICENSE.md | 201 - .../google-cloud-tasks-v2/README.md | 154 - .../google-cloud-tasks-v2/Rakefile | 169 - .../google-cloud-tasks-v2/gapic_metadata.json | 98 - .../google-cloud-tasks-v2.gemspec | 30 - .../lib/google-cloud-tasks-v2.rb | 21 - .../lib/google/cloud/tasks/v2.rb | 45 - .../cloud/tasks/v2/bindings_override.rb | 75 - .../lib/google/cloud/tasks/v2/cloud_tasks.rb | 56 - .../cloud/tasks/v2/cloud_tasks/client.rb | 2259 -------- .../cloud/tasks/v2/cloud_tasks/credentials.rb | 51 - .../cloud/tasks/v2/cloud_tasks/paths.rb | 90 - .../google/cloud/tasks/v2/cloud_tasks/rest.rb | 54 - .../cloud/tasks/v2/cloud_tasks/rest/client.rb | 2112 -------- .../tasks/v2/cloud_tasks/rest/service_stub.rb | 1067 ---- .../google/cloud/tasks/v2/cloudtasks_pb.rb | 70 - .../cloud/tasks/v2/cloudtasks_services_pb.rb | 206 - .../lib/google/cloud/tasks/v2/queue_pb.rb | 54 - .../lib/google/cloud/tasks/v2/rest.rb | 38 - .../lib/google/cloud/tasks/v2/target_pb.rb | 49 - .../lib/google/cloud/tasks/v2/task_pb.rb | 54 - .../lib/google/cloud/tasks/v2/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/tasks/v2/cloudtasks.rb | 375 -- .../proto_docs/google/cloud/tasks/v2/queue.rb | 376 -- .../google/cloud/tasks/v2/target.rb | 466 -- .../proto_docs/google/cloud/tasks/v2/task.rb | 196 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../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/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../google-cloud-tasks-v2/snippets/Gemfile | 32 - .../snippets/cloud_tasks/create_queue.rb | 47 - .../snippets/cloud_tasks/create_task.rb | 47 - .../snippets/cloud_tasks/delete_queue.rb | 47 - .../snippets/cloud_tasks/delete_task.rb | 47 - .../snippets/cloud_tasks/get_iam_policy.rb | 47 - .../snippets/cloud_tasks/get_queue.rb | 47 - .../snippets/cloud_tasks/get_task.rb | 47 - .../snippets/cloud_tasks/list_queues.rb | 51 - .../snippets/cloud_tasks/list_tasks.rb | 51 - .../snippets/cloud_tasks/pause_queue.rb | 47 - .../snippets/cloud_tasks/purge_queue.rb | 47 - .../snippets/cloud_tasks/resume_queue.rb | 47 - .../snippets/cloud_tasks/run_task.rb | 47 - .../snippets/cloud_tasks/set_iam_policy.rb | 47 - .../cloud_tasks/test_iam_permissions.rb | 47 - .../snippets/cloud_tasks/update_queue.rb | 47 - ...nippet_metadata_google.cloud.tasks.v2.json | 655 --- .../cloud/tasks/v2/cloud_tasks_paths_test.rb | 79 - .../cloud/tasks/v2/cloud_tasks_rest_test.rb | 979 ---- .../google/cloud/tasks/v2/cloud_tasks_test.rb | 1074 ---- .../google-cloud-tasks-v2/test/helper.rb | 25 - .../google-cloud-tasks-v2beta2/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-tasks-v2beta2/.rubocop.yml | 33 - .../google-cloud-tasks-v2beta2/.toys.rb | 28 - .../google-cloud-tasks-v2beta2/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-tasks-v2beta2/CHANGELOG.md | 2 - .../google-cloud-tasks-v2beta2/Gemfile | 11 - .../google-cloud-tasks-v2beta2/LICENSE.md | 201 - .../google-cloud-tasks-v2beta2/README.md | 154 - .../google-cloud-tasks-v2beta2/Rakefile | 169 - .../gapic_metadata.json | 123 - .../google-cloud-tasks-v2beta2.gemspec | 30 - .../lib/google-cloud-tasks-v2beta2.rb | 21 - .../lib/google/cloud/tasks/v2beta2.rb | 45 - .../cloud/tasks/v2beta2/bindings_override.rb | 75 - .../google/cloud/tasks/v2beta2/cloud_tasks.rb | 56 - .../cloud/tasks/v2beta2/cloud_tasks/client.rb | 2936 ----------- .../tasks/v2beta2/cloud_tasks/credentials.rb | 51 - .../cloud/tasks/v2beta2/cloud_tasks/paths.rb | 90 - .../cloud/tasks/v2beta2/cloud_tasks/rest.rb | 54 - .../tasks/v2beta2/cloud_tasks/rest/client.rb | 2667 ---------- .../v2beta2/cloud_tasks/rest/service_stub.rb | 1315 ----- .../cloud/tasks/v2beta2/cloudtasks_pb.rb | 82 - .../tasks/v2beta2/cloudtasks_services_pb.rb | 274 - .../cloud/tasks/v2beta2/old_target_pb.rb | 41 - .../google/cloud/tasks/v2beta2/queue_pb.rb | 55 - .../lib/google/cloud/tasks/v2beta2/rest.rb | 38 - .../google/cloud/tasks/v2beta2/target_pb.rb | 60 - .../lib/google/cloud/tasks/v2beta2/task_pb.rb | 53 - .../lib/google/cloud/tasks/v2beta2/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/httpbody.rb | 80 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/tasks/v2beta2/cloudtasks.rb | 608 --- .../google/cloud/tasks/v2beta2/queue.rb | 448 -- .../google/cloud/tasks/v2beta2/target.rb | 775 --- .../google/cloud/tasks/v2beta2/task.rb | 208 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../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/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../snippets/cloud_tasks/acknowledge_task.rb | 47 - .../snippets/cloud_tasks/cancel_lease.rb | 47 - .../snippets/cloud_tasks/create_queue.rb | 47 - .../snippets/cloud_tasks/create_task.rb | 47 - .../snippets/cloud_tasks/delete_queue.rb | 47 - .../snippets/cloud_tasks/delete_task.rb | 47 - .../snippets/cloud_tasks/get_iam_policy.rb | 47 - .../snippets/cloud_tasks/get_queue.rb | 47 - .../snippets/cloud_tasks/get_task.rb | 47 - .../snippets/cloud_tasks/lease_tasks.rb | 47 - .../snippets/cloud_tasks/list_queues.rb | 51 - .../snippets/cloud_tasks/list_tasks.rb | 51 - .../snippets/cloud_tasks/pause_queue.rb | 47 - .../snippets/cloud_tasks/purge_queue.rb | 47 - .../snippets/cloud_tasks/renew_lease.rb | 47 - .../snippets/cloud_tasks/resume_queue.rb | 47 - .../snippets/cloud_tasks/run_task.rb | 47 - .../snippets/cloud_tasks/set_iam_policy.rb | 47 - .../cloud_tasks/test_iam_permissions.rb | 47 - .../snippets/cloud_tasks/update_queue.rb | 47 - .../snippets/cloud_tasks/upload_queue_yaml.rb | 47 - ...t_metadata_google.cloud.tasks.v2beta2.json | 855 --- .../tasks/v2beta2/cloud_tasks_paths_test.rb | 79 - .../tasks/v2beta2/cloud_tasks_rest_test.rb | 1207 ----- .../cloud/tasks/v2beta2/cloud_tasks_test.rb | 1391 ----- .../google-cloud-tasks-v2beta2/test/helper.rb | 25 - .../google-cloud-tasks-v2beta3/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-tasks-v2beta3/.rubocop.yml | 33 - .../google-cloud-tasks-v2beta3/.toys.rb | 28 - .../google-cloud-tasks-v2beta3/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-tasks-v2beta3/CHANGELOG.md | 2 - .../google-cloud-tasks-v2beta3/Gemfile | 11 - .../google-cloud-tasks-v2beta3/LICENSE.md | 201 - .../google-cloud-tasks-v2beta3/README.md | 154 - .../google-cloud-tasks-v2beta3/Rakefile | 169 - .../gapic_metadata.json | 98 - .../google-cloud-tasks-v2beta3.gemspec | 30 - .../lib/google-cloud-tasks-v2beta3.rb | 21 - .../lib/google/cloud/tasks/v2beta3.rb | 45 - .../cloud/tasks/v2beta3/bindings_override.rb | 75 - .../google/cloud/tasks/v2beta3/cloud_tasks.rb | 56 - .../cloud/tasks/v2beta3/cloud_tasks/client.rb | 2277 -------- .../tasks/v2beta3/cloud_tasks/credentials.rb | 51 - .../cloud/tasks/v2beta3/cloud_tasks/paths.rb | 90 - .../cloud/tasks/v2beta3/cloud_tasks/rest.rb | 54 - .../tasks/v2beta3/cloud_tasks/rest/client.rb | 2130 -------- .../v2beta3/cloud_tasks/rest/service_stub.rb | 1067 ---- .../cloud/tasks/v2beta3/cloudtasks_pb.rb | 70 - .../tasks/v2beta3/cloudtasks_services_pb.rb | 208 - .../google/cloud/tasks/v2beta3/queue_pb.rb | 57 - .../lib/google/cloud/tasks/v2beta3/rest.rb | 38 - .../google/cloud/tasks/v2beta3/target_pb.rb | 57 - .../lib/google/cloud/tasks/v2beta3/task_pb.rb | 54 - .../lib/google/cloud/tasks/v2beta3/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/tasks/v2beta3/cloudtasks.rb | 396 -- .../google/cloud/tasks/v2beta3/queue.rb | 462 -- .../google/cloud/tasks/v2beta3/target.rb | 728 --- .../google/cloud/tasks/v2beta3/task.rb | 213 - .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 -- .../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/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../snippets/cloud_tasks/create_queue.rb | 47 - .../snippets/cloud_tasks/create_task.rb | 47 - .../snippets/cloud_tasks/delete_queue.rb | 47 - .../snippets/cloud_tasks/delete_task.rb | 47 - .../snippets/cloud_tasks/get_iam_policy.rb | 47 - .../snippets/cloud_tasks/get_queue.rb | 47 - .../snippets/cloud_tasks/get_task.rb | 47 - .../snippets/cloud_tasks/list_queues.rb | 51 - .../snippets/cloud_tasks/list_tasks.rb | 51 - .../snippets/cloud_tasks/pause_queue.rb | 47 - .../snippets/cloud_tasks/purge_queue.rb | 47 - .../snippets/cloud_tasks/resume_queue.rb | 47 - .../snippets/cloud_tasks/run_task.rb | 47 - .../snippets/cloud_tasks/set_iam_policy.rb | 47 - .../cloud_tasks/test_iam_permissions.rb | 47 - .../snippets/cloud_tasks/update_queue.rb | 47 - ...t_metadata_google.cloud.tasks.v2beta3.json | 655 --- .../tasks/v2beta3/cloud_tasks_paths_test.rb | 79 - .../tasks/v2beta3/cloud_tasks_rest_test.rb | 981 ---- .../cloud/tasks/v2beta3/cloud_tasks_test.rb | 1078 ---- .../google-cloud-tasks-v2beta3/test/helper.rb | 25 - owl-bot-staging/google-cloud-tasks/.gitignore | 22 - .../google-cloud-tasks/.repo-metadata.json | 18 - .../google-cloud-tasks/.rubocop.yml | 39 - owl-bot-staging/google-cloud-tasks/.toys.rb | 28 - owl-bot-staging/google-cloud-tasks/.yardopts | 11 - .../google-cloud-tasks/AUTHENTICATION.md | 122 - .../google-cloud-tasks/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-tasks/Gemfile | 28 - owl-bot-staging/google-cloud-tasks/LICENSE.md | 201 - owl-bot-staging/google-cloud-tasks/README.md | 142 - owl-bot-staging/google-cloud-tasks/Rakefile | 169 - .../google-cloud-tasks.gemspec | 27 - .../lib/google-cloud-tasks.rb | 19 - .../lib/google/cloud/tasks.rb | 157 - .../lib/google/cloud/tasks/version.rb | 26 - .../test/google/cloud/tasks/client_test.rb | 64 - .../test/google/cloud/tasks/version_test.rb | 26 - .../google-cloud-tasks/test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-telco_automation-v1/.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-telco_automation-v1/Gemfile | 11 - .../LICENSE.md | 201 - .../README.md | 153 - .../google-cloud-telco_automation-v1/Rakefile | 169 - .../gapic_metadata.json | 198 - .../google-cloud-telco_automation-v1.gemspec | 29 - .../lib/google-cloud-telco_automation-v1.rb | 21 - .../lib/google/cloud/telco_automation/v1.rb | 45 - .../telco_automation/v1/bindings_override.rb | 75 - .../google/cloud/telco_automation/v1/rest.rb | 38 - .../telco_automation/v1/telco_automation.rb | 60 - .../v1/telco_automation/client.rb | 4039 --------------- .../v1/telco_automation/credentials.rb | 47 - .../v1/telco_automation/operations.rb | 841 --- .../v1/telco_automation/paths.rb | 172 - .../v1/telco_automation/rest.rb | 58 - .../v1/telco_automation/rest/client.rb | 3752 -------------- .../v1/telco_automation/rest/operations.rb | 925 ---- .../v1/telco_automation/rest/service_stub.rb | 2293 -------- .../cloud/telco_automation/v1/version.rb | 28 - .../telcoautomation/v1/telcoautomation_pb.rb | 131 - .../v1/telcoautomation_services_pb.rb | 126 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../telcoautomation/v1/telcoautomation.rb | 1551 ------ .../google/longrunning/operations.rb | 191 - .../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/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ...adata_google.cloud.telcoautomation.v1.json | 1455 ------ .../telco_automation/apply_deployment.rb | 47 - .../apply_hydrated_deployment.rb | 47 - .../telco_automation/approve_blueprint.rb | 47 - .../compute_deployment_status.rb | 47 - .../telco_automation/create_blueprint.rb | 47 - .../telco_automation/create_deployment.rb | 47 - .../telco_automation/create_edge_slm.rb | 54 - .../create_orchestration_cluster.rb | 54 - .../telco_automation/delete_blueprint.rb | 47 - .../telco_automation/delete_edge_slm.rb | 54 - .../delete_orchestration_cluster.rb | 54 - .../discard_blueprint_changes.rb | 47 - .../discard_deployment_changes.rb | 47 - .../telco_automation/get_blueprint.rb | 47 - .../telco_automation/get_deployment.rb | 47 - .../snippets/telco_automation/get_edge_slm.rb | 47 - .../get_hydrated_deployment.rb | 47 - .../get_orchestration_cluster.rb | 47 - .../telco_automation/get_public_blueprint.rb | 47 - .../list_blueprint_revisions.rb | 51 - .../telco_automation/list_blueprints.rb | 51 - .../list_deployment_revisions.rb | 51 - .../telco_automation/list_deployments.rb | 51 - .../telco_automation/list_edge_slms.rb | 51 - .../list_hydrated_deployments.rb | 51 - .../list_orchestration_clusters.rb | 51 - .../list_public_blueprints.rb | 51 - .../telco_automation/propose_blueprint.rb | 47 - .../telco_automation/reject_blueprint.rb | 47 - .../telco_automation/remove_deployment.rb | 47 - .../telco_automation/rollback_deployment.rb | 47 - .../search_blueprint_revisions.rb | 51 - .../search_deployment_revisions.rb | 51 - .../telco_automation/update_blueprint.rb | 47 - .../telco_automation/update_deployment.rb | 47 - .../update_hydrated_deployment.rb | 47 - .../v1/telco_automation_operations_test.rb | 400 -- .../v1/telco_automation_paths_test.rb | 127 - .../v1/telco_automation_rest_test.rb | 2089 -------- .../v1/telco_automation_test.rb | 2368 --------- .../test/helper.rb | 25 - .../google-cloud-telco_automation/.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 39 - .../google-cloud-telco_automation/.toys.rb | 28 - .../google-cloud-telco_automation/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-telco_automation/Gemfile | 28 - .../google-cloud-telco_automation/LICENSE.md | 201 - .../google-cloud-telco_automation/README.md | 141 - .../google-cloud-telco_automation/Rakefile | 169 - .../google-cloud-telco_automation.gemspec | 27 - .../lib/google-cloud-telco_automation.rb | 19 - .../lib/google/cloud/telco_automation.rb | 160 - .../google/cloud/telco_automation/version.rb | 26 - .../cloud/telco_automation/client_test.rb | 64 - .../cloud/telco_automation/version_test.rb | 26 - .../test/helper.rb | 25 - .../google-cloud-text_to_speech-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-text_to_speech-v1/.toys.rb | 28 - .../google-cloud-text_to_speech-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-text_to_speech-v1/Gemfile | 11 - .../google-cloud-text_to_speech-v1/LICENSE.md | 201 - .../google-cloud-text_to_speech-v1/README.md | 154 - .../google-cloud-text_to_speech-v1/Rakefile | 169 - .../gapic_metadata.json | 47 - .../google-cloud-text_to_speech-v1.gemspec | 28 - .../lib/google-cloud-text_to_speech-v1.rb | 21 - .../lib/google/cloud/text_to_speech/v1.rb | 46 - .../google/cloud/text_to_speech/v1/rest.rb | 38 - .../cloud/text_to_speech/v1/text_to_speech.rb | 55 - .../v1/text_to_speech/client.rb | 655 --- .../v1/text_to_speech/credentials.rb | 51 - .../text_to_speech/v1/text_to_speech/paths.rb | 52 - .../text_to_speech/v1/text_to_speech/rest.rb | 52 - .../v1/text_to_speech/rest/client.rb | 528 -- .../v1/text_to_speech/rest/service_stub.rb | 200 - .../text_to_speech_long_audio_synthesize.rb | 56 - .../client.rb | 510 -- .../credentials.rb | 51 - .../operations.rb | 841 --- .../paths.rb | 52 - .../rest.rb | 53 - .../rest/client.rb | 460 -- .../rest/operations.rb | 925 ---- .../rest/service_stub.rb | 143 - .../google/cloud/text_to_speech/v1/version.rb | 28 - .../cloud/texttospeech/v1/cloud_tts_lrs_pb.rb | 53 - .../v1/cloud_tts_lrs_services_pb.rb | 45 - .../cloud/texttospeech/v1/cloud_tts_pb.rb | 72 - .../texttospeech/v1/cloud_tts_services_pb.rb | 51 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/texttospeech/v1/cloud_tts.rb | 583 --- .../cloud/texttospeech/v1/cloud_tts_lrs.rb | 73 - .../google/longrunning/operations.rb | 191 - .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ...metadata_google.cloud.texttospeech.v1.json | 175 - .../snippets/text_to_speech/list_voices.rb | 47 - .../text_to_speech/streaming_synthesize.rb | 56 - .../text_to_speech/synthesize_speech.rb | 47 - .../synthesize_long_audio.rb | 54 - ...h_long_audio_synthesize_operations_test.rb | 400 -- ...speech_long_audio_synthesize_paths_test.rb | 55 - ..._speech_long_audio_synthesize_rest_test.rb | 157 - ...xt_to_speech_long_audio_synthesize_test.rb | 189 - .../v1/text_to_speech_paths_test.rb | 55 - .../v1/text_to_speech_rest_test.rb | 210 - .../text_to_speech/v1/text_to_speech_test.rb | 316 -- .../test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 11 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 47 - ...oogle-cloud-text_to_speech-v1beta1.gemspec | 28 - .../google-cloud-text_to_speech-v1beta1.rb | 21 - .../google/cloud/text_to_speech/v1beta1.rb | 46 - .../cloud/text_to_speech/v1beta1/rest.rb | 38 - .../text_to_speech/v1beta1/text_to_speech.rb | 55 - .../v1beta1/text_to_speech/client.rb | 657 --- .../v1beta1/text_to_speech/credentials.rb | 51 - .../v1beta1/text_to_speech/paths.rb | 52 - .../v1beta1/text_to_speech/rest.rb | 52 - .../v1beta1/text_to_speech/rest/client.rb | 530 -- .../text_to_speech/rest/service_stub.rb | 200 - .../text_to_speech_long_audio_synthesize.rb | 56 - .../client.rb | 510 -- .../credentials.rb | 51 - .../operations.rb | 841 --- .../paths.rb | 52 - .../rest.rb | 53 - .../rest/client.rb | 460 -- .../rest/operations.rb | 925 ---- .../rest/service_stub.rb | 143 - .../cloud/text_to_speech/v1beta1/version.rb | 28 - .../texttospeech/v1beta1/cloud_tts_lrs_pb.rb | 53 - .../v1beta1/cloud_tts_lrs_services_pb.rb | 45 - .../texttospeech/v1beta1/cloud_tts_pb.rb | 74 - .../v1beta1/cloud_tts_services_pb.rb | 51 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/texttospeech/v1beta1/cloud_tts.rb | 618 --- .../texttospeech/v1beta1/cloud_tts_lrs.rb | 73 - .../google/longrunning/operations.rb | 191 - .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ...ata_google.cloud.texttospeech.v1beta1.json | 175 - .../snippets/text_to_speech/list_voices.rb | 47 - .../text_to_speech/streaming_synthesize.rb | 56 - .../text_to_speech/synthesize_speech.rb | 47 - .../synthesize_long_audio.rb | 54 - ...h_long_audio_synthesize_operations_test.rb | 400 -- ...speech_long_audio_synthesize_paths_test.rb | 55 - ..._speech_long_audio_synthesize_rest_test.rb | 157 - ...xt_to_speech_long_audio_synthesize_test.rb | 189 - .../v1beta1/text_to_speech_paths_test.rb | 55 - .../v1beta1/text_to_speech_rest_test.rb | 211 - .../v1beta1/text_to_speech_test.rb | 318 -- .../test/helper.rb | 25 - .../google-cloud-text_to_speech/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-text_to_speech/.rubocop.yml | 39 - .../google-cloud-text_to_speech/.toys.rb | 28 - .../google-cloud-text_to_speech/.yardopts | 11 - .../AUTHENTICATION.md | 122 - .../google-cloud-text_to_speech/CHANGELOG.md | 2 - .../google-cloud-text_to_speech/Gemfile | 28 - .../google-cloud-text_to_speech/LICENSE.md | 201 - .../google-cloud-text_to_speech/README.md | 142 - .../google-cloud-text_to_speech/Rakefile | 169 - .../google-cloud-text_to_speech.gemspec | 27 - .../lib/google-cloud-text_to_speech.rb | 19 - .../lib/google/cloud/text_to_speech.rb | 226 - .../google/cloud/text_to_speech/version.rb | 26 - .../cloud/text_to_speech/client_test.rb | 85 - .../cloud/text_to_speech/version_test.rb | 26 - .../test/helper.rb | 25 - .../google-cloud-tpu-v1/.gitignore | 22 - .../google-cloud-tpu-v1/.repo-metadata.json | 18 - .../google-cloud-tpu-v1/.rubocop.yml | 33 - owl-bot-staging/google-cloud-tpu-v1/.toys.rb | 28 - owl-bot-staging/google-cloud-tpu-v1/.yardopts | 12 - .../google-cloud-tpu-v1/AUTHENTICATION.md | 122 - .../google-cloud-tpu-v1/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-tpu-v1/Gemfile | 11 - .../google-cloud-tpu-v1/LICENSE.md | 201 - owl-bot-staging/google-cloud-tpu-v1/README.md | 154 - owl-bot-staging/google-cloud-tpu-v1/Rakefile | 169 - .../google-cloud-tpu-v1/gapic_metadata.json | 73 - .../google-cloud-tpu-v1.gemspec | 29 - .../lib/google-cloud-tpu-v1.rb | 21 - .../lib/google/cloud/tpu/v1.rb | 40 - .../lib/google/cloud/tpu/v1/cloud_tpu_pb.rb | 74 - .../cloud/tpu/v1/cloud_tpu_services_pb.rb | 67 - .../lib/google/cloud/tpu/v1/tpu.rb | 52 - .../lib/google/cloud/tpu/v1/tpu/client.rb | 1517 ------ .../google/cloud/tpu/v1/tpu/credentials.rb | 51 - .../lib/google/cloud/tpu/v1/tpu/operations.rb | 841 --- .../lib/google/cloud/tpu/v1/tpu/paths.rb | 107 - .../lib/google/cloud/tpu/v1/version.rb | 28 - .../google-cloud-tpu-v1/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/tpu/v1/cloud_tpu.rb | 521 -- .../google/longrunning/operations.rb | 191 - .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../google-cloud-tpu-v1/snippets/Gemfile | 32 - .../snippet_metadata_google.cloud.tpu.v1.json | 455 -- .../snippets/tpu/create_node.rb | 54 - .../snippets/tpu/delete_node.rb | 54 - .../snippets/tpu/get_accelerator_type.rb | 47 - .../snippets/tpu/get_node.rb | 47 - .../snippets/tpu/get_tensor_flow_version.rb | 47 - .../snippets/tpu/list_accelerator_types.rb | 51 - .../snippets/tpu/list_nodes.rb | 51 - .../snippets/tpu/list_tensor_flow_versions.rb | 51 - .../snippets/tpu/reimage_node.rb | 54 - .../snippets/tpu/start_node.rb | 54 - .../snippets/tpu/stop_node.rb | 54 - .../cloud/tpu/v1/tpu_operations_test.rb | 400 -- .../google/cloud/tpu/v1/tpu_paths_test.rb | 91 - .../test/google/cloud/tpu/v1/tpu_test.rb | 822 --- .../google-cloud-tpu-v1/test/helper.rb | 25 - owl-bot-staging/google-cloud-tpu/.gitignore | 22 - .../google-cloud-tpu/.repo-metadata.json | 18 - owl-bot-staging/google-cloud-tpu/.rubocop.yml | 39 - owl-bot-staging/google-cloud-tpu/.toys.rb | 28 - owl-bot-staging/google-cloud-tpu/.yardopts | 11 - .../google-cloud-tpu/AUTHENTICATION.md | 122 - owl-bot-staging/google-cloud-tpu/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-tpu/Gemfile | 28 - owl-bot-staging/google-cloud-tpu/LICENSE.md | 201 - owl-bot-staging/google-cloud-tpu/README.md | 142 - owl-bot-staging/google-cloud-tpu/Rakefile | 169 - .../google-cloud-tpu/google-cloud-tpu.gemspec | 27 - .../google-cloud-tpu/lib/google-cloud-tpu.rb | 19 - .../google-cloud-tpu/lib/google/cloud/tpu.rb | 149 - .../lib/google/cloud/tpu/version.rb | 26 - .../test/google/cloud/tpu/client_test.rb | 53 - .../test/google/cloud/tpu/version_test.rb | 26 - .../google-cloud-tpu/test/helper.rb | 25 - .../google-cloud-trace-v1/.gitignore | 22 - .../google-cloud-trace-v1/.repo-metadata.json | 18 - .../google-cloud-trace-v1/.rubocop.yml | 33 - .../google-cloud-trace-v1/.toys.rb | 28 - .../google-cloud-trace-v1/.yardopts | 12 - .../google-cloud-trace-v1/AUTHENTICATION.md | 122 - .../google-cloud-trace-v1/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-trace-v1/Gemfile | 11 - .../google-cloud-trace-v1/LICENSE.md | 201 - .../google-cloud-trace-v1/README.md | 154 - .../google-cloud-trace-v1/Rakefile | 169 - .../google-cloud-trace-v1/gapic_metadata.json | 33 - .../google-cloud-trace-v1.gemspec | 28 - .../lib/google-cloud-trace-v1.rb | 21 - .../lib/google/cloud/trace/v1.rb | 45 - .../lib/google/cloud/trace/v1/rest.rb | 37 - .../google/cloud/trace/v1/trace_service.rb | 58 - .../cloud/trace/v1/trace_service/client.rb | 753 --- .../trace/v1/trace_service/credentials.rb | 53 - .../cloud/trace/v1/trace_service/rest.rb | 55 - .../trace/v1/trace_service/rest/client.rb | 686 --- .../v1/trace_service/rest/service_stub.rb | 266 - .../lib/google/cloud/trace/v1/version.rb | 28 - .../google/devtools/cloudtrace/v1/trace_pb.rb | 57 - .../cloudtrace/v1/trace_services_pb.rb | 57 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/devtools/cloudtrace/v1/trace.rb | 287 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../google-cloud-trace-v1/snippets/Gemfile | 32 - ...etadata_google.devtools.cloudtrace.v1.json | 135 - .../snippets/trace_service/get_trace.rb | 47 - .../snippets/trace_service/list_traces.rb | 51 - .../snippets/trace_service/patch_traces.rb | 47 - .../cloud/trace/v1/trace_service_rest_test.rb | 270 - .../cloud/trace/v1/trace_service_test.rb | 301 -- .../google-cloud-trace-v1/test/helper.rb | 25 - .../google-cloud-trace-v2/.gitignore | 22 - .../google-cloud-trace-v2/.repo-metadata.json | 18 - .../google-cloud-trace-v2/.rubocop.yml | 33 - .../google-cloud-trace-v2/.toys.rb | 28 - .../google-cloud-trace-v2/.yardopts | 12 - .../google-cloud-trace-v2/AUTHENTICATION.md | 122 - .../google-cloud-trace-v2/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-trace-v2/Gemfile | 11 - .../google-cloud-trace-v2/LICENSE.md | 201 - .../google-cloud-trace-v2/README.md | 154 - .../google-cloud-trace-v2/Rakefile | 169 - .../google-cloud-trace-v2/gapic_metadata.json | 28 - .../google-cloud-trace-v2.gemspec | 28 - .../lib/google-cloud-trace-v2.rb | 21 - .../lib/google/cloud/trace/v2.rb | 45 - .../lib/google/cloud/trace/v2/rest.rb | 37 - .../google/cloud/trace/v2/trace_service.rb | 61 - .../cloud/trace/v2/trace_service/client.rb | 643 --- .../trace/v2/trace_service/credentials.rb | 52 - .../cloud/trace/v2/trace_service/paths.rb | 66 - .../cloud/trace/v2/trace_service/rest.rb | 58 - .../trace/v2/trace_service/rest/client.rb | 586 --- .../v2/trace_service/rest/service_stub.rb | 205 - .../lib/google/cloud/trace/v2/version.rb | 28 - .../google/devtools/cloudtrace/v2/trace_pb.rb | 67 - .../devtools/cloudtrace/v2/tracing_pb.rb | 50 - .../cloudtrace/v2/tracing_services_pb.rb | 54 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/devtools/cloudtrace/v2/trace.rb | 427 -- .../google/devtools/cloudtrace/v2/tracing.rb | 40 - .../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/timestamp.rb | 127 - .../proto_docs/google/protobuf/wrappers.rb | 121 - .../proto_docs/google/rpc/status.rb | 48 - .../google-cloud-trace-v2/snippets/Gemfile | 32 - ...etadata_google.devtools.cloudtrace.v2.json | 95 - .../trace_service/batch_write_spans.rb | 47 - .../snippets/trace_service/create_span.rb | 47 - .../trace/v2/trace_service_paths_test.rb | 67 - .../cloud/trace/v2/trace_service_rest_test.rb | 221 - .../cloud/trace/v2/trace_service_test.rb | 248 - .../google-cloud-trace-v2/test/helper.rb | 25 - .../google-cloud-translate-v3/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-translate-v3/.rubocop.yml | 33 - .../google-cloud-translate-v3/.toys.rb | 28 - .../google-cloud-translate-v3/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-translate-v3/CHANGELOG.md | 2 - .../google-cloud-translate-v3/Gemfile | 11 - .../google-cloud-translate-v3/LICENSE.md | 201 - .../google-cloud-translate-v3/README.md | 154 - .../google-cloud-translate-v3/Rakefile | 169 - .../gapic_metadata.json | 208 - .../google-cloud-translate-v3.gemspec | 30 - .../lib/google-cloud-translate-v3.rb | 21 - .../lib/google/cloud/translate/v3.rb | 45 - .../cloud/translate/v3/adaptive_mt_pb.rb | 71 - .../translate/v3/automl_translation_pb.rb | 78 - .../cloud/translate/v3/bindings_override.rb | 75 - .../google/cloud/translate/v3/common_pb.rb | 52 - .../lib/google/cloud/translate/v3/rest.rb | 38 - .../cloud/translate/v3/translation_service.rb | 56 - .../v3/translation_service/client.rb | 4614 ----------------- .../v3/translation_service/credentials.rb | 52 - .../v3/translation_service/operations.rb | 849 --- .../translate/v3/translation_service/paths.rb | 168 - .../translate/v3/translation_service/rest.rb | 54 - .../v3/translation_service/rest/client.rb | 4313 --------------- .../v3/translation_service/rest/operations.rb | 1093 ---- .../translation_service/rest/service_stub.rb | 2454 --------- .../translate/v3/translation_service_pb.rb | 112 - .../v3/translation_service_services_pb.rb | 141 - .../lib/google/cloud/translate/v3/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/translate/v3/adaptive_mt.rb | 405 -- .../cloud/translate/v3/automl_translation.rb | 487 -- .../google/cloud/translate/v3/common.rb | 143 - .../cloud/translate/v3/translation_service.rb | 1657 ------ .../google/longrunning/operations.rb | 191 - .../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/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ..._metadata_google.cloud.translation.v3.json | 1535 ------ .../adaptive_mt_translate.rb | 47 - .../batch_translate_document.rb | 54 - .../batch_translate_text.rb | 54 - .../create_adaptive_mt_dataset.rb | 47 - .../translation_service/create_dataset.rb | 54 - .../translation_service/create_glossary.rb | 54 - .../create_glossary_entry.rb | 47 - .../translation_service/create_model.rb | 54 - .../delete_adaptive_mt_dataset.rb | 47 - .../delete_adaptive_mt_file.rb | 47 - .../translation_service/delete_dataset.rb | 54 - .../translation_service/delete_glossary.rb | 54 - .../delete_glossary_entry.rb | 47 - .../translation_service/delete_model.rb | 54 - .../translation_service/detect_language.rb | 47 - .../translation_service/export_data.rb | 54 - .../get_adaptive_mt_dataset.rb | 47 - .../get_adaptive_mt_file.rb | 47 - .../translation_service/get_dataset.rb | 47 - .../translation_service/get_glossary.rb | 47 - .../translation_service/get_glossary_entry.rb | 47 - .../snippets/translation_service/get_model.rb | 47 - .../get_supported_languages.rb | 47 - .../import_adaptive_mt_file.rb | 47 - .../translation_service/import_data.rb | 54 - .../list_adaptive_mt_datasets.rb | 51 - .../list_adaptive_mt_files.rb | 51 - .../list_adaptive_mt_sentences.rb | 51 - .../translation_service/list_datasets.rb | 51 - .../translation_service/list_examples.rb | 51 - .../translation_service/list_glossaries.rb | 51 - .../list_glossary_entries.rb | 51 - .../translation_service/list_models.rb | 51 - .../translation_service/romanize_text.rb | 47 - .../translation_service/translate_document.rb | 47 - .../translation_service/translate_text.rb | 47 - .../translation_service/update_glossary.rb | 54 - .../update_glossary_entry.rb | 47 - .../v3/translation_service_operations_test.rb | 400 -- .../v3/translation_service_paths_test.rb | 127 - .../v3/translation_service_rest_test.rb | 2228 -------- .../translate/v3/translation_service_test.rb | 2575 --------- .../google-cloud-translate-v3/test/helper.rb | 25 - .../google-cloud-translate/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-translate/.rubocop.yml | 39 - .../google-cloud-translate/.toys.rb | 28 - .../google-cloud-translate/.yardopts | 12 - .../google-cloud-translate/AUTHENTICATION.md | 122 - .../google-cloud-translate/CHANGELOG.md | 2 - .../google-cloud-translate/Gemfile | 28 - .../google-cloud-translate/LICENSE.md | 201 - .../google-cloud-translate/README.md | 152 - .../google-cloud-translate/Rakefile | 169 - .../google-cloud-translate.gemspec | 28 - .../lib/google-cloud-translate.rb | 19 - .../lib/google/cloud/translate.rb | 156 - .../lib/google/cloud/translate/version.rb | 26 - .../google/cloud/translate/client_test.rb | 64 - .../google/cloud/translate/version_test.rb | 26 - .../google-cloud-translate/test/helper.rb | 25 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-video-live_stream-v1/Gemfile | 11 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 188 - .../google-cloud-video-live_stream-v1.gemspec | 29 - .../lib/google-cloud-video-live_stream-v1.rb | 21 - .../lib/google/cloud/video/live_stream/v1.rb | 47 - .../video/live_stream/v1/bindings_override.rb | 77 - .../live_stream/v1/livestream_service.rb | 62 - .../v1/livestream_service/client.rb | 4350 ---------------- .../v1/livestream_service/credentials.rb | 49 - .../v1/livestream_service/operations.rb | 843 --- .../v1/livestream_service/paths.rb | 227 - .../live_stream/v1/livestream_service/rest.rb | 60 - .../v1/livestream_service/rest/client.rb | 4077 --------------- .../v1/livestream_service/rest/operations.rb | 927 ---- .../livestream_service/rest/service_stub.rb | 2172 -------- .../google/cloud/video/live_stream/v1/rest.rb | 40 - .../cloud/video/live_stream/v1/version.rb | 30 - .../cloud/video/livestream/v1/outputs_pb.rb | 76 - .../cloud/video/livestream/v1/resources_pb.rb | 116 - .../cloud/video/livestream/v1/service_pb.rb | 100 - .../livestream/v1/service_services_pb.rb | 123 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/video/livestream/v1/outputs.rb | 788 --- .../cloud/video/livestream/v1/resources.rb | 1294 ----- .../cloud/video/livestream/v1/service.rb | 1032 ---- .../google/longrunning/operations.rb | 191 - .../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/rpc/status.rb | 48 - .../proto_docs/google/type/datetime.rb | 103 - .../snippets/Gemfile | 32 - .../livestream_service/create_asset.rb | 54 - .../livestream_service/create_channel.rb | 54 - .../livestream_service/create_clip.rb | 54 - .../livestream_service/create_dvr_session.rb | 54 - .../livestream_service/create_event.rb | 47 - .../livestream_service/create_input.rb | 54 - .../livestream_service/delete_asset.rb | 54 - .../livestream_service/delete_channel.rb | 54 - .../livestream_service/delete_clip.rb | 54 - .../livestream_service/delete_dvr_session.rb | 54 - .../livestream_service/delete_event.rb | 47 - .../livestream_service/delete_input.rb | 54 - .../snippets/livestream_service/get_asset.rb | 47 - .../livestream_service/get_channel.rb | 47 - .../snippets/livestream_service/get_clip.rb | 47 - .../livestream_service/get_dvr_session.rb | 47 - .../snippets/livestream_service/get_event.rb | 47 - .../snippets/livestream_service/get_input.rb | 47 - .../snippets/livestream_service/get_pool.rb | 47 - .../livestream_service/list_assets.rb | 51 - .../livestream_service/list_channels.rb | 51 - .../snippets/livestream_service/list_clips.rb | 51 - .../livestream_service/list_dvr_sessions.rb | 51 - .../livestream_service/list_events.rb | 51 - .../livestream_service/list_inputs.rb | 51 - .../livestream_service/preview_input.rb | 47 - .../livestream_service/start_channel.rb | 54 - .../livestream_service/start_distribution.rb | 54 - .../livestream_service/stop_channel.rb | 54 - .../livestream_service/stop_distribution.rb | 54 - .../livestream_service/update_channel.rb | 54 - .../livestream_service/update_dvr_session.rb | 54 - .../livestream_service/update_input.rb | 54 - .../livestream_service/update_pool.rb | 54 - ...data_google.cloud.video.livestream.v1.json | 1375 ----- .../v1/livestream_service_operations_test.rb | 400 -- .../v1/livestream_service_paths_test.rb | 163 - .../v1/livestream_service_rest_test.rb | 1998 ------- .../live_stream/v1/livestream_service_test.rb | 2336 --------- .../test/helper.rb | 25 - 1167 files changed, 2 insertions(+), 232260 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-support/.gitignore delete mode 100644 owl-bot-staging/google-cloud-support/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-support/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-support/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-support/.yardopts delete mode 100644 owl-bot-staging/google-cloud-support/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-support/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-support/Gemfile delete mode 100644 owl-bot-staging/google-cloud-support/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-support/README.md delete mode 100644 owl-bot-staging/google-cloud-support/Rakefile delete mode 100644 owl-bot-staging/google-cloud-support/google-cloud-support.gemspec delete mode 100644 owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb delete mode 100644 owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb delete mode 100644 owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb delete mode 100644 owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-support/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.gitignore delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/.yardopts delete mode 100644 owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/Gemfile delete mode 100644 owl-bot-staging/google-cloud-talent-v4/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/README.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/Rakefile delete mode 100644 owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-talent/.gitignore delete mode 100644 owl-bot-staging/google-cloud-talent/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-talent/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-talent/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-talent/.yardopts delete mode 100644 owl-bot-staging/google-cloud-talent/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-talent/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-talent/Gemfile delete mode 100644 owl-bot-staging/google-cloud-talent/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-talent/README.md delete mode 100644 owl-bot-staging/google-cloud-talent/Rakefile delete mode 100644 owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec delete mode 100644 owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb delete mode 100644 owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb delete mode 100644 owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb delete mode 100644 owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-talent/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/README.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/httpbody.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.gitignore delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/.yardopts delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/README.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-tasks/.gitignore delete mode 100644 owl-bot-staging/google-cloud-tasks/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-tasks/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-tasks/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-tasks/.yardopts delete mode 100644 owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-tasks/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-tasks/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tasks/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-tasks/README.md delete mode 100644 owl-bot-staging/google-cloud-tasks/Rakefile delete mode 100644 owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec delete mode 100644 owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb delete mode 100644 owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb delete mode 100644 owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-tasks/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation/.gitignore delete mode 100644 owl-bot-staging/google-cloud-telco_automation/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-telco_automation/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-telco_automation/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation/.yardopts delete mode 100644 owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation/Gemfile delete mode 100644 owl-bot-staging/google-cloud-telco_automation/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation/README.md delete mode 100644 owl-bot-staging/google-cloud-telco_automation/Rakefile delete mode 100644 owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec delete mode 100644 owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-telco_automation/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/.gitignore delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/.yardopts delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/Gemfile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/README.md delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/Rakefile delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-text_to_speech/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/create_node.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb delete mode 100644 owl-bot-staging/google-cloud-tpu-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-tpu/.gitignore delete mode 100644 owl-bot-staging/google-cloud-tpu/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-tpu/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-tpu/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-tpu/.yardopts delete mode 100644 owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-tpu/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-tpu/Gemfile delete mode 100644 owl-bot-staging/google-cloud-tpu/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-tpu/README.md delete mode 100644 owl-bot-staging/google-cloud-tpu/Rakefile delete mode 100644 owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec delete mode 100644 owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb delete mode 100644 owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb delete mode 100644 owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb delete mode 100644 owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-tpu/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-trace-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-trace-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-trace-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-trace-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-trace-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-trace-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-trace-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-trace-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-trace-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-trace-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json delete mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/get_trace.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-trace-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-trace-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-trace-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-trace-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-trace-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-trace-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-trace-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-trace-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-trace-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-trace-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json delete mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-trace-v2/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/.gitignore delete mode 100644 owl-bot-staging/google-cloud-translate-v3/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-translate-v3/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-translate-v3/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/.yardopts delete mode 100644 owl-bot-staging/google-cloud-translate-v3/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-translate-v3/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-translate-v3/Gemfile delete mode 100644 owl-bot-staging/google-cloud-translate-v3/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-translate-v3/README.md delete mode 100644 owl-bot-staging/google-cloud-translate-v3/Rakefile delete mode 100644 owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-translate-v3/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-translate/.gitignore delete mode 100644 owl-bot-staging/google-cloud-translate/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-translate/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-translate/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-translate/.yardopts delete mode 100644 owl-bot-staging/google-cloud-translate/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-translate/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-translate/Gemfile delete mode 100644 owl-bot-staging/google-cloud-translate/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-translate/README.md delete mode 100644 owl-bot-staging/google-cloud-translate/Rakefile delete mode 100644 owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec delete mode 100644 owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb delete mode 100644 owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb delete mode 100644 owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb delete mode 100644 owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb delete mode 100644 owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb delete mode 100644 owl-bot-staging/google-cloud-translate/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb diff --git a/google-cloud-translate/AUTHENTICATION.md b/google-cloud-translate/AUTHENTICATION.md index 61c99d5f0270..caba11945d31 100644 --- a/google-cloud-translate/AUTHENTICATION.md +++ b/google-cloud-translate/AUTHENTICATION.md @@ -33,12 +33,6 @@ credentials, there are several methods available to you. Credentials are accepted in the following ways, in the following order or precedence: -> [!WARNING] -> If you accept a credential configuration (JSON file or Hash) from an -> external source for authentication to Google Cloud, you must validate it before -> providing it to a Google API client library. Providing an unvalidated credential -> configuration to Google APIs can compromise the security of your systems and data. - 1. Credentials specified in method arguments 2. Credentials specified in configuration 3. Credentials pointed to or included in environment variables @@ -60,30 +54,20 @@ whenever possible. To configure a credentials file for an individual client initialization: ```ruby -require "googleauth" require "google/cloud/translate" -credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - json_key_io: ::File.open("/path/to/keyfile.json") -) - client = Google::Cloud::Translate.translation_service do |config| - config.credentials = credentials + config.credentials = "path/to/credentialfile.json" end ``` To configure a credentials file globally for all clients: ```ruby -require "googleauth" require "google/cloud/translate" -credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - json_key_io: ::File.open("/path/to/keyfile.json") -) - Google::Cloud::Translate.configure do |config| - config.credentials = credentials + config.credentials = "path/to/credentialfile.json" end client = Google::Cloud::Translate.translation_service diff --git a/owl-bot-staging/google-cloud-support/.gitignore b/owl-bot-staging/google-cloud-support/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-support/.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-support/.repo-metadata.json b/owl-bot-staging/google-cloud-support/.repo-metadata.json deleted file mode 100644 index 28ed335c14c2..000000000000 --- a/owl-bot-staging/google-cloud-support/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "cloudsupport.googleapis.com", - "api_shortname": "cloudsupport", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-support/latest", - "distribution_name": "google-cloud-support", - "is_cloud": true, - "language": "ruby", - "name": "cloudsupport", - "name_pretty": "Google Cloud Support API", - "product_documentation": "https://cloud.google.com/support/docs/reference/support-api", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Manages Google Cloud technical support cases for Customer Care support offerings.", - "ruby-cloud-product-url": "https://cloud.google.com/support/docs/reference/support-api", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-support/.rubocop.yml b/owl-bot-staging/google-cloud-support/.rubocop.yml deleted file mode 100644 index 0c62c9f8e48e..000000000000 --- a/owl-bot-staging/google-cloud-support/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-support.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-support.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-support/.toys.rb b/owl-bot-staging/google-cloud-support/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-support/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-support/.yardopts b/owl-bot-staging/google-cloud-support/.yardopts deleted file mode 100644 index 9b5133e11480..000000000000 --- a/owl-bot-staging/google-cloud-support/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Google Cloud Support API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-support/AUTHENTICATION.md b/owl-bot-staging/google-cloud-support/AUTHENTICATION.md deleted file mode 100644 index a26939650afc..000000000000 --- a/owl-bot-staging/google-cloud-support/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-support 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-support 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/support" - -client = Google::Cloud::Support.case_attachment_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/support" - -Google::Cloud::Support.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Support.case_attachment_service -``` - -### 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-support -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/support" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Support.case_attachment_service -``` - -### 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-support/CHANGELOG.md b/owl-bot-staging/google-cloud-support/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-support/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-support/Gemfile b/owl-bot-staging/google-cloud-support/Gemfile deleted file mode 100644 index f30454cd3550..000000000000 --- a/owl-bot-staging/google-cloud-support/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-support-v2"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-support.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.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-support/LICENSE.md b/owl-bot-staging/google-cloud-support/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-support/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-support/README.md b/owl-bot-staging/google-cloud-support/README.md deleted file mode 100644 index 7db6a09bc115..000000000000 --- a/owl-bot-staging/google-cloud-support/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Google Cloud Support API - -Manages Google Cloud technical support cases for Customer Care support offerings. - -Manages Google Cloud technical support cases for Customer Care support offerings. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-support-v*`. -The gem `google-cloud-support` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-support/latest) -for this library, google-cloud-support, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-support-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest). - -See also the [Product Documentation](https://cloud.google.com/support/docs/reference/support-api) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-support -``` - -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/cloudsupport.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/support" - -client = Google::Cloud::Support.case_attachment_service -request = ::Google::Cloud::Support::V2::ListAttachmentsRequest.new # (request fields as keyword arguments...) -response = client.list_attachments request -``` - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-support-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -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-support`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-support-v2`. -_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-support`. -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-support-v2`. - -### 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-support/Rakefile b/owl-bot-staging/google-cloud-support/Rakefile deleted file mode 100644 index da0a2d865834..000000000000 --- a/owl-bot-staging/google-cloud-support/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true -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-support acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/support/v2/case_attachment_service/credentials" - ::Google::Cloud::Support::V2::CaseAttachmentService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-support 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-support 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-support 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-support gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-support" - header "google-cloud-support rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-support yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-support 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-support 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-support 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-support/google-cloud-support.gemspec b/owl-bot-staging/google-cloud-support/google-cloud-support.gemspec deleted file mode 100644 index 4feb21fe15bf..000000000000 --- a/owl-bot-staging/google-cloud-support/google-cloud-support.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/support/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-support" - gem.version = Google::Cloud::Support::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Manages Google Cloud technical support cases for Customer Care support offerings." - gem.summary = "Manages Google Cloud technical support cases for Customer Care support offerings." - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-support-v2", ">= 0.3", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb b/owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb deleted file mode 100644 index ff0e8c67c079..000000000000 --- a/owl-bot-staging/google-cloud-support/lib/google-cloud-support.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/support" unless defined? Google::Cloud::Support::VERSION diff --git a/owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb b/owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb deleted file mode 100644 index 9531f5ac0f41..000000000000 --- a/owl-bot-staging/google-cloud-support/lib/google/cloud/support.rb +++ /dev/null @@ -1,269 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/support/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :support do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Support - ## - # Create a new client object for CaseAttachmentService. - # - # By default, this returns an instance of - # [Google::Cloud::Support::V2::CaseAttachmentService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest/Google-Cloud-Support-V2-CaseAttachmentService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CaseAttachmentService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the CaseAttachmentService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Support.case_attachment_service_available?}. - # - # ## About CaseAttachmentService - # - # A service to manage file attachments for Google Cloud support cases. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @return [::Object] A client object for the specified version. - # - def self.case_attachment_service version: :v2, &block - require "google/cloud/support/#{version.to_s.downcase}" - - package_name = Google::Cloud::Support - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Support.const_get(package_name).const_get(:CaseAttachmentService) - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CaseAttachmentService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Support.case_attachment_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CaseAttachmentService service, - # or if the versioned client gem needs an update to support the CaseAttachmentService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @return [boolean] Whether the service is available. - # - def self.case_attachment_service_available? version: :v2 - require "google/cloud/support/#{version.to_s.downcase}" - package_name = Google::Cloud::Support - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Support.const_get package_name - return false unless service_module.const_defined? :CaseAttachmentService - service_module = service_module.const_get :CaseAttachmentService - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for CaseService. - # - # By default, this returns an instance of - # [Google::Cloud::Support::V2::CaseService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest/Google-Cloud-Support-V2-CaseService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CaseService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the CaseService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Support.case_service_available?}. - # - # ## About CaseService - # - # A service to manage Google Cloud support cases. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @return [::Object] A client object for the specified version. - # - def self.case_service version: :v2, &block - require "google/cloud/support/#{version.to_s.downcase}" - - package_name = Google::Cloud::Support - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Support.const_get(package_name).const_get(:CaseService) - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CaseService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Support.case_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CaseService service, - # or if the versioned client gem needs an update to support the CaseService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @return [boolean] Whether the service is available. - # - def self.case_service_available? version: :v2 - require "google/cloud/support/#{version.to_s.downcase}" - package_name = Google::Cloud::Support - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Support.const_get package_name - return false unless service_module.const_defined? :CaseService - service_module = service_module.const_get :CaseService - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for CommentService. - # - # By default, this returns an instance of - # [Google::Cloud::Support::V2::CommentService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-support-v2/latest/Google-Cloud-Support-V2-CommentService-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CommentService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the CommentService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Support.comment_service_available?}. - # - # ## About CommentService - # - # A service to manage comments on cases. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @return [::Object] A client object for the specified version. - # - def self.comment_service version: :v2, &block - require "google/cloud/support/#{version.to_s.downcase}" - - package_name = Google::Cloud::Support - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Support.const_get(package_name).const_get(:CommentService) - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CommentService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Support.comment_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CommentService service, - # or if the versioned client gem needs an update to support the CommentService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @return [boolean] Whether the service is available. - # - def self.comment_service_available? version: :v2 - require "google/cloud/support/#{version.to_s.downcase}" - package_name = Google::Cloud::Support - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Support.const_get package_name - return false unless service_module.const_defined? :CommentService - service_module = service_module.const_get :CommentService - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-support library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.support if block_given? - - ::Google::Cloud.configure.support - end - end - end -end - -helper_path = ::File.join __dir__, "support", "helpers.rb" -require "google/cloud/support/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb b/owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb deleted file mode 100644 index 10109b175e7a..000000000000 --- a/owl-bot-staging/google-cloud-support/lib/google/cloud/support/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Support - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb b/owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb deleted file mode 100644 index 6e8f5d25f10b..000000000000 --- a/owl-bot-staging/google-cloud-support/test/google/cloud/support/client_test.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/support" -require "gapic/common" -require "gapic/grpc" - -class Google::Cloud::Support::ClientConstructionMinitest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_case_attachment_service_grpc - skip unless Google::Cloud::Support.case_attachment_service_available? - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Support.case_attachment_service do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Support::V2::CaseAttachmentService::Client, client - end - end - - def test_case_service_grpc - skip unless Google::Cloud::Support.case_service_available? - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Support.case_service do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Support::V2::CaseService::Client, client - end - end - - def test_comment_service_grpc - skip unless Google::Cloud::Support.comment_service_available? - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Support.comment_service do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Support::V2::CommentService::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb b/owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb deleted file mode 100644 index 0ec07616c6b0..000000000000 --- a/owl-bot-staging/google-cloud-support/test/google/cloud/support/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/support/version" - -class Google::Cloud::Support::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Support::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-support/test/helper.rb b/owl-bot-staging/google-cloud-support/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-support/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-talent-v4/.gitignore b/owl-bot-staging/google-cloud-talent-v4/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.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-talent-v4/.repo-metadata.json b/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json deleted file mode 100644 index 2798805ded2c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "jobs.googleapis.com", - "api_shortname": "jobs", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest", - "distribution_name": "google-cloud-talent-v4", - "is_cloud": true, - "language": "ruby", - "name": "jobs", - "name_pretty": "Cloud Talent Solution V4 API", - "product_documentation": "https://cloud.google.com/solutions/talent-solution", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TALENT", - "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml b/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml deleted file mode 100644 index bd272e76c0ea..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-talent-v4.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-talent-v4.rb" diff --git a/owl-bot-staging/google-cloud-talent-v4/.toys.rb b/owl-bot-staging/google-cloud-talent-v4/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/.yardopts b/owl-bot-staging/google-cloud-talent-v4/.yardopts deleted file mode 100644 index 5c7f550fa4ae..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Talent Solution V4 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-talent-v4/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md deleted file mode 100644 index 3ee7d3b9820d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-talent-v4 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-talent-v4 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/talent/v4" - -client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/talent/v4" - -::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4 -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/talent/v4" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Talent::V4::CompanyService::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-talent-v4/CHANGELOG.md b/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-talent-v4/Gemfile b/owl-bot-staging/google-cloud-talent-v4/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-talent-v4/LICENSE.md b/owl-bot-staging/google-cloud-talent-v4/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/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-talent-v4/README.md b/owl-bot-staging/google-cloud-talent-v4/README.md deleted file mode 100644 index dcd4f76bc132..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Talent Solution V4 API - -Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. - -Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. - -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 Talent Solution V4 API. Most users should consider using -the main client gem, -[google-cloud-talent](https://rubygems.org/gems/google-cloud-talent). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-talent-v4 -``` - -## 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/jobs.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/talent/v4" - -client = ::Google::Cloud::Talent::V4::CompanyService::Client.new -request = ::Google::Cloud::Talent::V4::CreateCompanyRequest.new # (request fields as keyword arguments...) -response = client.create_company request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/talent/v4" -require "logger" - -client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-talent`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-talent-v4`. -_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-talent`. -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-talent-v4`. - -### 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-talent-v4/Rakefile b/owl-bot-staging/google-cloud-talent-v4/Rakefile deleted file mode 100644 index e241f71a45d3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TALENT_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TALENT_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/talent/v4/company_service/credentials" - ::Google::Cloud::Talent::V4::CompanyService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TALENT_PROJECT"] = project - ENV["TALENT_TEST_PROJECT"] = project - ENV["TALENT_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-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-talent-v4" - header "google-cloud-talent-v4 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-talent-v4 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-talent-v4 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-talent-v4 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-talent-v4 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-talent-v4/gapic_metadata.json b/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json deleted file mode 100644 index 12740756819f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/gapic_metadata.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.talent.v4", - "libraryPackage": "::Google::Cloud::Talent::V4", - "services": { - "CompanyService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::CompanyService::Client", - "rpcs": { - "CreateCompany": { - "methods": [ - "create_company" - ] - }, - "GetCompany": { - "methods": [ - "get_company" - ] - }, - "UpdateCompany": { - "methods": [ - "update_company" - ] - }, - "DeleteCompany": { - "methods": [ - "delete_company" - ] - }, - "ListCompanies": { - "methods": [ - "list_companies" - ] - } - } - } - } - }, - "Completion": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::Completion::Client", - "rpcs": { - "CompleteQuery": { - "methods": [ - "complete_query" - ] - } - } - } - } - }, - "EventService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::EventService::Client", - "rpcs": { - "CreateClientEvent": { - "methods": [ - "create_client_event" - ] - } - } - } - } - }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::JobService::Client", - "rpcs": { - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "BatchCreateJobs": { - "methods": [ - "batch_create_jobs" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "UpdateJob": { - "methods": [ - "update_job" - ] - }, - "BatchUpdateJobs": { - "methods": [ - "batch_update_jobs" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "BatchDeleteJobs": { - "methods": [ - "batch_delete_jobs" - ] - }, - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "SearchJobs": { - "methods": [ - "search_jobs" - ] - }, - "SearchJobsForAlert": { - "methods": [ - "search_jobs_for_alert" - ] - } - } - } - } - }, - "TenantService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4::TenantService::Client", - "rpcs": { - "CreateTenant": { - "methods": [ - "create_tenant" - ] - }, - "GetTenant": { - "methods": [ - "get_tenant" - ] - }, - "UpdateTenant": { - "methods": [ - "update_tenant" - ] - }, - "DeleteTenant": { - "methods": [ - "delete_tenant" - ] - }, - "ListTenants": { - "methods": [ - "list_tenants" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec b/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec deleted file mode 100644 index 64071099173c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/google-cloud-talent-v4.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/talent/v4/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-talent-v4" - gem.version = Google::Cloud::Talent::V4::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details." - gem.summary = "Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb deleted file mode 100644 index c715c2e0b79a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google-cloud-talent-v4.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4" diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb deleted file mode 100644 index 35c2c38a0397..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service" -require "google/cloud/talent/v4/completion" -require "google/cloud/talent/v4/event_service" -require "google/cloud/talent/v4/job_service" -require "google/cloud/talent/v4/tenant_service" -require "google/cloud/talent/v4/version" - -module Google - module Cloud - module Talent - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/talent/v4" - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/talent/v4" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module V4 - end - end - end -end - -helper_path = ::File.join __dir__, "v4", "_helpers.rb" -require "google/cloud/talent/v4/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb deleted file mode 100644 index 70e3b6d1694b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/common_pb.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/type/latlng_pb' -require 'google/type/money_pb' -require 'google/type/postal_address_pb' - - -descriptor_data = "\n#google/cloud/talent/v4/common.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x18google/type/latlng.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"n\n\x0eTimestampRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb2\x03\n\x08Location\x12\x44\n\rlocation_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.Location.LocationType\x12\x32\n\x0epostal_address\x18\x02 \x01(\x0b\x32\x1a.google.type.PostalAddress\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x14\n\x0cradius_miles\x18\x04 \x01(\x01\"\xef\x01\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OUNTRY\x10\x01\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x02\x12\x1b\n\x17SUB_ADMINISTRATIVE_AREA\x10\x03\x12\x0c\n\x08LOCALITY\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x10\n\x0cSUB_LOCALITY\x10\x06\x12\x12\n\x0eSUB_LOCALITY_1\x10\x07\x12\x12\n\x0eSUB_LOCALITY_2\x10\x08\x12\x10\n\x0cNEIGHBORHOOD\x10\t\x12\x12\n\x0eSTREET_ADDRESS\x10\n\"\x9a\x01\n\x0fRequestMetadata\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x19\n\x11\x61llow_missing_ids\x18\x04 \x01(\x08\x12\x37\n\x0b\x64\x65vice_info\x18\x05 \x01(\x0b\x32\".google.cloud.talent.v4.DeviceInfo\"&\n\x10ResponseMetadata\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\xca\x01\n\nDeviceInfo\x12\x42\n\x0b\x64\x65vice_type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.DeviceInfo.DeviceType\x12\n\n\x02id\x18\x02 \x01(\t\"l\n\nDeviceType\x12\x1b\n\x17\x44\x45VICE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0e\n\nMOBILE_WEB\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x07\n\x03IOS\x10\x04\x12\x07\n\x03\x42OT\x10\x05\x12\t\n\x05OTHER\x10\x06\"m\n\x0f\x43ustomAttribute\x12\x15\n\rstring_values\x18\x01 \x03(\t\x12\x13\n\x0blong_values\x18\x02 \x03(\x03\x12\x12\n\nfilterable\x18\x03 \x01(\x08\x12\x1a\n\x12keyword_searchable\x18\x04 \x01(\x08\"W\n\x12SpellingCorrection\x12\x11\n\tcorrected\x18\x01 \x01(\x08\x12\x16\n\x0e\x63orrected_text\x18\x02 \x01(\t\x12\x16\n\x0e\x63orrected_html\x18\x03 \x01(\t\"\x88\t\n\x10\x43ompensationInfo\x12K\n\x07\x65ntries\x18\x01 \x03(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationEntry\x12k\n\"annualized_base_compensation_range\x18\x02 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x12l\n#annualized_total_compensation_range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x1a\x83\x03\n\x11\x43ompensationEntry\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationType\x12G\n\x04unit\x18\x02 \x01(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnit\x12$\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12K\n\x05range\x18\x04 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRangeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12=\n\x17\x65xpected_units_per_year\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValueB\x15\n\x13\x63ompensation_amount\x1ao\n\x11\x43ompensationRange\x12,\n\x10max_compensation\x18\x02 \x01(\x0b\x32\x12.google.type.Money\x12,\n\x10min_compensation\x18\x01 \x01(\x0b\x32\x12.google.type.Money\"\xb5\x01\n\x10\x43ompensationType\x12!\n\x1d\x43OMPENSATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42\x41SE\x10\x01\x12\t\n\x05\x42ONUS\x10\x02\x12\x11\n\rSIGNING_BONUS\x10\x03\x12\n\n\x06\x45QUITY\x10\x04\x12\x12\n\x0ePROFIT_SHARING\x10\x05\x12\x0f\n\x0b\x43OMMISSIONS\x10\x06\x12\x08\n\x04TIPS\x10\x07\x12\x1b\n\x17OTHER_COMPENSATION_TYPE\x10\x08\"\x9c\x01\n\x10\x43ompensationUnit\x12!\n\x1d\x43OMPENSATION_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06HOURLY\x10\x01\x12\t\n\x05\x44\x41ILY\x10\x02\x12\n\n\x06WEEKLY\x10\x03\x12\x0b\n\x07MONTHLY\x10\x04\x12\n\n\x06YEARLY\x10\x05\x12\x0c\n\x08ONE_TIME\x10\x06\x12\x1b\n\x17OTHER_COMPENSATION_UNIT\x10\x07\"\xc7\x03\n\x16\x42\x61tchOperationMetadata\x12\x43\n\x05state\x18\x01 \x01(\x0e\x32\x34.google.cloud.talent.v4.BatchOperationMetadata.State\x12\x19\n\x11state_description\x18\x02 \x01(\t\x12\x15\n\rsuccess_count\x18\x03 \x01(\x05\x12\x15\n\rfailure_count\x18\x04 \x01(\x05\x12\x13\n\x0btotal_count\x18\x05 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"z\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06*y\n\x0b\x43ompanySize\x12\x1c\n\x18\x43OMPANY_SIZE_UNSPECIFIED\x10\x00\x12\x08\n\x04MINI\x10\x01\x12\t\n\x05SMALL\x10\x02\x12\x0b\n\x07SMEDIUM\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x07\n\x03\x42IG\x10\x05\x12\n\n\x06\x42IGGER\x10\x06\x12\t\n\x05GIANT\x10\x07*\xe2\x01\n\nJobBenefit\x12\x1b\n\x17JOB_BENEFIT_UNSPECIFIED\x10\x00\x12\x0e\n\nCHILD_CARE\x10\x01\x12\n\n\x06\x44\x45NTAL\x10\x02\x12\x14\n\x10\x44OMESTIC_PARTNER\x10\x03\x12\x12\n\x0e\x46LEXIBLE_HOURS\x10\x04\x12\x0b\n\x07MEDICAL\x10\x05\x12\x12\n\x0eLIFE_INSURANCE\x10\x06\x12\x12\n\x0ePARENTAL_LEAVE\x10\x07\x12\x13\n\x0fRETIREMENT_PLAN\x10\x08\x12\r\n\tSICK_DAYS\x10\t\x12\x0c\n\x08VACATION\x10\n\x12\n\n\x06VISION\x10\x0b*\x8e\x02\n\nDegreeType\x12\x1b\n\x17\x44\x45GREE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PRIMARY_EDUCATION\x10\x01\x12\x1d\n\x19LOWER_SECONDARY_EDUCATION\x10\x02\x12\x1d\n\x19UPPER_SECONDARY_EDUCATION\x10\x03\x12\x1c\n\x18\x41\x44ULT_REMEDIAL_EDUCATION\x10\x04\x12\x1c\n\x18\x41SSOCIATES_OR_EQUIVALENT\x10\x05\x12\x1b\n\x17\x42\x41\x43HELORS_OR_EQUIVALENT\x10\x06\x12\x19\n\x15MASTERS_OR_EQUIVALENT\x10\x07\x12\x1a\n\x16\x44OCTORAL_OR_EQUIVALENT\x10\x08*\xdc\x01\n\x0e\x45mploymentType\x12\x1f\n\x1b\x45MPLOYMENT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFULL_TIME\x10\x01\x12\r\n\tPART_TIME\x10\x02\x12\x0e\n\nCONTRACTOR\x10\x03\x12\x14\n\x10\x43ONTRACT_TO_HIRE\x10\x04\x12\r\n\tTEMPORARY\x10\x05\x12\n\n\x06INTERN\x10\x06\x12\r\n\tVOLUNTEER\x10\x07\x12\x0c\n\x08PER_DIEM\x10\x08\x12\x12\n\x0e\x46LY_IN_FLY_OUT\x10\t\x12\x19\n\x15OTHER_EMPLOYMENT_TYPE\x10\n*q\n\x08JobLevel\x12\x19\n\x15JOB_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45NTRY_LEVEL\x10\x01\x12\x0f\n\x0b\x45XPERIENCED\x10\x02\x12\x0b\n\x07MANAGER\x10\x03\x12\x0c\n\x08\x44IRECTOR\x10\x04\x12\r\n\tEXECUTIVE\x10\x05*\xba\x06\n\x0bJobCategory\x12\x1c\n\x18JOB_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41\x43\x43OUNTING_AND_FINANCE\x10\x01\x12\x1d\n\x19\x41\x44MINISTRATIVE_AND_OFFICE\x10\x02\x12\x1d\n\x19\x41\x44VERTISING_AND_MARKETING\x10\x03\x12\x0f\n\x0b\x41NIMAL_CARE\x10\x04\x12\x1a\n\x16\x41RT_FASHION_AND_DESIGN\x10\x05\x12\x17\n\x13\x42USINESS_OPERATIONS\x10\x06\x12\x1b\n\x17\x43LEANING_AND_FACILITIES\x10\x07\x12\x13\n\x0f\x43OMPUTER_AND_IT\x10\x08\x12\x10\n\x0c\x43ONSTRUCTION\x10\t\x12\x14\n\x10\x43USTOMER_SERVICE\x10\n\x12\r\n\tEDUCATION\x10\x0b\x12\x1c\n\x18\x45NTERTAINMENT_AND_TRAVEL\x10\x0c\x12\x18\n\x14\x46\x41RMING_AND_OUTDOORS\x10\r\x12\x0e\n\nHEALTHCARE\x10\x0e\x12\x13\n\x0fHUMAN_RESOURCES\x10\x0f\x12\'\n#INSTALLATION_MAINTENANCE_AND_REPAIR\x10\x10\x12\t\n\x05LEGAL\x10\x11\x12\x0e\n\nMANAGEMENT\x10\x12\x12\x1f\n\x1bMANUFACTURING_AND_WAREHOUSE\x10\x13\x12$\n MEDIA_COMMUNICATIONS_AND_WRITING\x10\x14\x12\x16\n\x12OIL_GAS_AND_MINING\x10\x15\x12\x1e\n\x1aPERSONAL_CARE_AND_SERVICES\x10\x16\x12\x17\n\x13PROTECTIVE_SERVICES\x10\x17\x12\x0f\n\x0bREAL_ESTATE\x10\x18\x12\x1e\n\x1aRESTAURANT_AND_HOSPITALITY\x10\x19\x12\x14\n\x10SALES_AND_RETAIL\x10\x1a\x12\x1b\n\x17SCIENCE_AND_ENGINEERING\x10\x1b\x12\"\n\x1eSOCIAL_SERVICES_AND_NON_PROFIT\x10\x1c\x12!\n\x1dSPORTS_FITNESS_AND_RECREATION\x10\x1d\x12 \n\x1cTRANSPORTATION_AND_LOGISTICS\x10\x1e*e\n\rPostingRegion\x12\x1e\n\x1aPOSTING_REGION_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x01\x12\n\n\x06NATION\x10\x02\x12\x0f\n\x0bTELECOMMUTE\x10\x03*n\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x41\x43\x43OUNT_ONLY\x10\x01\x12\x16\n\x12SHARED_WITH_GOOGLE\x10\x02\x12\x16\n\x12SHARED_WITH_PUBLIC\x10\x03\x1a\x02\x18\x01*q\n\x10HtmlSanitization\x12!\n\x1dHTML_SANITIZATION_UNSPECIFIED\x10\x00\x12\x1e\n\x1aHTML_SANITIZATION_DISABLED\x10\x01\x12\x1a\n\x16SIMPLE_FORMATTING_ONLY\x10\x02*{\n\rCommuteMethod\x12\x1e\n\x1a\x43OMMUTE_METHOD_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44RIVING\x10\x01\x12\x0b\n\x07TRANSIT\x10\x02\x12\x0b\n\x07WALKING\x10\x03\x12\x0b\n\x07\x43YCLING\x10\x04\x12\x16\n\x12TRANSIT_ACCESSIBLE\x10\x05\x42\x65\n\x1a\x63om.google.cloud.talent.v4B\x0b\x43ommonProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.type.PostalAddress", "google/type/postal_address.proto"], - ["google.type.LatLng", "google/type/latlng.proto"], - ["google.type.Money", "google/type/money.proto"], - ["google.protobuf.DoubleValue", "google/protobuf/wrappers.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 Talent - module V4 - TimestampRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.TimestampRange").msgclass - Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location").msgclass - Location::LocationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Location.LocationType").enummodule - RequestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.RequestMetadata").msgclass - ResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ResponseMetadata").msgclass - DeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo").msgclass - DeviceInfo::DeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeviceInfo.DeviceType").enummodule - CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CustomAttribute").msgclass - SpellingCorrection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SpellingCorrection").msgclass - CompensationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo").msgclass - CompensationInfo::CompensationEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationEntry").msgclass - CompensationInfo::CompensationRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationRange").msgclass - CompensationInfo::CompensationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationType").enummodule - CompensationInfo::CompensationUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationInfo.CompensationUnit").enummodule - BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata").msgclass - BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchOperationMetadata.State").enummodule - CompanySize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompanySize").enummodule - JobBenefit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobBenefit").enummodule - DegreeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DegreeType").enummodule - EmploymentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.EmploymentType").enummodule - JobLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobLevel").enummodule - JobCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobCategory").enummodule - PostingRegion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.PostingRegion").enummodule - Visibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Visibility").enummodule - HtmlSanitization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HtmlSanitization").enummodule - CommuteMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb deleted file mode 100644 index 9f8fd2ced95a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/company.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4/common_pb' - - -descriptor_data = "\n$google/cloud/talent/v4/company.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\xc8\x04\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x65xternal_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x31\n\x04size\x18\x04 \x01(\x0e\x32#.google.cloud.talent.v4.CompanySize\x12\x1c\n\x14headquarters_address\x18\x05 \x01(\t\x12\x15\n\rhiring_agency\x18\x06 \x01(\x08\x12\x10\n\x08\x65\x65o_text\x18\x07 \x01(\t\x12\x13\n\x0bwebsite_uri\x18\x08 \x01(\t\x12\x17\n\x0f\x63\x61reer_site_uri\x18\t \x01(\t\x12\x11\n\timage_uri\x18\n \x01(\t\x12\x34\n(keyword_searchable_job_custom_attributes\x18\x0b \x03(\tB\x02\x18\x01\x12\x46\n\x0c\x64\x65rived_info\x18\x0c \x01(\x0b\x32+.google.cloud.talent.v4.Company.DerivedInfoB\x03\xe0\x41\x03\x12\x16\n\tsuspended\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x1aN\n\x0b\x44\x65rivedInfo\x12?\n\x15headquarters_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location:Y\xea\x41V\n\x1bjobs.googleapis.com/Company\x12\x37projects/{project}/tenants/{tenant}/companies/{company}Bf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x43ompanyProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Location", "google/cloud/talent/v4/common.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 Talent - module V4 - Company = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company").msgclass - Company::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Company.DerivedInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb deleted file mode 100644 index 948f3a46bcd2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/company_service/credentials" -require "google/cloud/talent/v4/company_service/paths" -require "google/cloud/talent/v4/company_service/client" -require "google/cloud/talent/v4/company_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles company management, including CRUD and enumeration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/company_service" - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/company_service/rest" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module CompanyService - end - end - end - end -end - -helper_path = ::File.join __dir__, "company_service", "helpers.rb" -require "google/cloud/talent/v4/company_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb deleted file mode 100644 index 174536c919cc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/client.rb +++ /dev/null @@ -1,909 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" - -module Google - module Cloud - module Talent - module V4 - module CompanyService - ## - # Client for the CompanyService service. - # - # A service that handles company management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :company_service_stub - - ## - # Configure the CompanyService Client class. - # - # See {::Google::Cloud::Talent::V4::CompanyService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompanyService clients - # ::Google::Cloud::Talent::V4::CompanyService::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", "Talent", "V4"] - 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_company.timeout = 30.0 - - default_config.rpcs.get_company.timeout = 30.0 - default_config.rpcs.get_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_company.timeout = 30.0 - - default_config.rpcs.delete_company.timeout = 30.0 - default_config.rpcs.delete_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_companies.timeout = 30.0 - default_config.rpcs.list_companies.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompanyService 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::Talent::V4::CompanyService::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 - @company_service_stub.universe_domain - end - - ## - # Create a new CompanyService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompanyService 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/talent/v4/company_service_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 - - @company_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::CompanyService::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, - logger: @config.logger - ) - - @company_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @company_service_stub.logger - end - - # Service calls - - ## - # Creates a new company entity. - # - # @overload create_company(request, options = nil) - # Pass arguments to `create_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) - # Pass arguments to `create_company` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new - # - # # Call the create_company method. - # result = client.create_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def create_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :create_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified company. - # - # @overload get_company(request, options = nil) - # Pass arguments to `get_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `get_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetCompanyRequest.new - # - # # Call the get_company method. - # result = client.get_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def get_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :get_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified company. - # - # @overload update_company(request, options = nil) - # Pass arguments to `update_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) - # Pass arguments to `update_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Company Company} are - # supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new - # - # # Call the update_company method. - # result = client.update_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def update_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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.company&.name - header_params["company.name"] = request.company.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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :update_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified company. - # Prerequisite: The company has no jobs associated with it. - # - # @overload delete_company(request, options = nil) - # Pass arguments to `delete_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `delete_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new - # - # # Call the delete_company method. - # result = client.delete_company request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :delete_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all companies associated with the project. - # - # @overload list_companies(request, options = nil) - # Pass arguments to `list_companies` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) - # Pass arguments to `list_companies` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @param require_open_jobs [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new - # - # # Call the list_companies method. - # result = client.list_companies 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::Talent::V4::Company. - # p item - # end - # - def list_companies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest - - # Converts hash 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_companies.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::Talent::V4::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_companies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_companies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :list_companies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @company_service_stub, :list_companies, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CompanyService API. - # - # This class represents the configuration for CompanyService, - # 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::Talent::V4::CompanyService::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_company to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::CompanyService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CompanyService 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_company` - # @return [::Gapic::Config::Method] - # - attr_reader :create_company - ## - # RPC-specific configuration for `get_company` - # @return [::Gapic::Config::Method] - # - attr_reader :get_company - ## - # RPC-specific configuration for `update_company` - # @return [::Gapic::Config::Method] - # - attr_reader :update_company - ## - # RPC-specific configuration for `delete_company` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_company - ## - # RPC-specific configuration for `list_companies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_companies - - # @private - def initialize parent_rpcs = nil - create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company - @create_company = ::Gapic::Config::Method.new create_company_config - get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company - @get_company = ::Gapic::Config::Method.new get_company_config - update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company - @update_company = ::Gapic::Config::Method.new update_company_config - delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company - @delete_company = ::Gapic::Config::Method.new delete_company_config - list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies - @list_companies = ::Gapic::Config::Method.new list_companies_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb deleted file mode 100644 index 6cb90fd7eecb..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module CompanyService - # Credentials for the CompanyService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb deleted file mode 100644 index c4a717b39ab8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module CompanyService - # Path helper methods for the CompanyService API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @return [::String] - def company_path project:, tenant:, company: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb deleted file mode 100644 index 3c513e88db2d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/company_service/credentials" -require "google/cloud/talent/v4/company_service/paths" -require "google/cloud/talent/v4/company_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles company management, including CRUD and enumeration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/company_service/rest" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module CompanyService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/company_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb deleted file mode 100644 index f1d3ac698682..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/client.rb +++ /dev/null @@ -1,831 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" -require "google/cloud/talent/v4/company_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module CompanyService - module Rest - ## - # REST client for the CompanyService service. - # - # A service that handles company management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :company_service_stub - - ## - # Configure the CompanyService Client class. - # - # See {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompanyService clients - # ::Google::Cloud::Talent::V4::CompanyService::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", "Talent", "V4"] - 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_company.timeout = 30.0 - - default_config.rpcs.get_company.timeout = 30.0 - default_config.rpcs.get_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_company.timeout = 30.0 - - default_config.rpcs.delete_company.timeout = 30.0 - default_config.rpcs.delete_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_companies.timeout = 30.0 - default_config.rpcs.list_companies.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompanyService 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::Talent::V4::CompanyService::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 - @company_service_stub.universe_domain - end - - ## - # Create a new CompanyService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompanyService 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 - - @company_service_stub = ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @company_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @company_service_stub.logger - end - - # Service calls - - ## - # Creates a new company entity. - # - # @overload create_company(request, options = nil) - # Pass arguments to `create_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) - # Pass arguments to `create_company` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateCompanyRequest.new - # - # # Call the create_company method. - # result = client.create_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def create_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.create_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified company. - # - # @overload get_company(request, options = nil) - # Pass arguments to `get_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `get_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetCompanyRequest.new - # - # # Call the get_company method. - # result = client.get_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def get_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.get_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified company. - # - # @overload update_company(request, options = nil) - # Pass arguments to `update_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) - # Pass arguments to `update_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param company [::Google::Cloud::Talent::V4::Company, ::Hash] - # Required. The company resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Company Company} are - # supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new - # - # # Call the update_company method. - # result = client.update_company request - # - # # The returned object is of type Google::Cloud::Talent::V4::Company. - # p result - # - def update_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.update_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified company. - # Prerequisite: The company has no jobs associated with it. - # - # @overload delete_company(request, options = nil) - # Pass arguments to `delete_company` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `delete_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new - # - # # Call the delete_company method. - # result = client.delete_company request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest - - # Converts hash 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_company.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::Talent::V4::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.delete_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all companies associated with the project. - # - # @overload list_companies(request, options = nil) - # Pass arguments to `list_companies` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) - # Pass arguments to `list_companies` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @param require_open_jobs [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListCompaniesRequest.new - # - # # Call the list_companies method. - # result = client.list_companies 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::Talent::V4::Company. - # p item - # end - # - def list_companies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest - - # Converts hash 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_companies.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::Talent::V4::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_companies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_companies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.list_companies request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CompanyService REST API. - # - # This class represents the configuration for CompanyService 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::Talent::V4::CompanyService::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_company to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CompanyService 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_company` - # @return [::Gapic::Config::Method] - # - attr_reader :create_company - ## - # RPC-specific configuration for `get_company` - # @return [::Gapic::Config::Method] - # - attr_reader :get_company - ## - # RPC-specific configuration for `update_company` - # @return [::Gapic::Config::Method] - # - attr_reader :update_company - ## - # RPC-specific configuration for `delete_company` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_company - ## - # RPC-specific configuration for `list_companies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_companies - - # @private - def initialize parent_rpcs = nil - create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company - @create_company = ::Gapic::Config::Method.new create_company_config - get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company - @get_company = ::Gapic::Config::Method.new get_company_config - update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company - @update_company = ::Gapic::Config::Method.new update_company_config - delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company - @delete_company = ::Gapic::Config::Method.new delete_company_config - list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies - @list_companies = ::Gapic::Config::Method.new list_companies_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb deleted file mode 100644 index c890988eb823..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb +++ /dev/null @@ -1,388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" - -module Google - module Cloud - module Talent - module V4 - module CompanyService - module Rest - ## - # REST service stub for the CompanyService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] - # 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::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # A result object deserialized from the server's reply - def create_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_company_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, - method_name: "create_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] - # 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::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # A result object deserialized from the server's reply - def get_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_company_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, - method_name: "get_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] - # 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::Talent::V4::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Company] - # A result object deserialized from the server's reply - def update_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_company_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, - method_name: "update_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] - # 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_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_company_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, - method_name: "delete_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_companies REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] - # 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::Talent::V4::ListCompaniesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ListCompaniesResponse] - # A result object deserialized from the server's reply - def list_companies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_companies_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, - method_name: "list_companies", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/companies", - body: "company", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v4/{company.name}", - body: "company", - matches: [ - ["company.name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_companies REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListCompaniesRequest] - # 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_companies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{parent}/companies", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb deleted file mode 100644 index c07404b567d8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/company_service.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/talent/v4/common_pb' -require 'google/cloud/talent/v4/company_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n,google/cloud/talent/v4/company_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/company.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x81\x01\n\x14\x43reateCompanyRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x35\n\x07\x63ompany\x18\x02 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\"F\n\x11GetCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"~\n\x14UpdateCompanyRequest\x12\x35\n\x07\x63ompany\x18\x01 \x01(\x0b\x32\x1f.google.cloud.talent.v4.CompanyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x14\x44\x65leteCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x8c\x01\n\x14ListCompaniesRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x19\n\x11require_open_jobs\x18\x04 \x01(\x08\"\xa0\x01\n\x15ListCompaniesResponse\x12\x32\n\tcompanies\x18\x01 \x03(\x0b\x32\x1f.google.cloud.talent.v4.Company\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xc3\x07\n\x0e\x43ompanyService\x12\xad\x01\n\rCreateCompany\x12,.google.cloud.talent.v4.CreateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"M\xda\x41\x0eparent,company\x82\xd3\xe4\x93\x02\x36\"+/v4/{parent=projects/*/tenants/*}/companies:\x07\x63ompany\x12\x94\x01\n\nGetCompany\x12).google.cloud.talent.v4.GetCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v4/{name=projects/*/tenants/*/companies/*}\x12\xba\x01\n\rUpdateCompany\x12,.google.cloud.talent.v4.UpdateCompanyRequest\x1a\x1f.google.cloud.talent.v4.Company\"Z\xda\x41\x13\x63ompany,update_mask\x82\xd3\xe4\x93\x02>23/v4/{company.name=projects/*/tenants/*/companies/*}:\x07\x63ompany\x12\x91\x01\n\rDeleteCompany\x12,.google.cloud.talent.v4.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v4/{name=projects/*/tenants/*/companies/*}\x12\xaa\x01\n\rListCompanies\x12,.google.cloud.talent.v4.ListCompaniesRequest\x1a-.google.cloud.talent.v4.ListCompaniesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v4/{parent=projects/*/tenants/*}/companies\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBm\n\x1a\x63om.google.cloud.talent.v4B\x13\x43ompanyServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Company", "google/cloud/talent/v4/company.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.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 Talent - module V4 - CreateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateCompanyRequest").msgclass - GetCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetCompanyRequest").msgclass - UpdateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateCompanyRequest").msgclass - DeleteCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteCompanyRequest").msgclass - ListCompaniesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesRequest").msgclass - ListCompaniesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListCompaniesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb deleted file mode 100644 index 970558173e7b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/company_service_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/company_service.proto for package 'google.cloud.talent.v4' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4/company_service_pb' - -module Google - module Cloud - module Talent - module V4 - module CompanyService - # A service that handles company management, including CRUD and enumeration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.CompanyService' - - # Creates a new company entity. - rpc :CreateCompany, ::Google::Cloud::Talent::V4::CreateCompanyRequest, ::Google::Cloud::Talent::V4::Company - # Retrieves specified company. - rpc :GetCompany, ::Google::Cloud::Talent::V4::GetCompanyRequest, ::Google::Cloud::Talent::V4::Company - # Updates specified company. - rpc :UpdateCompany, ::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Google::Cloud::Talent::V4::Company - # Deletes specified company. - # Prerequisite: The company has no jobs associated with it. - rpc :DeleteCompany, ::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Google::Protobuf::Empty - # Lists all companies associated with the project. - rpc :ListCompanies, ::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Google::Cloud::Talent::V4::ListCompaniesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb deleted file mode 100644 index b6fa3c5a86bc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/completion/credentials" -require "google/cloud/talent/v4/completion/paths" -require "google/cloud/talent/v4/completion/client" -require "google/cloud/talent/v4/completion/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles auto completion. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/completion" - # client = ::Google::Cloud::Talent::V4::Completion::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/completion/rest" - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - module Completion - end - end - end - end -end - -helper_path = ::File.join __dir__, "completion", "helpers.rb" -require "google/cloud/talent/v4/completion/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb deleted file mode 100644 index 94005a2e169b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/client.rb +++ /dev/null @@ -1,510 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" - -module Google - module Cloud - module Talent - module V4 - module Completion - ## - # Client for the Completion service. - # - # A service handles auto completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_stub - - ## - # Configure the Completion Client class. - # - # See {::Google::Cloud::Talent::V4::Completion::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Completion clients - # ::Google::Cloud::Talent::V4::Completion::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", "Talent", "V4"] - 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.complete_query.timeout = 30.0 - default_config.rpcs.complete_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Completion 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::Talent::V4::Completion::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 - @completion_stub.universe_domain - end - - ## - # Create a new Completion client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::Completion::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Completion 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/talent/v4/completion_service_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 - - @completion_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::Completion::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, - logger: @config.logger - ) - - @completion_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @completion_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::String] - # Required. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param language_codes [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @param page_size [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @param company [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::Completion::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest - - # Converts hash 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.complete_query.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::Talent::V4::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.tenant - header_params["tenant"] = request.tenant - 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.complete_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_stub.call_rpc :complete_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Completion API. - # - # This class represents the configuration for Completion, - # 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::Talent::V4::Completion::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 - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::Completion::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 Completion 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 `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb deleted file mode 100644 index 7cd296fec044..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module Completion - # Credentials for the Completion API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb deleted file mode 100644 index 76d8a7f968e1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module Completion - # Path helper methods for the Completion API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @return [::String] - def company_path project:, tenant:, company: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb deleted file mode 100644 index 20ebc6431f70..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/completion/credentials" -require "google/cloud/talent/v4/completion/paths" -require "google/cloud/talent/v4/completion/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles auto completion. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/completion/rest" - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - module Completion - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/completion/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb deleted file mode 100644 index 8d92314466de..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/client.rb +++ /dev/null @@ -1,460 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" -require "google/cloud/talent/v4/completion/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module Completion - module Rest - ## - # REST client for the Completion service. - # - # A service handles auto completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_stub - - ## - # Configure the Completion Client class. - # - # See {::Google::Cloud::Talent::V4::Completion::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Completion clients - # ::Google::Cloud::Talent::V4::Completion::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", "Talent", "V4"] - 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.complete_query.timeout = 30.0 - default_config.rpcs.complete_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Completion 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::Talent::V4::Completion::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 - @completion_stub.universe_domain - end - - ## - # Create a new Completion REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Completion 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 - - @completion_stub = ::Google::Cloud::Talent::V4::Completion::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @completion_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @completion_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Talent::V4::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload complete_query(tenant: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::String] - # Required. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param language_codes [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @param page_size [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @param company [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @param scope [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @param type [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::Completion::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CompleteQueryRequest - - # Converts hash 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.complete_query.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::Talent::V4::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.complete_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_stub.complete_query request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Completion REST API. - # - # This class represents the configuration for Completion 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::Talent::V4::Completion::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 - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::Completion::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 Completion 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 `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb deleted file mode 100644 index 05cfeeb2676d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion/rest/service_stub.rb +++ /dev/null @@ -1,142 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" - -module Google - module Cloud - module Talent - module V4 - module Completion - module Rest - ## - # REST service stub for the Completion service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the complete_query REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] - # 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::Talent::V4::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::CompleteQueryResponse] - # A result object deserialized from the server's reply - def complete_query request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_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, - method_name: "complete_query", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the complete_query REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_complete_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{tenant}:completeQuery", - matches: [ - ["tenant", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb deleted file mode 100644 index 3fbf900dcf6d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/completion_service.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/talent/v4/common_pb' - - -descriptor_data = "\n/google/cloud/talent/v4/completion_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\"\x88\x04\n\x14\x43ompleteQueryRequest\x12\x32\n\x06tenant\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12K\n\x05scope\x18\x06 \x01(\x0e\x32<.google.cloud.talent.v4.CompleteQueryRequest.CompletionScope\x12I\n\x04type\x18\x07 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02\"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03\"\xb6\x02\n\x15\x43ompleteQueryResponse\x12Z\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32>.google.cloud.talent.v4.CompleteQueryResponse.CompletionResult\x12:\n\x08metadata\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x1a\x84\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12I\n\x04type\x18\x02 \x01(\x0e\x32;.google.cloud.talent.v4.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xa2\x02\n\nCompletion\x12\xa5\x01\n\rCompleteQuery\x12,.google.cloud.talent.v4.CompleteQueryRequest\x1a-.google.cloud.talent.v4.CompleteQueryResponse\"7\x82\xd3\xe4\x93\x02\x31\x12//v4/{tenant=projects/*/tenants/*}:completeQuery\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBp\n\x1a\x63om.google.cloud.talent.v4B\x16\x43ompletionServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.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 Talent - module V4 - CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest").msgclass - CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionScope").enummodule - CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionType").enummodule - CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse").msgclass - CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse.CompletionResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb deleted file mode 100644 index ee3e95861429..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/completion_service_services_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/completion_service.proto for package 'google.cloud.talent.v4' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4/completion_service_pb' - -module Google - module Cloud - module Talent - module V4 - module Completion - # A service handles auto completion. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.Completion' - - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - rpc :CompleteQuery, ::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Google::Cloud::Talent::V4::CompleteQueryResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb deleted file mode 100644 index 553b2b45aeef..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/event.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\"google/cloud/talent/v4/event.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc3\x01\n\x0b\x43lientEvent\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x35\n\tjob_event\x18\x05 \x01(\x0b\x32 .google.cloud.talent.v4.JobEventH\x00\x12\x13\n\x0b\x65vent_notes\x18\t \x01(\tB\x07\n\x05\x65vent\"\xe0\x03\n\x08JobEvent\x12@\n\x04type\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4.JobEvent.JobEventTypeB\x03\xe0\x41\x02\x12\x11\n\x04jobs\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xfe\x02\n\x0cJobEventType\x12\x1e\n\x1aJOB_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x11\n\rVIEW_REDIRECT\x10\x03\x12\x15\n\x11\x41PPLICATION_START\x10\x04\x12\x16\n\x12\x41PPLICATION_FINISH\x10\x05\x12 \n\x1c\x41PPLICATION_QUICK_SUBMISSION\x10\x06\x12\x18\n\x14\x41PPLICATION_REDIRECT\x10\x07\x12!\n\x1d\x41PPLICATION_START_FROM_SEARCH\x10\x08\x12$\n APPLICATION_REDIRECT_FROM_SEARCH\x10\t\x12\x1e\n\x1a\x41PPLICATION_COMPANY_SUBMIT\x10\n\x12\x0c\n\x08\x42OOKMARK\x10\x0b\x12\x10\n\x0cNOTIFICATION\x10\x0c\x12\t\n\x05HIRED\x10\r\x12\x0b\n\x07SENT_CV\x10\x0e\x12\x15\n\x11INTERVIEW_GRANTED\x10\x0f\x42\x64\n\x1a\x63om.google.cloud.talent.v4B\nEventProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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 Talent - module V4 - ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ClientEvent").msgclass - JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent").msgclass - JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent.JobEventType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb deleted file mode 100644 index 3eae631b03f2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/event_service/credentials" -require "google/cloud/talent/v4/event_service/paths" -require "google/cloud/talent/v4/event_service/client" -require "google/cloud/talent/v4/event_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles client event report. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/event_service" - # client = ::Google::Cloud::Talent::V4::EventService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/event_service/rest" - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - module EventService - end - end - end - end -end - -helper_path = ::File.join __dir__, "event_service", "helpers.rb" -require "google/cloud/talent/v4/event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb deleted file mode 100644 index caae115348d0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/client.rb +++ /dev/null @@ -1,488 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" - -module Google - module Cloud - module Talent - module V4 - module EventService - ## - # Client for the EventService service. - # - # A service handles client event report. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :event_service_stub - - ## - # Configure the EventService Client class. - # - # See {::Google::Cloud::Talent::V4::EventService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EventService clients - # ::Google::Cloud::Talent::V4::EventService::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", "Talent", "V4"] - 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_client_event.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EventService 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::Talent::V4::EventService::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 - @event_service_stub.universe_domain - end - - ## - # Create a new EventService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::EventService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EventService 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/talent/v4/event_service_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 - - @event_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::EventService::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, - logger: @config.logger - ) - - @event_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @event_service_stub.logger - end - - # Service calls - - ## - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - # - # @overload create_client_event(request, options = nil) - # Pass arguments to `create_client_event` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) - # Pass arguments to `create_client_event` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::ClientEvent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::EventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new - # - # # Call the create_client_event method. - # result = client.create_client_event request - # - # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. - # p result - # - def create_client_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest - - # Converts hash 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_client_event.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::Talent::V4::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_client_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_client_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @event_service_stub.call_rpc :create_client_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EventService API. - # - # This class represents the configuration for EventService, - # 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::Talent::V4::EventService::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_client_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::EventService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 EventService 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_client_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_client_event - - # @private - def initialize parent_rpcs = nil - create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event - @create_client_event = ::Gapic::Config::Method.new create_client_event_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb deleted file mode 100644 index 3909062c4684..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module EventService - # Credentials for the EventService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb deleted file mode 100644 index bdb45a8600a2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/paths.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module EventService - # Path helper methods for the EventService API. - module Paths - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb deleted file mode 100644 index b3d12ce1a69a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/event_service/credentials" -require "google/cloud/talent/v4/event_service/paths" -require "google/cloud/talent/v4/event_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles client event report. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/event_service/rest" - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - module EventService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb deleted file mode 100644 index 43bd04679cc0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/client.rb +++ /dev/null @@ -1,438 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" -require "google/cloud/talent/v4/event_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module EventService - module Rest - ## - # REST client for the EventService service. - # - # A service handles client event report. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :event_service_stub - - ## - # Configure the EventService Client class. - # - # See {::Google::Cloud::Talent::V4::EventService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EventService clients - # ::Google::Cloud::Talent::V4::EventService::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", "Talent", "V4"] - 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_client_event.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EventService 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::Talent::V4::EventService::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 - @event_service_stub.universe_domain - end - - ## - # Create a new EventService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EventService 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 - - @event_service_stub = ::Google::Cloud::Talent::V4::EventService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @event_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @event_service_stub.logger - end - - # Service calls - - ## - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - # - # @overload create_client_event(request, options = nil) - # Pass arguments to `create_client_event` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) - # Pass arguments to `create_client_event` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::ClientEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::EventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateClientEventRequest.new - # - # # Call the create_client_event method. - # result = client.create_client_event request - # - # # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. - # p result - # - def create_client_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest - - # Converts hash 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_client_event.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::Talent::V4::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_client_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_client_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @event_service_stub.create_client_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EventService REST API. - # - # This class represents the configuration for EventService 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::Talent::V4::EventService::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_client_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::EventService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 EventService 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_client_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_client_event - - # @private - def initialize parent_rpcs = nil - create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event - @create_client_event = ::Gapic::Config::Method.new create_client_event_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb deleted file mode 100644 index 1df84a12be19..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" - -module Google - module Cloud - module Talent - module V4 - module EventService - module Rest - ## - # REST service stub for the EventService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_client_event REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] - # 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::Talent::V4::ClientEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # A result object deserialized from the server's reply - def create_client_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_client_event_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, - method_name: "create_client_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ClientEvent.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_client_event REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateClientEventRequest] - # 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_client_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/clientEvents", - body: "client_event", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb deleted file mode 100644 index b6407a59f4e3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/event_service.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/talent/v4/event_pb' - - -descriptor_data = "\n*google/cloud/talent/v4/event_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/talent/v4/event.proto\"\x8e\x01\n\x18\x43reateClientEventRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12>\n\x0c\x63lient_event\x18\x02 \x01(\x0b\x32#.google.cloud.talent.v4.ClientEventB\x03\xe0\x41\x02\x32\xc5\x02\n\x0c\x45ventService\x12\xc6\x01\n\x11\x43reateClientEvent\x12\x30.google.cloud.talent.v4.CreateClientEventRequest\x1a#.google.cloud.talent.v4.ClientEvent\"Z\xda\x41\x13parent,client_event\x82\xd3\xe4\x93\x02>\"./v4/{parent=projects/*/tenants/*}/clientEvents:\x0c\x63lient_event\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBk\n\x1a\x63om.google.cloud.talent.v4B\x11\x45ventServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.ClientEvent", "google/cloud/talent/v4/event.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 Talent - module V4 - CreateClientEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateClientEventRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb deleted file mode 100644 index 4e21dbe2ff0e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/event_service_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/event_service.proto for package 'google.cloud.talent.v4' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4/event_service_pb' - -module Google - module Cloud - module Talent - module V4 - module EventService - # A service handles client event report. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.EventService' - - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - rpc :CreateClientEvent, ::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Google::Cloud::Talent::V4::ClientEvent - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb deleted file mode 100644 index d1a60f54d060..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/filters_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/filters.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/talent/v4/common_pb' -require 'google/protobuf/duration_pb' -require 'google/type/latlng_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n$google/cloud/talent/v4/filters.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x18google/type/latlng.proto\x1a\x1bgoogle/type/timeofday.proto\"\xe2\x04\n\x08JobQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x1b\n\x13query_language_code\x18\x0e \x01(\t\x12\x11\n\tcompanies\x18\x02 \x03(\t\x12@\n\x10location_filters\x18\x03 \x03(\x0b\x32&.google.cloud.talent.v4.LocationFilter\x12;\n\x0ejob_categories\x18\x04 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x12=\n\x0e\x63ommute_filter\x18\x05 \x01(\x0b\x32%.google.cloud.talent.v4.CommuteFilter\x12\x1d\n\x15\x63ompany_display_names\x18\x06 \x03(\t\x12G\n\x13\x63ompensation_filter\x18\x07 \x01(\x0b\x32*.google.cloud.talent.v4.CompensationFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x08 \x01(\t\x12\x1b\n\x13\x64isable_spell_check\x18\t \x01(\x08\x12@\n\x10\x65mployment_types\x18\n \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x16\n\x0elanguage_codes\x18\x0b \x03(\t\x12\x42\n\x12publish_time_range\x18\x0c \x01(\x0b\x32&.google.cloud.talent.v4.TimestampRange\x12\x15\n\rexcluded_jobs\x18\r \x03(\t\"\xed\x02\n\x0eLocationFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x19\n\x11\x64istance_in_miles\x18\x04 \x01(\x01\x12\\\n\x16telecommute_preference\x18\x05 \x01(\x0e\x32<.google.cloud.talent.v4.LocationFilter.TelecommutePreference\"\x95\x01\n\x15TelecommutePreference\x12&\n\"TELECOMMUTE_PREFERENCE_UNSPECIFIED\x10\x00\x12\x1c\n\x14TELECOMMUTE_EXCLUDED\x10\x01\x1a\x02\x08\x01\x12\x17\n\x13TELECOMMUTE_ALLOWED\x10\x02\x12\x1d\n\x19TELECOMMUTE_JOBS_EXCLUDED\x10\x03\"\xbb\x03\n\x12\x43ompensationFilter\x12H\n\x04type\x18\x01 \x01(\x0e\x32\x35.google.cloud.talent.v4.CompensationFilter.FilterTypeB\x03\xe0\x41\x02\x12M\n\x05units\x18\x02 \x03(\x0e\x32\x39.google.cloud.talent.v4.CompensationInfo.CompensationUnitB\x03\xe0\x41\x02\x12I\n\x05range\x18\x03 \x01(\x0b\x32:.google.cloud.talent.v4.CompensationInfo.CompensationRange\x12\x38\n0include_jobs_with_unspecified_compensation_range\x18\x04 \x01(\x08\"\x86\x01\n\nFilterType\x12\x1b\n\x17\x46ILTER_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tUNIT_ONLY\x10\x01\x12\x13\n\x0fUNIT_AND_AMOUNT\x10\x02\x12\x1a\n\x16\x41NNUALIZED_BASE_AMOUNT\x10\x03\x12\x1b\n\x17\x41NNUALIZED_TOTAL_AMOUNT\x10\x04\"\xc1\x03\n\rCommuteFilter\x12\x42\n\x0e\x63ommute_method\x18\x01 \x01(\x0e\x32%.google.cloud.talent.v4.CommuteMethodB\x03\xe0\x41\x02\x12\x33\n\x11start_coordinates\x18\x02 \x01(\x0b\x32\x13.google.type.LatLngB\x03\xe0\x41\x02\x12\x37\n\x0ftravel_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12!\n\x19\x61llow_imprecise_addresses\x18\x04 \x01(\x08\x12I\n\x0croad_traffic\x18\x05 \x01(\x0e\x32\x31.google.cloud.talent.v4.CommuteFilter.RoadTrafficH\x00\x12\x30\n\x0e\x64\x65parture_time\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00\"L\n\x0bRoadTraffic\x12\x1c\n\x18ROAD_TRAFFIC_UNSPECIFIED\x10\x00\x12\x10\n\x0cTRAFFIC_FREE\x10\x01\x12\r\n\tBUSY_HOUR\x10\x02\x42\x10\n\x0etraffic_optionBf\n\x1a\x63om.google.cloud.talent.v4B\x0c\x46iltersProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.TimestampRange", "google/cloud/talent/v4/common.proto"], - ["google.type.LatLng", "google/type/latlng.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.type.TimeOfDay", "google/type/timeofday.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 Talent - module V4 - JobQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobQuery").msgclass - LocationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter").msgclass - LocationFilter::TelecommutePreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.LocationFilter.TelecommutePreference").enummodule - CompensationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter").msgclass - CompensationFilter::FilterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompensationFilter.FilterType").enummodule - CommuteFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter").msgclass - CommuteFilter::RoadTraffic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CommuteFilter.RoadTraffic").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb deleted file mode 100644 index a698ce351fce..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/histogram_pb.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/histogram.proto - -require 'google/protobuf' - - -descriptor_data = "\n&google/cloud/talent/v4/histogram.proto\x12\x16google.cloud.talent.v4\")\n\x0eHistogramQuery\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\"\xb1\x01\n\x14HistogramQueryResult\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\x12N\n\thistogram\x18\x02 \x03(\x0b\x32;.google.cloud.talent.v4.HistogramQueryResult.HistogramEntry\x1a\x30\n\x0eHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42h\n\x1a\x63om.google.cloud.talent.v4B\x0eHistogramProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ - ] - 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 Talent - module V4 - HistogramQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQuery").msgclass - HistogramQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.HistogramQueryResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb deleted file mode 100644 index f32b2914b46c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/job.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n google/cloud/talent/v4/job.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x0e\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x07\x63ompany\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12\x1b\n\x0erequisition_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\taddresses\x18\x06 \x03(\t\x12\x45\n\x10\x61pplication_info\x18\x07 \x01(\x0b\x32+.google.cloud.talent.v4.Job.ApplicationInfo\x12\x38\n\x0cjob_benefits\x18\x08 \x03(\x0e\x32\".google.cloud.talent.v4.JobBenefit\x12\x43\n\x11\x63ompensation_info\x18\t \x01(\x0b\x32(.google.cloud.talent.v4.CompensationInfo\x12L\n\x11\x63ustom_attributes\x18\n \x03(\x0b\x32\x31.google.cloud.talent.v4.Job.CustomAttributesEntry\x12\x38\n\x0c\x64\x65gree_types\x18\x0b \x03(\x0e\x32\".google.cloud.talent.v4.DegreeType\x12\x12\n\ndepartment\x18\x0c \x01(\t\x12@\n\x10\x65mployment_types\x18\r \x03(\x0e\x32&.google.cloud.talent.v4.EmploymentType\x12\x12\n\nincentives\x18\x0e \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12\x33\n\tjob_level\x18\x10 \x01(\x0e\x32 .google.cloud.talent.v4.JobLevel\x12\x17\n\x0fpromotion_value\x18\x11 \x01(\x05\x12\x16\n\x0equalifications\x18\x12 \x01(\t\x12\x18\n\x10responsibilities\x18\x13 \x01(\t\x12=\n\x0eposting_region\x18\x14 \x01(\x0e\x32%.google.cloud.talent.v4.PostingRegion\x12:\n\nvisibility\x18\x15 \x01(\x0e\x32\".google.cloud.talent.v4.VisibilityB\x02\x18\x01\x12\x32\n\x0ejob_start_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cjob_end_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14posting_publish_time\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x13posting_expire_time\x18\x19 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x13posting_create_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13posting_update_time\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12!\n\x14\x63ompany_display_name\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x0c\x64\x65rived_info\x18\x1d \x01(\x0b\x32\'.google.cloud.talent.v4.Job.DerivedInfoB\x03\xe0\x41\x03\x12I\n\x12processing_options\x18\x1e \x01(\x0b\x32-.google.cloud.talent.v4.Job.ProcessingOptions\x1a\x44\n\x0f\x41pplicationInfo\x12\x0e\n\x06\x65mails\x18\x01 \x03(\t\x12\x13\n\x0binstruction\x18\x02 \x01(\t\x12\x0c\n\x04uris\x18\x03 \x03(\t\x1a\x7f\n\x0b\x44\x65rivedInfo\x12\x33\n\tlocations\x18\x01 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12;\n\x0ejob_categories\x18\x03 \x03(\x0e\x32#.google.cloud.talent.v4.JobCategory\x1a\x83\x01\n\x11ProcessingOptions\x12)\n!disable_street_address_resolution\x18\x01 \x01(\x08\x12\x43\n\x11html_sanitization\x18\x02 \x01(\x0e\x32(.google.cloud.talent.v4.HtmlSanitization\x1a`\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.google.cloud.talent.v4.CustomAttribute:\x02\x38\x01:L\xea\x41I\n\x17jobs.googleapis.com/Job\x12.projects/{project}/tenants/{tenant}/jobs/{job}Bb\n\x1a\x63om.google.cloud.talent.v4B\x08JobProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.CompensationInfo", "google/cloud/talent/v4/common.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 Talent - module V4 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job").msgclass - Job::ApplicationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ApplicationInfo").msgclass - Job::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.DerivedInfo").msgclass - Job::ProcessingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Job.ProcessingOptions").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb deleted file mode 100644 index 72fd641b46a0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/job_service/credentials" -require "google/cloud/talent/v4/job_service/paths" -require "google/cloud/talent/v4/job_service/operations" -require "google/cloud/talent/v4/job_service/client" -require "google/cloud/talent/v4/job_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles job management, including job CRUD, enumeration and search. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/job_service" - # client = ::Google::Cloud::Talent::V4::JobService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/job_service/rest" - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - module JobService - end - end - end - end -end - -helper_path = ::File.join __dir__, "job_service", "helpers.rb" -require "google/cloud/talent/v4/job_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb deleted file mode 100644 index 0c49b93e652d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb +++ /dev/null @@ -1,2062 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" - -module Google - module Cloud - module Talent - module V4 - module JobService - ## - # Client for the JobService service. - # - # A service handles job management, including job CRUD, enumeration and search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :job_service_stub - - ## - # Configure the JobService Client class. - # - # See {::Google::Cloud::Talent::V4::JobService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobService clients - # ::Google::Cloud::Talent::V4::JobService::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", "Talent", "V4"] - 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_job.timeout = 30.0 - - default_config.rpcs.batch_create_jobs.timeout = 30.0 - - default_config.rpcs.get_job.timeout = 30.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_job.timeout = 30.0 - - default_config.rpcs.batch_update_jobs.timeout = 30.0 - - default_config.rpcs.delete_job.timeout = 30.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_delete_jobs.timeout = 30.0 - - default_config.rpcs.list_jobs.timeout = 30.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_jobs.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobService 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::Talent::V4::JobService::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_service_stub.universe_domain - end - - ## - # Create a new JobService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobService 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/talent/v4/job_service_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_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::JobService::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, - logger: @config.logger - ) - - @job_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4::JobService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @job_service_stub.logger - end - - # Service calls - - ## - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) - # Pass arguments to `create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest - - # Converts hash 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_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::Talent::V4::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_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :create_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch create jobs operation. - # - # @overload batch_create_jobs(request, options = nil) - # Pass arguments to `batch_create_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_jobs(parent: nil, jobs: nil) - # Pass arguments to `batch_create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be created. - # A maximum of 200 jobs can be created in a batch. - # - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new - # - # # Call the batch_create_jobs method. - # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest - - # Converts hash 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.batch_create_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::Talent::V4::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.batch_create_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_create_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_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_service_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(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 job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise - # all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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.job&.name - header_params["job.name"] = request.job.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_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_service_stub.call_rpc :update_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch update jobs operation. - # - # @overload batch_update_jobs(request, options = nil) - # Pass arguments to `batch_update_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) - # Pass arguments to `batch_update_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be updated. - # A maximum of 200 jobs can be updated in a batch. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} - # are updated. Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside - # {::Google::Cloud::Talent::V4::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, - # which can yield a very large response. - # - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new - # - # # Call the batch_update_jobs method. - # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest - - # Converts hash 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.batch_update_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::Talent::V4::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.batch_update_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_update_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_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_service_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch delete jobs operation. - # - # @overload batch_delete_jobs(request, options = nil) - # Pass arguments to `batch_delete_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_delete_jobs(parent: nil, names: nil) - # Pass arguments to `batch_delete_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # - # The parent of all of the jobs specified in `names` must match this field. - # @param names [::Array<::String>] - # The names of the jobs to delete. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". - # For example, "projects/foo/tenants/bar/jobs/baz". - # - # A maximum of 200 jobs can be deleted in a batch. - # - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new - # - # # Call the batch_delete_jobs method. - # result = client.batch_delete_jobs 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 batch_delete_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest - - # Converts hash 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.batch_delete_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::Talent::V4::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.batch_delete_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_delete_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists jobs by filter. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param filter [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @param page_token [::String] - # The starting point of a query result. - # @param page_size [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no - # value is specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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::Talent::V4::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_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_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs that the caller has permission to search - # against. - # - # @overload search_jobs(request, options = nil) - # Pass arguments to `search_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_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 parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs method. - # result = client.search_jobs request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash 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.search_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::Talent::V4::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.search_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :search_jobs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), it has different algorithmic - # adjustments that are designed to specifically target passive job seekers. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs the caller has permission to search - # against. - # - # @overload search_jobs_for_alert(request, options = nil) - # Pass arguments to `search_jobs_for_alert` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs_for_alert method. - # result = client.search_jobs_for_alert request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs_for_alert request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash 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.search_jobs_for_alert.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::Talent::V4::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.search_jobs_for_alert.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :search_jobs_for_alert, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the JobService API. - # - # This class represents the configuration for JobService, - # 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::Talent::V4::JobService::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_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::JobService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 JobService 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_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `batch_create_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `batch_update_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_jobs - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `batch_delete_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_jobs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `search_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs - ## - # RPC-specific configuration for `search_jobs_for_alert` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs_for_alert - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs - @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs - @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs - @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs - @search_jobs = ::Gapic::Config::Method.new search_jobs_config - search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert - @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb deleted file mode 100644 index 8264c8770c63..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module JobService - # Credentials for the JobService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb deleted file mode 100644 index 7519b6ebba50..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module JobService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobService 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 JobService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::Talent::V4::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? - throw :response, 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::Talent::V4::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? - throw :response, 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::Talent::V4::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? - 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::Talent::V4::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? - 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::Talent::V4::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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb deleted file mode 100644 index b40f2cddc538..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/paths.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module JobService - # Path helper methods for the JobService API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @return [::String] - def company_path project:, tenant:, company: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end - - ## - # Create a fully-qualified Job resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/jobs/{job}` - # - # @param project [String] - # @param tenant [String] - # @param job [String] - # - # @return [::String] - def job_path project:, tenant:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/jobs/#{job}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb deleted file mode 100644 index 2155d4710be6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/job_service/credentials" -require "google/cloud/talent/v4/job_service/paths" -require "google/cloud/talent/v4/job_service/rest/operations" -require "google/cloud/talent/v4/job_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service handles job management, including job CRUD, enumeration and search. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/job_service/rest" - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - module JobService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/job_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb deleted file mode 100644 index 88db35d75db8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/client.rb +++ /dev/null @@ -1,1949 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module JobService - module Rest - ## - # REST client for the JobService service. - # - # A service handles job management, including job CRUD, enumeration and search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :job_service_stub - - ## - # Configure the JobService Client class. - # - # See {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobService clients - # ::Google::Cloud::Talent::V4::JobService::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", "Talent", "V4"] - 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_job.timeout = 30.0 - - default_config.rpcs.batch_create_jobs.timeout = 30.0 - - default_config.rpcs.get_job.timeout = 30.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_job.timeout = 30.0 - - default_config.rpcs.batch_update_jobs.timeout = 30.0 - - default_config.rpcs.delete_job.timeout = 30.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_delete_jobs.timeout = 30.0 - - default_config.rpcs.list_jobs.timeout = 30.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_jobs.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobService 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::Talent::V4::JobService::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_service_stub.universe_domain - end - - ## - # Create a new JobService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobService 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::Talent::V4::JobService::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_service_stub = ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @job_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4::JobService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @job_service_stub.logger - end - - # Service calls - - ## - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) - # Pass arguments to `create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest - - # Converts hash 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_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::Talent::V4::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_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.create_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch create jobs operation. - # - # @overload batch_create_jobs(request, options = nil) - # Pass arguments to `batch_create_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_create_jobs(parent: nil, jobs: nil) - # Pass arguments to `batch_create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be created. - # A maximum of 200 jobs can be created in a batch. - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new - # - # # Call the batch_create_jobs method. - # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest - - # Converts hash 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.batch_create_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::Talent::V4::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.batch_create_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_create_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(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 job [::Google::Cloud::Talent::V4::Job, ::Hash] - # Required. The Job to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise - # all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.update_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch update jobs operation. - # - # @overload batch_update_jobs(request, options = nil) - # Pass arguments to `batch_update_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) - # Pass arguments to `batch_update_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>] - # Required. The jobs to be updated. - # A maximum of 200 jobs can be updated in a batch. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} - # are updated. Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside - # {::Google::Cloud::Talent::V4::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, - # which can yield a very large response. - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new - # - # # Call the batch_update_jobs method. - # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest - - # Converts hash 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.batch_update_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::Talent::V4::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.batch_update_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_update_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(name: 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 name [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.delete_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch delete jobs operation. - # - # @overload batch_delete_jobs(request, options = nil) - # Pass arguments to `batch_delete_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_delete_jobs(parent: nil, names: nil) - # Pass arguments to `batch_delete_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # - # The parent of all of the jobs specified in `names` must match this field. - # @param names [::Array<::String>] - # The names of the jobs to delete. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". - # For example, "projects/foo/tenants/bar/jobs/baz". - # - # A maximum of 200 jobs can be deleted in a batch. - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new - # - # # Call the batch_delete_jobs method. - # result = client.batch_delete_jobs 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 batch_delete_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest - - # Converts hash 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.batch_delete_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::Talent::V4::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.batch_delete_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_delete_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists jobs by filter. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param filter [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @param page_token [::String] - # The starting point of a query result. - # @param page_size [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no - # value is specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::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::Talent::V4::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::Talent::V4::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::Talent::V4::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_service_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_jobs, "jobs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs that the caller has permission to search - # against. - # - # @overload search_jobs(request, options = nil) - # Pass arguments to `search_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_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 parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs method. - # result = client.search_jobs request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash 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.search_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::Talent::V4::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.search_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.search_jobs request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), it has different algorithmic - # adjustments that are designed to specifically target passive job seekers. - # - # This call constrains the - # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the - # database, and only returns jobs the caller has permission to search - # against. - # - # @overload search_jobs_for_alert(request, options = nil) - # Pass arguments to `search_jobs_for_alert` via a request object, either of type - # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param max_page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::SearchJobsRequest.new - # - # # Call the search_jobs_for_alert method. - # result = client.search_jobs_for_alert request - # - # # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - # p result - # - def search_jobs_for_alert request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest - - # Converts hash 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.search_jobs_for_alert.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::Talent::V4::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.search_jobs_for_alert.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.search_jobs_for_alert request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the JobService REST API. - # - # This class represents the configuration for JobService 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::Talent::V4::JobService::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_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::JobService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 JobService 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_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `batch_create_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `batch_update_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_jobs - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `batch_delete_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_jobs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `search_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs - ## - # RPC-specific configuration for `search_jobs_for_alert` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs_for_alert - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs - @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs - @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs - @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs - @search_jobs = ::Gapic::Config::Method.new search_jobs_config - search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert - @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb deleted file mode 100644 index 2a2c90d09cf1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/operations.rb +++ /dev/null @@ -1,925 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module JobService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobService 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 JobService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @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::Talent::V4::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? - throw :response, 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::Talent::V4::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? - throw :response, 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::Talent::V4::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? - 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::Talent::V4::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? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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{^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: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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{^operations(?:/.*)?$}, true] - ] - ) - 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", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb deleted file mode 100644 index 634719f7c02e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb +++ /dev/null @@ -1,698 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" - -module Google - module Cloud - module Talent - module V4 - module JobService - module Rest - ## - # REST service stub for the JobService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] - # 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::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Job] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_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, - method_name: "create_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_create_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] - # 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 batch_create_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_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, - method_name: "batch_create_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::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, - method_name: "get_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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::Talent::V4::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::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, - method_name: "update_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_update_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] - # 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 batch_update_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_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, - method_name: "batch_update_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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, - method_name: "delete_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_delete_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] - # 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 batch_delete_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_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, - method_name: "batch_delete_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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::Talent::V4::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::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, - method_name: "list_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # 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::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # A result object deserialized from the server's reply - def search_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_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, - method_name: "search_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_jobs_for_alert REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # 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::Talent::V4::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse] - # A result object deserialized from the server's reply - def search_jobs_for_alert request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_for_alert_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, - method_name: "search_jobs_for_alert", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateJobRequest] - # 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_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs", - body: "job", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchCreateJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_create_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{job.name}", - body: "job", - matches: [ - ["job.name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_update_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_delete_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::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: "/v4/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:search", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_jobs_for_alert REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::SearchJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_jobs_for_alert_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/jobs:searchForAlert", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb deleted file mode 100644 index 43897fc5869c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_pb.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/job_service.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/talent/v4/common_pb' -require 'google/cloud/talent/v4/filters_pb' -require 'google/cloud/talent/v4/histogram_pb' -require 'google/cloud/talent/v4/job_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n(google/cloud/talent/v4/job_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a$google/cloud/talent/v4/filters.proto\x1a&google/cloud/talent/v4/histogram.proto\x1a google/cloud/talent/v4/job.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"r\n\x10\x43reateJobRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12-\n\x03job\x18\x02 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\">\n\rGetJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"r\n\x10UpdateJobRequest\x12-\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"A\n\x10\x44\x65leteJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"\xb1\x01\n\x0fListJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x31\n\x08job_view\x18\x05 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\"\x92\x01\n\x10ListJobsResponse\x12)\n\x04jobs\x18\x01 \x03(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\"\x9d\r\n\x11SearchJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12I\n\x0bsearch_mode\x18\x02 \x01(\x0e\x32\x34.google.cloud.talent.v4.SearchJobsRequest.SearchMode\x12\x46\n\x10request_metadata\x18\x03 \x01(\x0b\x32\'.google.cloud.talent.v4.RequestMetadataB\x03\xe0\x41\x02\x12\x33\n\tjob_query\x18\x04 \x01(\x0b\x32 .google.cloud.talent.v4.JobQuery\x12\x19\n\x11\x65nable_broadening\x18\x05 \x01(\x08\x12\x41\n\x11histogram_queries\x18\x07 \x03(\x0b\x32&.google.cloud.talent.v4.HistogramQuery\x12\x31\n\x08job_view\x18\x08 \x01(\x0e\x32\x1f.google.cloud.talent.v4.JobView\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x15\n\rmax_page_size\x18\n \x01(\x05\x12\x12\n\npage_token\x18\x0b \x01(\t\x12\x10\n\x08order_by\x18\x0c \x01(\t\x12]\n\x15\x64iversification_level\x18\r \x01(\x0e\x32>.google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel\x12X\n\x13\x63ustom_ranking_info\x18\x0e \x01(\x0b\x32;.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo\x12!\n\x15\x64isable_keyword_match\x18\x10 \x01(\x08\x42\x02\x18\x01\x12V\n\x12keyword_match_mode\x18\x12 \x01(\x0e\x32:.google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode\x12^\n\x13relevance_threshold\x18\x13 \x01(\x0e\x32<.google.cloud.talent.v4.SearchJobsRequest.RelevanceThresholdB\x03\xe0\x41\x01\x1a\x95\x02\n\x11\x43ustomRankingInfo\x12j\n\x10importance_level\x18\x01 \x01(\x0e\x32K.google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevelB\x03\xe0\x41\x02\x12\x1f\n\x12ranking_expression\x18\x02 \x01(\tB\x03\xe0\x41\x02\"s\n\x0fImportanceLevel\x12 \n\x1cIMPORTANCE_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\x08\n\x04MILD\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\x0b\n\x07\x45XTREME\x10\x06\"R\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nJOB_SEARCH\x10\x01\x12\x17\n\x13\x46\x45\x41TURED_JOB_SEARCH\x10\x02\"\xc0\x01\n\x14\x44iversificationLevel\x12%\n!DIVERSIFICATION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\n\n\x06SIMPLE\x10\x02\x12\x13\n\x0fONE_PER_COMPANY\x10\x03\x12\x13\n\x0fTWO_PER_COMPANY\x10\x04\x12\x19\n\x15MAX_THREE_PER_COMPANY\x10\x06\x12\"\n\x1e\x44IVERSIFY_BY_LOOSER_SIMILARITY\x10\x05\"\x87\x01\n\x10KeywordMatchMode\x12\"\n\x1eKEYWORD_MATCH_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16KEYWORD_MATCH_DISABLED\x10\x01\x12\x15\n\x11KEYWORD_MATCH_ALL\x10\x02\x12\x1c\n\x18KEYWORD_MATCH_TITLE_ONLY\x10\x03\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\x91\x06\n\x12SearchJobsResponse\x12M\n\rmatching_jobs\x18\x01 \x03(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.MatchingJob\x12M\n\x17histogram_query_results\x18\x02 \x03(\x0b\x32,.google.cloud.talent.v4.HistogramQueryResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12:\n\x10location_filters\x18\x04 \x03(\x0b\x32 .google.cloud.talent.v4.Location\x12\x12\n\ntotal_size\x18\x06 \x01(\x05\x12:\n\x08metadata\x18\x07 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata\x12\"\n\x1a\x62roadened_query_jobs_count\x18\x08 \x01(\x05\x12\x44\n\x10spell_correction\x18\t \x01(\x0b\x32*.google.cloud.talent.v4.SpellingCorrection\x1a\xd2\x01\n\x0bMatchingJob\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\x13\n\x0bjob_summary\x18\x02 \x01(\t\x12\x19\n\x11job_title_snippet\x18\x03 \x01(\t\x12\x1b\n\x13search_text_snippet\x18\x04 \x01(\t\x12L\n\x0c\x63ommute_info\x18\x05 \x01(\x0b\x32\x36.google.cloud.talent.v4.SearchJobsResponse.CommuteInfo\x1ay\n\x0b\x43ommuteInfo\x12\x36\n\x0cjob_location\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4.Location\x12\x32\n\x0ftravel_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"y\n\x16\x42\x61tchCreateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\"\xaa\x01\n\x16\x42\x61tchUpdateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12.\n\x04jobs\x18\x02 \x03(\x0b\x32\x1b.google.cloud.talent.v4.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"y\n\x16\x42\x61tchDeleteJobsRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12+\n\x05names\x18\x02 \x03(\tB\x1c\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"Y\n\tJobResult\x12(\n\x03job\x18\x01 \x01(\x0b\x32\x1b.google.cloud.talent.v4.Job\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"Q\n\x17\x42\x61tchCreateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchUpdateJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult\"Q\n\x17\x42\x61tchDeleteJobsResponse\x12\x36\n\x0bjob_results\x18\x01 \x03(\x0b\x32!.google.cloud.talent.v4.JobResult*v\n\x07JobView\x12\x18\n\x14JOB_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_VIEW_ID_ONLY\x10\x01\x12\x14\n\x10JOB_VIEW_MINIMAL\x10\x02\x12\x12\n\x0eJOB_VIEW_SMALL\x10\x03\x12\x11\n\rJOB_VIEW_FULL\x10\x04\x32\xdc\x0e\n\nJobService\x12\x94\x01\n\tCreateJob\x12(.google.cloud.talent.v4.CreateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"@\xda\x41\nparent,job\x82\xd3\xe4\x93\x02-\"&/v4/{parent=projects/*/tenants/*}/jobs:\x03job\x12\xe1\x01\n\x0f\x42\x61tchCreateJobs\x12..google.cloud.talent.v4.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchCreateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*\x12\x83\x01\n\x06GetJob\x12%.google.cloud.talent.v4.GetJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(\x12&/v4/{name=projects/*/tenants/*/jobs/*}\x12\x9d\x01\n\tUpdateJob\x12(.google.cloud.talent.v4.UpdateJobRequest\x1a\x1b.google.cloud.talent.v4.Job\"I\xda\x41\x0fjob,update_mask\x82\xd3\xe4\x93\x02\x31\x32*/v4/{job.name=projects/*/tenants/*/jobs/*}:\x03job\x12\xe1\x01\n\x0f\x42\x61tchUpdateJobs\x12..google.cloud.talent.v4.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x31\n\x17\x42\x61tchUpdateJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*\x12\x84\x01\n\tDeleteJob\x12(.google.cloud.talent.v4.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"5\xda\x41\x04name\x82\xd3\xe4\x93\x02(*&/v4/{name=projects/*/tenants/*/jobs/*}\x12\xe3\x01\n\x0f\x42\x61tchDeleteJobs\x12..google.cloud.talent.v4.BatchDeleteJobsRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x31\n\x17\x42\x61tchDeleteJobsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0cparent,names\x82\xd3\xe4\x93\x02\x37\"2/v4/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*\x12\x9d\x01\n\x08ListJobs\x12\'.google.cloud.talent.v4.ListJobsRequest\x1a(.google.cloud.talent.v4.ListJobsResponse\">\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02(\x12&/v4/{parent=projects/*/tenants/*}/jobs\x12\x9d\x01\n\nSearchJobs\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"8\x82\xd3\xe4\x93\x02\x32\"-/v4/{parent=projects/*/tenants/*}/jobs:search:\x01*\x12\xad\x01\n\x12SearchJobsForAlert\x12).google.cloud.talent.v4.SearchJobsRequest\x1a*.google.cloud.talent.v4.SearchJobsResponse\"@\x82\xd3\xe4\x93\x02:\"5/v4/{parent=projects/*/tenants/*}/jobs:searchForAlert:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBi\n\x1a\x63om.google.cloud.talent.v4B\x0fJobServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Job", "google/cloud/talent/v4/job.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.proto"], - ["google.cloud.talent.v4.JobQuery", "google/cloud/talent/v4/filters.proto"], - ["google.cloud.talent.v4.HistogramQuery", "google/cloud/talent/v4/histogram.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.rpc.Status", "google/rpc/status.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 Talent - module V4 - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateJobRequest").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetJobRequest").msgclass - UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteJobRequest").msgclass - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsResponse").msgclass - SearchJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest").msgclass - SearchJobsRequest::CustomRankingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo").msgclass - SearchJobsRequest::CustomRankingInfo::ImportanceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel").enummodule - SearchJobsRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.SearchMode").enummodule - SearchJobsRequest::DiversificationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel").enummodule - SearchJobsRequest::KeywordMatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.KeywordMatchMode").enummodule - SearchJobsRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.RelevanceThreshold").enummodule - SearchJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse").msgclass - SearchJobsResponse::MatchingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.MatchingJob").msgclass - SearchJobsResponse::CommuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.CommuteInfo").msgclass - BatchCreateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsRequest").msgclass - BatchUpdateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsRequest").msgclass - BatchDeleteJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsRequest").msgclass - JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobResult").msgclass - BatchCreateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsResponse").msgclass - BatchUpdateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsResponse").msgclass - BatchDeleteJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsResponse").msgclass - JobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobView").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb deleted file mode 100644 index e1a90f630e33..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service_services_pb.rb +++ /dev/null @@ -1,90 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/job_service.proto for package 'google.cloud.talent.v4' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4/job_service_pb' - -module Google - module Cloud - module Talent - module V4 - module JobService - # A service handles job management, including job CRUD, enumeration and search. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.JobService' - - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - rpc :CreateJob, ::Google::Cloud::Talent::V4::CreateJobRequest, ::Google::Cloud::Talent::V4::Job - # Begins executing a batch create jobs operation. - rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Google::Longrunning::Operation - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - rpc :GetJob, ::Google::Cloud::Talent::V4::GetJobRequest, ::Google::Cloud::Talent::V4::Job - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - rpc :UpdateJob, ::Google::Cloud::Talent::V4::UpdateJobRequest, ::Google::Cloud::Talent::V4::Job - # Begins executing a batch update jobs operation. - rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Google::Longrunning::Operation - # Deletes the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - rpc :DeleteJob, ::Google::Cloud::Talent::V4::DeleteJobRequest, ::Google::Protobuf::Empty - # Begins executing a batch delete jobs operation. - rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Google::Longrunning::Operation - # Lists jobs by filter. - rpc :ListJobs, ::Google::Cloud::Talent::V4::ListJobsRequest, ::Google::Cloud::Talent::V4::ListJobsResponse - # Searches for jobs using the provided - # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. - # - # This call constrains the - # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the - # database, and only returns jobs that the caller has permission to search - # against. - rpc :SearchJobs, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse - # Searches for jobs using the provided - # [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest]. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), it has different algorithmic - # adjustments that are designed to specifically target passive job seekers. - # - # This call constrains the - # [visibility][google.cloud.talent.v4.Job.visibility] of jobs present in the - # database, and only returns jobs the caller has permission to search - # against. - rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb deleted file mode 100644 index e29f66d86a27..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/rest.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service/rest" -require "google/cloud/talent/v4/completion/rest" -require "google/cloud/talent/v4/event_service/rest" -require "google/cloud/talent/v4/job_service/rest" -require "google/cloud/talent/v4/tenant_service/rest" -require "google/cloud/talent/v4/version" - -module Google - module Cloud - module Talent - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/talent/v4/rest" - # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new - # - module V4 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb deleted file mode 100644 index 3fd37382f449..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/tenant.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n#google/cloud/talent/v4/tenant.proto\x12\x16google.cloud.talent.v4\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"v\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x02 \x01(\tB\x03\xe0\x41\x02:D\xea\x41\x41\n\x1ajobs.googleapis.com/Tenant\x12#projects/{project}/tenants/{tenant}Be\n\x1a\x63om.google.cloud.talent.v4B\x0bTenantProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ - ] - 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 Talent - module V4 - Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Tenant").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb deleted file mode 100644 index ee4160331939..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/tenant_service/credentials" -require "google/cloud/talent/v4/tenant_service/paths" -require "google/cloud/talent/v4/tenant_service/client" -require "google/cloud/talent/v4/tenant_service/rest" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles tenant management, including CRUD and enumeration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4/tenant_service" - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4/tenant_service/rest" - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - module TenantService - end - end - end - end -end - -helper_path = ::File.join __dir__, "tenant_service", "helpers.rb" -require "google/cloud/talent/v4/tenant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb deleted file mode 100644 index fc1db7f8bdb3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/client.rb +++ /dev/null @@ -1,897 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" - -module Google - module Cloud - module Talent - module V4 - module TenantService - ## - # Client for the TenantService service. - # - # A service that handles tenant management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tenant_service_stub - - ## - # Configure the TenantService Client class. - # - # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TenantService clients - # ::Google::Cloud::Talent::V4::TenantService::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", "Talent", "V4"] - 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_tenant.timeout = 30.0 - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tenants.timeout = 30.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TenantService 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::Talent::V4::TenantService::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 - @tenant_service_stub.universe_domain - end - - ## - # Create a new TenantService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TenantService 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/talent/v4/tenant_service_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 - - @tenant_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4::TenantService::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, - logger: @config.logger - ) - - @tenant_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tenant_service_stub.logger - end - - # Service calls - - ## - # Creates a new tenant entity. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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.tenant&.name - header_params["tenant.name"] = request.tenant.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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all tenants associated with the project. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants 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::Talent::V4::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest - - # Converts hash 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_tenants.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::Talent::V4::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_tenants.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TenantService API. - # - # This class represents the configuration for TenantService, - # 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::Talent::V4::TenantService::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_tenant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::TenantService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TenantService 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_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - - # @private - def initialize parent_rpcs = nil - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb deleted file mode 100644 index daf2d0afbeef..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module TenantService - # Credentials for the TenantService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb deleted file mode 100644 index ce93b2ff685b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/paths.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - module TenantService - # Path helper methods for the TenantService API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb deleted file mode 100644 index 6edaf614d38d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/version" - -require "google/cloud/talent/v4/tenant_service/credentials" -require "google/cloud/talent/v4/tenant_service/paths" -require "google/cloud/talent/v4/tenant_service/rest/client" - -module Google - module Cloud - module Talent - module V4 - ## - # A service that handles tenant management, including CRUD and enumeration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4/tenant_service/rest" - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - module TenantService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4/tenant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb deleted file mode 100644 index 009b23f72ad2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/client.rb +++ /dev/null @@ -1,819 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" -require "google/cloud/talent/v4/tenant_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4 - module TenantService - module Rest - ## - # REST client for the TenantService service. - # - # A service that handles tenant management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tenant_service_stub - - ## - # Configure the TenantService Client class. - # - # See {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TenantService clients - # ::Google::Cloud::Talent::V4::TenantService::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", "Talent", "V4"] - 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_tenant.timeout = 30.0 - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tenants.timeout = 30.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TenantService 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::Talent::V4::TenantService::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 - @tenant_service_stub.universe_domain - end - - ## - # Create a new TenantService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TenantService 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 - - @tenant_service_stub = ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tenant_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tenant_service_stub.logger - end - - # Service calls - - ## - # Creates a new tenant entity. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.create_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.get_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash] - # Required. The tenant resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.update_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @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/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest - - # Converts hash 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_tenant.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::Talent::V4::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.delete_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all tenants associated with the project. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants 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::Talent::V4::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest - - # Converts hash 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_tenants.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::Talent::V4::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_tenants.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.list_tenants request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TenantService REST API. - # - # This class represents the configuration for TenantService 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::Talent::V4::TenantService::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_tenant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4::TenantService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TenantService 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_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - - # @private - def initialize parent_rpcs = nil - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb deleted file mode 100644 index cc7ba8e861ad..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb +++ /dev/null @@ -1,388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" - -module Google - module Cloud - module Talent - module V4 - module TenantService - module Rest - ## - # REST service stub for the TenantService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] - # 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::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # A result object deserialized from the server's reply - def create_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_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, - method_name: "create_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] - # 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::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # A result object deserialized from the server's reply - def get_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_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, - method_name: "get_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] - # 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::Talent::V4::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::Tenant] - # A result object deserialized from the server's reply - def update_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_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, - method_name: "update_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] - # 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_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_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, - method_name: "delete_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] - # 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::Talent::V4::ListTenantsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4::ListTenantsResponse] - # A result object deserialized from the server's reply - def list_tenants request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_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, - method_name: "list_tenants", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::CreateTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4/{parent}/tenants", - body: "tenant", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::GetTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::UpdateTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v4/{tenant.name}", - body: "tenant", - matches: [ - ["tenant.name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::DeleteTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v4/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::Talent::V4::ListTenantsRequest] - # 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_tenants_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4/{parent}/tenants", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb deleted file mode 100644 index 46d96abbb8fc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4/tenant_service.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/talent/v4/common_pb' -require 'google/cloud/talent/v4/tenant_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n+google/cloud/talent/v4/tenant_service.proto\x12\x16google.cloud.talent.v4\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/talent/v4/common.proto\x1a#google/cloud/talent/v4/tenant.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x8f\x01\n\x13\x43reateTenantRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x33\n\x06tenant\x18\x02 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\"D\n\x10GetTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"{\n\x13UpdateTenantRequest\x12\x33\n\x06tenant\x18\x01 \x01(\x0b\x32\x1e.google.cloud.talent.v4.TenantB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x13\x44\x65leteTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x12ListTenantsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x9b\x01\n\x13ListTenantsResponse\x12/\n\x07tenants\x18\x01 \x03(\x0b\x32\x1e.google.cloud.talent.v4.Tenant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12:\n\x08metadata\x18\x03 \x01(\x0b\x32(.google.cloud.talent.v4.ResponseMetadata2\xf0\x06\n\rTenantService\x12\x9c\x01\n\x0c\x43reateTenant\x12+.google.cloud.talent.v4.CreateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"?\xda\x41\rparent,tenant\x82\xd3\xe4\x93\x02)\"\x1f/v4/{parent=projects/*}/tenants:\x06tenant\x12\x85\x01\n\tGetTenant\x12(.google.cloud.talent.v4.GetTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{name=projects/*/tenants/*}\x12\xa8\x01\n\x0cUpdateTenant\x12+.google.cloud.talent.v4.UpdateTenantRequest\x1a\x1e.google.cloud.talent.v4.Tenant\"K\xda\x41\x12tenant,update_mask\x82\xd3\xe4\x93\x02\x30\x32&/v4/{tenant.name=projects/*/tenants/*}:\x06tenant\x12\x83\x01\n\x0c\x44\x65leteTenant\x12+.google.cloud.talent.v4.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\".\xda\x41\x04name\x82\xd3\xe4\x93\x02!*\x1f/v4/{name=projects/*/tenants/*}\x12\x98\x01\n\x0bListTenants\x12*.google.cloud.talent.v4.ListTenantsRequest\x1a+.google.cloud.talent.v4.ListTenantsResponse\"0\xda\x41\x06parent\x82\xd3\xe4\x93\x02!\x12\x1f/v4/{parent=projects/*}/tenants\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBl\n\x1a\x63om.google.cloud.talent.v4B\x12TenantServiceProtoP\x01Z2cloud.google.com/go/talent/apiv4/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4.Tenant", "google/cloud/talent/v4/tenant.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.talent.v4.ResponseMetadata", "google/cloud/talent/v4/common.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 Talent - module V4 - CreateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateTenantRequest").msgclass - GetTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetTenantRequest").msgclass - UpdateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateTenantRequest").msgclass - DeleteTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteTenantRequest").msgclass - ListTenantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsRequest").msgclass - ListTenantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListTenantsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb deleted file mode 100644 index 1761f0653df7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/tenant_service_services_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4/tenant_service.proto for package 'google.cloud.talent.v4' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4/tenant_service_pb' - -module Google - module Cloud - module Talent - module V4 - module TenantService - # A service that handles tenant management, including CRUD and enumeration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4.TenantService' - - # Creates a new tenant entity. - rpc :CreateTenant, ::Google::Cloud::Talent::V4::CreateTenantRequest, ::Google::Cloud::Talent::V4::Tenant - # Retrieves specified tenant. - rpc :GetTenant, ::Google::Cloud::Talent::V4::GetTenantRequest, ::Google::Cloud::Talent::V4::Tenant - # Updates specified tenant. - rpc :UpdateTenant, ::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Google::Cloud::Talent::V4::Tenant - # Deletes specified tenant. - rpc :DeleteTenant, ::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Google::Protobuf::Empty - # Lists all tenants associated with the project. - rpc :ListTenants, ::Google::Cloud::Talent::V4::ListTenantsRequest, ::Google::Cloud::Talent::V4::ListTenantsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb b/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb deleted file mode 100644 index c14911f7ba77..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md b/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md deleted file mode 100644 index 4583e024e1f4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Talent Solution V4 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-talent-v4/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/cloud/talent/v4/common.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb deleted file mode 100644 index 4a754f4d0ab3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/common.rb +++ /dev/null @@ -1,959 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # Message representing a period of time between two timestamps. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Begin of the period (inclusive). - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End of the period (exclusive). - class TimestampRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A resource that represents a location with full geographic information. - # @!attribute [rw] location_type - # @return [::Google::Cloud::Talent::V4::Location::LocationType] - # The type of a location, which corresponds to the address lines field of - # {::Google::Type::PostalAddress google.type.PostalAddress}. For example, - # "Downtown, Atlanta, GA, USA" has a type of - # {::Google::Cloud::Talent::V4::Location::LocationType::NEIGHBORHOOD LocationType.NEIGHBORHOOD}, - # and "Kansas City, KS, USA" has a type of - # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}. - # @!attribute [rw] postal_address - # @return [::Google::Type::PostalAddress] - # Postal address of the location that includes human readable information, - # such as postal delivery and payments addresses. Given a postal address, - # a postal service can deliver items to a premises, P.O. Box, or other - # delivery location. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # An object representing a latitude/longitude pair. - # @!attribute [rw] radius_miles - # @return [::Float] - # Radius in miles of the job location. This value is derived from the - # location bounding box in which a circle with the specified radius - # centered from {::Google::Type::LatLng google.type.LatLng} covers the area - # associated with the job location. For example, currently, "Mountain View, - # CA, USA" has a radius of 6.17 miles. - class Location - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enum which represents the type of a location. - module LocationType - # Default value if the type isn't specified. - LOCATION_TYPE_UNSPECIFIED = 0 - - # A country level location. - COUNTRY = 1 - - # A state or equivalent level location. - ADMINISTRATIVE_AREA = 2 - - # A county or equivalent level location. - SUB_ADMINISTRATIVE_AREA = 3 - - # A city or equivalent level location. - LOCALITY = 4 - - # A postal code level location. - POSTAL_CODE = 5 - - # A sublocality is a subdivision of a locality, for example a city borough, - # ward, or arrondissement. Sublocalities are usually recognized by a local - # political authority. For example, Manhattan and Brooklyn are recognized - # as boroughs by the City of New York, and are therefore modeled as - # sublocalities. - SUB_LOCALITY = 6 - - # A district or equivalent level location. - SUB_LOCALITY_1 = 7 - - # A smaller district or equivalent level display. - SUB_LOCALITY_2 = 8 - - # A neighborhood level location. - NEIGHBORHOOD = 9 - - # A street address level location. - STREET_ADDRESS = 10 - end - end - - # Meta information related to the job searcher or entity - # conducting the job search. This information is used to improve the - # performance of the service. - # @!attribute [rw] domain - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # The client-defined scope or source of the service call, which typically - # is the domain on - # which the service has been implemented and is currently being run. - # - # For example, if the service is being run by client Foo, Inc., on - # job board www.foo.com and career site www.bar.com, then this field is - # set to "foo.com" for use on the job board, and "bar.com" for use on the - # career site. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique domain. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] session_id - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # A unique session identification string. A session is defined as the - # duration of an end user's interaction with the service over a certain - # period. - # Obfuscate this field for privacy concerns before - # providing it to the service. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique session ID. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] user_id - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # A unique user identification string, as determined by the client. - # To have the strongest positive impact on search quality - # make sure the client-level is unique. - # Obfuscate this field for privacy concerns before - # providing it to the service. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique user ID. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] allow_missing_ids - # @return [::Boolean] - # Only set when any of - # {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, - # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and - # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} isn't available - # for some reason. It is highly recommended not to set this field and provide - # accurate {::Google::Cloud::Talent::V4::RequestMetadata#domain domain}, - # {::Google::Cloud::Talent::V4::RequestMetadata#session_id session_id} and - # {::Google::Cloud::Talent::V4::RequestMetadata#user_id user_id} for the best - # service experience. - # @!attribute [rw] device_info - # @return [::Google::Cloud::Talent::V4::DeviceInfo] - # The type of device used by the job seeker at the time of the call to the - # service. - class RequestMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional information returned to client, such as debugging information. - # @!attribute [rw] request_id - # @return [::String] - # A unique id associated with this call. - # This id is logged for tracking purposes. - class ResponseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Device information collected from the job seeker, candidate, or - # other entity conducting the job search. Providing this information improves - # the quality of the search results across devices. - # @!attribute [rw] device_type - # @return [::Google::Cloud::Talent::V4::DeviceInfo::DeviceType] - # Type of the device. - # @!attribute [rw] id - # @return [::String] - # A device-specific ID. The ID must be a unique identifier that - # distinguishes the device from other devices. - class DeviceInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enumeration describing an API access portal and exposure mechanism. - module DeviceType - # The device type isn't specified. - DEVICE_TYPE_UNSPECIFIED = 0 - - # A desktop web browser, such as, Chrome, Firefox, Safari, or Internet - # Explorer) - WEB = 1 - - # A mobile device web browser, such as a phone or tablet with a Chrome - # browser. - MOBILE_WEB = 2 - - # An Android device native application. - ANDROID = 3 - - # An iOS device native application. - IOS = 4 - - # A bot, as opposed to a device operated by human beings, such as a web - # crawler. - BOT = 5 - - # Other devices types. - OTHER = 6 - end - end - - # Custom attribute values that are either filterable or non-filterable. - # @!attribute [rw] string_values - # @return [::Array<::String>] - # Exactly one of - # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or - # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be - # specified. - # - # This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or - # `CASE_INSENSITIVE_MATCH`) search. - # For filterable `string_value`s, a maximum total number of 200 values - # is allowed, with each `string_value` has a byte size of no more than - # 500B. For unfilterable `string_values`, the maximum total byte size of - # unfilterable `string_values` is 50KB. - # - # Empty string isn't allowed. - # @!attribute [rw] long_values - # @return [::Array<::Integer>] - # Exactly one of - # {::Google::Cloud::Talent::V4::CustomAttribute#string_values string_values} or - # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} must be - # specified. - # - # This field is used to perform number range search. - # (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. - # - # Currently at most 1 - # {::Google::Cloud::Talent::V4::CustomAttribute#long_values long_values} is - # supported. - # @!attribute [rw] filterable - # @return [::Boolean] - # If the `filterable` flag is true, the custom field values may be used for - # custom attribute filters - # {::Google::Cloud::Talent::V4::JobQuery#custom_attribute_filter JobQuery.custom_attribute_filter}. - # If false, these values may not be used for custom attribute filters. - # - # Default is false. - # @!attribute [rw] keyword_searchable - # @return [::Boolean] - # If the `keyword_searchable` flag is true, the keywords in custom fields are - # searchable by keyword match. - # If false, the values are not searchable by keyword match. - # - # Default is false. - class CustomAttribute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Spell check result. - # @!attribute [rw] corrected - # @return [::Boolean] - # Indicates if the query was corrected by the spell checker. - # @!attribute [rw] corrected_text - # @return [::String] - # Correction output consisting of the corrected keyword string. - # @!attribute [rw] corrected_html - # @return [::String] - # Corrected output with html tags to highlight the corrected words. - # Corrected words are called out with the "..." html tags. - # - # For example, the user input query is "software enginear", where the second - # word, "enginear," is incorrect. It should be "engineer". When spelling - # correction is enabled, this value is - # "software engineer". - class SpellingCorrection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Job compensation details. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry>] - # Job compensation information. - # - # At most one entry can be of type - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::BASE CompensationInfo.CompensationType.BASE}, - # which is referred as **base compensation entry** for the job. - # @!attribute [r] annualized_base_compensation_range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Output only. Annualized base compensation range. Computed as base - # compensation entry's - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # times - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} - # for explanation on compensation annualization. - # @!attribute [r] annualized_total_compensation_range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Output only. Annualized total compensation range. Computed as all - # compensation entries' - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # times - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationEntry} - # for explanation on compensation annualization. - class CompensationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A compensation entry that represents one component of compensation, such - # as base pay, bonus, or other compensation type. - # - # Annualization: One compensation entry can be annualized if - # - it contains valid - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}. - # - and its - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year} - # is set or can be derived. Its annualized range is determined as - # ({::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range range}) - # times - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year}. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationType] - # Compensation type. - # - # Default is - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationType::COMPENSATION_TYPE_UNSPECIFIED CompensationType.COMPENSATION_TYPE_UNSPECIFIED}. - # @!attribute [rw] unit - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit] - # Frequency of the specified amount. - # - # Default is - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED}. - # @!attribute [rw] amount - # @return [::Google::Type::Money] - # Compensation amount. - # - # Note: The following fields are mutually exclusive: `amount`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Compensation range. - # - # Note: The following fields are mutually exclusive: `range`, `amount`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] description - # @return [::String] - # Compensation description. For example, could - # indicate equity terms or provide additional context to an estimated - # bonus. - # @!attribute [rw] expected_units_per_year - # @return [::Google::Protobuf::DoubleValue] - # Expected number of units paid each year. If not specified, when - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types} is - # FULLTIME, a default value is inferred based on - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#unit unit}. - # Default values: - # - HOURLY: 2080 - # - DAILY: 260 - # - WEEKLY: 52 - # - MONTHLY: 12 - # - ANNUAL: 1 - class CompensationEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Compensation range. - # @!attribute [rw] max_compensation - # @return [::Google::Type::Money] - # The maximum amount of compensation. If left empty, the value is set - # to a maximal compensation value and the currency code is set to - # match the {::Google::Type::Money#currency_code currency code} of - # min_compensation. - # @!attribute [rw] min_compensation - # @return [::Google::Type::Money] - # The minimum amount of compensation. If left empty, the value is set - # to zero and the currency code is set to match the - # {::Google::Type::Money#currency_code currency code} of max_compensation. - class CompensationRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of compensation. - # - # For compensation amounts specified in non-monetary amounts, - # describe the compensation scheme in the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description}. - # - # For example, tipping format is described in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # (for example, "expect 15-20% tips based on customer bill.") and an estimate - # of the tips provided in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range} - # ($10 per hour). - # - # For example, equity is described in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and - # value estimated in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # or - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#range CompensationEntry.range}. - # If no value estimate is possible, units are - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED} - # and then further clarified in - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # field. - module CompensationType - # Default value. - COMPENSATION_TYPE_UNSPECIFIED = 0 - - # Base compensation: Refers to the fixed amount of money paid to an - # employee by an employer in return for work performed. Base compensation - # does not include benefits, bonuses or any other potential compensation - # from an employer. - BASE = 1 - - # Bonus. - BONUS = 2 - - # Signing bonus. - SIGNING_BONUS = 3 - - # Equity. - EQUITY = 4 - - # Profit sharing. - PROFIT_SHARING = 5 - - # Commission. - COMMISSIONS = 6 - - # Tips. - TIPS = 7 - - # Other compensation type. - OTHER_COMPENSATION_TYPE = 8 - end - - # Pay frequency. - module CompensationUnit - # Default value. - COMPENSATION_UNIT_UNSPECIFIED = 0 - - # Hourly. - HOURLY = 1 - - # Daily. - DAILY = 2 - - # Weekly - WEEKLY = 3 - - # Monthly. - MONTHLY = 4 - - # Yearly. - YEARLY = 5 - - # One time. - ONE_TIME = 6 - - # Other compensation units. - OTHER_COMPENSATION_UNIT = 7 - end - end - - # Metadata used for long running operations returned by CTS batch APIs. - # It's used to replace - # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}. - # @!attribute [rw] state - # @return [::Google::Cloud::Talent::V4::BatchOperationMetadata::State] - # The state of a long running operation. - # @!attribute [rw] state_description - # @return [::String] - # More detailed information about operation state. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of successful item(s) inside an operation. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of failed item(s) inside an operation. - # @!attribute [rw] total_count - # @return [::Integer] - # Count of total item(s) inside an operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation is created. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation status is updated. The metadata and the - # {::Google::Cloud::Talent::V4::BatchOperationMetadata#update_time update_time} is - # refreshed every minute otherwise cached data is returned. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to `true`. - class BatchOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - module State - # Default value. - STATE_UNSPECIFIED = 0 - - # The batch operation is being prepared for processing. - INITIALIZING = 1 - - # The batch operation is actively being processed. - PROCESSING = 2 - - # The batch operation is processed, and at least one item has been - # successfully processed. - SUCCEEDED = 3 - - # The batch operation is done and no item has been successfully processed. - FAILED = 4 - - # The batch operation is in the process of cancelling after - # google.longrunning.Operations.CancelOperation - # is called. - CANCELLING = 5 - - # The batch operation is done after - # google.longrunning.Operations.CancelOperation - # is called. Any items processed before cancelling are returned in the - # response. - CANCELLED = 6 - end - end - - # An enum that represents the size of the company. - module CompanySize - # Default value if the size isn't specified. - COMPANY_SIZE_UNSPECIFIED = 0 - - # The company has less than 50 employees. - MINI = 1 - - # The company has between 50 and 99 employees. - SMALL = 2 - - # The company has between 100 and 499 employees. - SMEDIUM = 3 - - # The company has between 500 and 999 employees. - MEDIUM = 4 - - # The company has between 1,000 and 4,999 employees. - BIG = 5 - - # The company has between 5,000 and 9,999 employees. - BIGGER = 6 - - # The company has 10,000 or more employees. - GIANT = 7 - end - - # An enum that represents employee benefits included with the job. - module JobBenefit - # Default value if the type isn't specified. - JOB_BENEFIT_UNSPECIFIED = 0 - - # The job includes access to programs that support child care, such - # as daycare. - CHILD_CARE = 1 - - # The job includes dental services covered by a dental - # insurance plan. - DENTAL = 2 - - # The job offers specific benefits to domestic partners. - DOMESTIC_PARTNER = 3 - - # The job allows for a flexible work schedule. - FLEXIBLE_HOURS = 4 - - # The job includes health services covered by a medical insurance plan. - MEDICAL = 5 - - # The job includes a life insurance plan provided by the employer or - # available for purchase by the employee. - LIFE_INSURANCE = 6 - - # The job allows for a leave of absence to a parent to care for a newborn - # child. - PARENTAL_LEAVE = 7 - - # The job includes a workplace retirement plan provided by the - # employer or available for purchase by the employee. - RETIREMENT_PLAN = 8 - - # The job allows for paid time off due to illness. - SICK_DAYS = 9 - - # The job includes paid time off for vacation. - VACATION = 10 - - # The job includes vision services covered by a vision - # insurance plan. - VISION = 11 - end - - # Educational degree level defined in International Standard Classification - # of Education (ISCED). - module DegreeType - # Default value. Represents no degree, or early childhood education. - # Maps to ISCED code 0. - # Ex) Kindergarten - DEGREE_TYPE_UNSPECIFIED = 0 - - # Primary education which is typically the first stage of compulsory - # education. ISCED code 1. - # Ex) Elementary school - PRIMARY_EDUCATION = 1 - - # Lower secondary education; First stage of secondary education building on - # primary education, typically with a more subject-oriented curriculum. - # ISCED code 2. - # Ex) Middle school - LOWER_SECONDARY_EDUCATION = 2 - - # Middle education; Second/final stage of secondary education preparing for - # tertiary education and/or providing skills relevant to employment. - # Usually with an increased range of subject options and streams. ISCED - # code 3. - # Ex) High school - UPPER_SECONDARY_EDUCATION = 3 - - # Adult Remedial Education; Programmes providing learning experiences that - # build on secondary education and prepare for labour market entry and/or - # tertiary education. The content is broader than secondary but not as - # complex as tertiary education. ISCED code 4. - ADULT_REMEDIAL_EDUCATION = 4 - - # Associate's or equivalent; Short first tertiary programmes that are - # typically practically-based, occupationally-specific and prepare for - # labour market entry. These programmes may also provide a pathway to other - # tertiary programmes. ISCED code 5. - ASSOCIATES_OR_EQUIVALENT = 5 - - # Bachelor's or equivalent; Programmes designed to provide intermediate - # academic and/or professional knowledge, skills and competencies leading - # to a first tertiary degree or equivalent qualification. ISCED code 6. - BACHELORS_OR_EQUIVALENT = 6 - - # Master's or equivalent; Programmes designed to provide advanced academic - # and/or professional knowledge, skills and competencies leading to a - # second tertiary degree or equivalent qualification. ISCED code 7. - MASTERS_OR_EQUIVALENT = 7 - - # Doctoral or equivalent; Programmes designed primarily to lead to an - # advanced research qualification, usually concluding with the submission - # and defense of a substantive dissertation of publishable quality based on - # original research. ISCED code 8. - DOCTORAL_OR_EQUIVALENT = 8 - end - - # An enum that represents the employment type of a job. - module EmploymentType - # The default value if the employment type isn't specified. - EMPLOYMENT_TYPE_UNSPECIFIED = 0 - - # The job requires working a number of hours that constitute full - # time employment, typically 40 or more hours per week. - FULL_TIME = 1 - - # The job entails working fewer hours than a full time job, - # typically less than 40 hours a week. - PART_TIME = 2 - - # The job is offered as a contracted, as opposed to a salaried employee, - # position. - CONTRACTOR = 3 - - # The job is offered as a contracted position with the understanding - # that it's converted into a full-time position at the end of the - # contract. Jobs of this type are also returned by a search for - # {::Google::Cloud::Talent::V4::EmploymentType::CONTRACTOR EmploymentType.CONTRACTOR} - # jobs. - CONTRACT_TO_HIRE = 4 - - # The job is offered as a temporary employment opportunity, usually - # a short-term engagement. - TEMPORARY = 5 - - # The job is a fixed-term opportunity for students or entry-level job - # seekers to obtain on-the-job training, typically offered as a summer - # position. - INTERN = 6 - - # The is an opportunity for an individual to volunteer, where there's no - # expectation of compensation for the provided services. - VOLUNTEER = 7 - - # The job requires an employee to work on an as-needed basis with a - # flexible schedule. - PER_DIEM = 8 - - # The job involves employing people in remote areas and flying them - # temporarily to the work site instead of relocating employees and their - # families permanently. - FLY_IN_FLY_OUT = 9 - - # The job does not fit any of the other listed types. - OTHER_EMPLOYMENT_TYPE = 10 - end - - # An enum that represents the required experience level required for the job. - module JobLevel - # The default value if the level isn't specified. - JOB_LEVEL_UNSPECIFIED = 0 - - # Entry-level individual contributors, typically with less than 2 years of - # experience in a similar role. Includes interns. - ENTRY_LEVEL = 1 - - # Experienced individual contributors, typically with 2+ years of - # experience in a similar role. - EXPERIENCED = 2 - - # Entry- to mid-level managers responsible for managing a team of people. - MANAGER = 3 - - # Senior-level managers responsible for managing teams of managers. - DIRECTOR = 4 - - # Executive-level managers and above, including C-level positions. - EXECUTIVE = 5 - end - - # An enum that represents the categorization or primary focus of specific - # role. This value is different than the "industry" associated with a role, - # which is related to the categorization of the company listing the job. - module JobCategory - # The default value if the category isn't specified. - JOB_CATEGORY_UNSPECIFIED = 0 - - # An accounting and finance job, such as an Accountant. - ACCOUNTING_AND_FINANCE = 1 - - # An administrative and office job, such as an Administrative Assistant. - ADMINISTRATIVE_AND_OFFICE = 2 - - # An advertising and marketing job, such as Marketing Manager. - ADVERTISING_AND_MARKETING = 3 - - # An animal care job, such as Veterinarian. - ANIMAL_CARE = 4 - - # An art, fashion, or design job, such as Designer. - ART_FASHION_AND_DESIGN = 5 - - # A business operations job, such as Business Operations Manager. - BUSINESS_OPERATIONS = 6 - - # A cleaning and facilities job, such as Custodial Staff. - CLEANING_AND_FACILITIES = 7 - - # A computer and IT job, such as Systems Administrator. - COMPUTER_AND_IT = 8 - - # A construction job, such as General Laborer. - CONSTRUCTION = 9 - - # A customer service job, such s Cashier. - CUSTOMER_SERVICE = 10 - - # An education job, such as School Teacher. - EDUCATION = 11 - - # An entertainment and travel job, such as Flight Attendant. - ENTERTAINMENT_AND_TRAVEL = 12 - - # A farming or outdoor job, such as Park Ranger. - FARMING_AND_OUTDOORS = 13 - - # A healthcare job, such as Registered Nurse. - HEALTHCARE = 14 - - # A human resources job, such as Human Resources Director. - HUMAN_RESOURCES = 15 - - # An installation, maintenance, or repair job, such as Electrician. - INSTALLATION_MAINTENANCE_AND_REPAIR = 16 - - # A legal job, such as Law Clerk. - LEGAL = 17 - - # A management job, often used in conjunction with another category, - # such as Store Manager. - MANAGEMENT = 18 - - # A manufacturing or warehouse job, such as Assembly Technician. - MANUFACTURING_AND_WAREHOUSE = 19 - - # A media, communications, or writing job, such as Media Relations. - MEDIA_COMMUNICATIONS_AND_WRITING = 20 - - # An oil, gas or mining job, such as Offshore Driller. - OIL_GAS_AND_MINING = 21 - - # A personal care and services job, such as Hair Stylist. - PERSONAL_CARE_AND_SERVICES = 22 - - # A protective services job, such as Security Guard. - PROTECTIVE_SERVICES = 23 - - # A real estate job, such as Buyer's Agent. - REAL_ESTATE = 24 - - # A restaurant and hospitality job, such as Restaurant Server. - RESTAURANT_AND_HOSPITALITY = 25 - - # A sales and/or retail job, such Sales Associate. - SALES_AND_RETAIL = 26 - - # A science and engineering job, such as Lab Technician. - SCIENCE_AND_ENGINEERING = 27 - - # A social services or non-profit job, such as Case Worker. - SOCIAL_SERVICES_AND_NON_PROFIT = 28 - - # A sports, fitness, or recreation job, such as Personal Trainer. - SPORTS_FITNESS_AND_RECREATION = 29 - - # A transportation or logistics job, such as Truck Driver. - TRANSPORTATION_AND_LOGISTICS = 30 - end - - # An enum that represents the job posting region. In most cases, job postings - # don't need to specify a region. If a region is given, jobs are - # eligible for searches in the specified region. - module PostingRegion - # If the region is unspecified, the job is only returned if it - # matches the {::Google::Cloud::Talent::V4::LocationFilter LocationFilter}. - POSTING_REGION_UNSPECIFIED = 0 - - # In addition to exact location matching, job posting is returned when the - # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in the search query - # is in the same administrative area as the returned job posting. For - # example, if a `ADMINISTRATIVE_AREA` job is posted in "CA, USA", it's - # returned if {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has - # "Mountain View". - # - # Administrative area refers to top-level administrative subdivision of this - # country. For example, US state, IT region, UK constituent nation and - # JP prefecture. - ADMINISTRATIVE_AREA = 1 - - # In addition to exact location matching, job is returned when - # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in search query is - # in the same country as this job. For example, if a `NATION_WIDE` job is - # posted in "USA", it's returned if - # {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} has 'Mountain - # View'. - NATION = 2 - - # Job allows employees to work remotely (telecommute). - # If locations are provided with this value, the job is - # considered as having a location, but telecommuting is allowed. - TELECOMMUTE = 3 - end - - # Deprecated. All resources are only visible to the owner. - # - # An enum that represents who has view access to the resource. - # @deprecated This enum is deprecated and may be removed in the next major version update. - module Visibility - # Default value. - VISIBILITY_UNSPECIFIED = 0 - - # The resource is only visible to the GCP account who owns it. - ACCOUNT_ONLY = 1 - - # The resource is visible to the owner and may be visible to other - # applications and processes at Google. - SHARED_WITH_GOOGLE = 2 - - # The resource is visible to the owner and may be visible to all other API - # clients. - SHARED_WITH_PUBLIC = 3 - end - - # Option for HTML content sanitization on user input fields, for example, job - # description. By setting this option, user can determine whether and how - # sanitization is performed on these fields. - module HtmlSanitization - # Default value. - HTML_SANITIZATION_UNSPECIFIED = 0 - - # Disables sanitization on HTML input. - HTML_SANITIZATION_DISABLED = 1 - - # Sanitizes HTML input, only accepts bold, italic, ordered list, and - # unordered list markup tags. - SIMPLE_FORMATTING_ONLY = 2 - end - - # Method for commute. Walking, biking and wheelchair accessible transit is - # still in the Preview stage. - module CommuteMethod - # Commute method isn't specified. - COMMUTE_METHOD_UNSPECIFIED = 0 - - # Commute time is calculated based on driving time. - DRIVING = 1 - - # Commute time is calculated based on public transit including bus, metro, - # subway, and so on. - TRANSIT = 2 - - # Commute time is calculated based on walking time. - WALKING = 3 - - # Commute time is calculated based on biking time. - CYCLING = 4 - - # Commute time is calculated based on public transit that is wheelchair - # accessible. - TRANSIT_ACCESSIBLE = 5 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb deleted file mode 100644 index 26cd543627a2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # A Company resource represents a company in the service. A company is the - # entity that owns job postings, that is, the hiring entity responsible for - # employing applicants for the job position. - # @!attribute [rw] name - # @return [::String] - # Required during company update. - # - # The resource name for a company. This is generated by the service when a - # company is created. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the company, for example, "Google LLC". - # @!attribute [rw] external_id - # @return [::String] - # Required. Client side company identifier, used to uniquely identify the - # company. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] size - # @return [::Google::Cloud::Talent::V4::CompanySize] - # The employer's company size. - # @!attribute [rw] headquarters_address - # @return [::String] - # The street address of the company's main headquarters, which may be - # different from the job location. The service attempts - # to geolocate the provided address, and populates a more specific - # location wherever possible in - # {::Google::Cloud::Talent::V4::Company::DerivedInfo#headquarters_location DerivedInfo.headquarters_location}. - # @!attribute [rw] hiring_agency - # @return [::Boolean] - # Set to true if it is the hiring agency that post jobs for other - # employers. - # - # Defaults to false if not provided. - # @!attribute [rw] eeo_text - # @return [::String] - # Equal Employment Opportunity legal disclaimer text to be - # associated with all jobs, and typically to be displayed in all - # roles. - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] website_uri - # @return [::String] - # The URI representing the company's primary web site or home page, - # for example, "https://www.google.com". - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] career_site_uri - # @return [::String] - # The URI to employer's career site or careers page on the employer's web - # site, for example, "https://careers.google.com". - # @!attribute [rw] image_uri - # @return [::String] - # A URI that hosts the employer's company logo. - # @!attribute [rw] keyword_searchable_job_custom_attributes - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # This field is deprecated. Please set the searchability of the custom - # attribute in the - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} going - # forward. - # - # A list of keys of filterable - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}, - # whose corresponding `string_values` are used in keyword searches. Jobs with - # `string_values` under these specified field keys are returned if any - # of the values match the search keyword. Custom field values with - # parenthesis, brackets and special symbols are not searchable as-is, - # and those keyword queries must be surrounded by quotes. - # @!attribute [r] derived_info - # @return [::Google::Cloud::Talent::V4::Company::DerivedInfo] - # Output only. Derived details about the company. - # @!attribute [r] suspended - # @return [::Boolean] - # Output only. Indicates whether a company is flagged to be suspended from - # public availability by the service when job content appears suspicious, - # abusive, or spammy. - class Company - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Derived details about the company. - # @!attribute [rw] headquarters_location - # @return [::Google::Cloud::Talent::V4::Location] - # A structured headquarters location of the company, resolved from - # {::Google::Cloud::Talent::V4::Company#headquarters_address Company.headquarters_address} - # if provided. - class DerivedInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb deleted file mode 100644 index bc326d893eab..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company_service.rb +++ /dev/null @@ -1,133 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # The Request of the CreateCompany method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] company - # @return [::Google::Cloud::Talent::V4::Company] - # Required. The company to be created. - class CreateCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a company by name. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - class GetCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for updating a specified company. - # @!attribute [rw] company - # @return [::Google::Cloud::Talent::V4::Company] - # Required. The company resource to replace the current resource in the - # system. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Company Company} are - # supported. - class UpdateCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a company. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - class DeleteCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List companies for which the client has ACL visibility. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] page_token - # @return [::String] - # The starting indicator from which to return results. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @!attribute [rw] require_open_jobs - # @return [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - class ListCompaniesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The List companies response object. - # @!attribute [rw] companies - # @return [::Array<::Google::Cloud::Talent::V4::Company>] - # Companies for the current client. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListCompaniesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb deleted file mode 100644 index 0cad28742065..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/completion_service.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # Auto-complete parameters. - # @!attribute [rw] tenant - # @return [::String] - # Required. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] query - # @return [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] page_size - # @return [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @!attribute [rw] company - # @return [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # @!attribute [rw] scope - # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - class CompleteQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to specify the scope of completion. - module CompletionScope - # Default value. - COMPLETION_SCOPE_UNSPECIFIED = 0 - - # Suggestions are based only on the data provided by the client. - TENANT = 1 - - # Suggestions are based on all jobs data in the system that's visible to - # the client - PUBLIC = 2 - end - - # Enum to specify auto-completion topics. - module CompletionType - # Default value. - COMPLETION_TYPE_UNSPECIFIED = 0 - - # Suggest job titles for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::JOB_TITLE CompletionType.JOB_TITLE} - # type, only open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # are returned. - JOB_TITLE = 1 - - # Suggest company names for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME CompletionType.COMPANY_NAME} - # type, only companies having open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # are returned. - COMPANY_NAME = 2 - - # Suggest both job titles and company names for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED} - # type, only open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # or companies having open jobs with the same - # {::Google::Cloud::Talent::V4::CompleteQueryRequest#language_codes language_codes} - # are returned. - COMBINED = 3 - end - end - - # Response of auto-complete query. - # @!attribute [rw] completion_results - # @return [::Array<::Google::Cloud::Talent::V4::CompleteQueryResponse::CompletionResult>] - # Results of the matching job/company candidates. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class CompleteQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Resource that represents completion results. - # @!attribute [rw] suggestion - # @return [::String] - # The suggestion for the query. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType] - # The completion topic. - # @!attribute [rw] image_uri - # @return [::String] - # The URI of the company image for - # {::Google::Cloud::Talent::V4::CompleteQueryRequest::CompletionType::COMPANY_NAME COMPANY_NAME}. - class CompletionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb deleted file mode 100644 index aaead09d2855..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event.rb +++ /dev/null @@ -1,179 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # An event issued when an end user interacts with the application that - # implements Cloud Talent Solution. Providing this information improves the - # quality of results for the API clients, enabling the - # service to perform optimally. The number of events sent must be consistent - # with other calls, such as job searches, issued to the service by the client. - # @!attribute [rw] request_id - # @return [::String] - # Strongly recommended for the best service experience. - # - # A unique ID generated in the API responses. It can be found in - # {::Google::Cloud::Talent::V4::ResponseMetadata#request_id ResponseMetadata.request_id}. - # @!attribute [rw] event_id - # @return [::String] - # Required. A unique identifier, generated by the client application. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Required. The timestamp of the event. - # @!attribute [rw] job_event - # @return [::Google::Cloud::Talent::V4::JobEvent] - # An event issued when a job seeker interacts with the application that - # implements Cloud Talent Solution. - # @!attribute [rw] event_notes - # @return [::String] - # Notes about the event provided by recruiters or other users, for example, - # feedback on why a job was bookmarked. - class ClientEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event issued when a job seeker interacts with the application that - # implements Cloud Talent Solution. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::JobEvent::JobEventType] - # Required. The type of the event (see - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType JobEventType}). - # @!attribute [rw] jobs - # @return [::Array<::String>] - # Required. The [job name(s)][google.cloud.talent.v4.Job.name] associated - # with this event. For example, if this is an - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression} - # event, this field contains the identifiers of all jobs shown to the job - # seeker. If this was a - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW view} event, this field - # contains the identifier of the viewed job. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}", for - # example, "projects/foo/tenants/bar/jobs/baz". - class JobEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enumeration of an event attributed to the behavior of the end user, - # such as a job seeker. - module JobEventType - # The event is unspecified by other provided values. - JOB_EVENT_TYPE_UNSPECIFIED = 0 - - # The job seeker or other entity interacting with the service has - # had a job rendered in their view, such as in a list of search results in - # a compressed or clipped format. This event is typically associated with - # the viewing of a jobs list on a single page by a job seeker. - IMPRESSION = 1 - - # The job seeker, or other entity interacting with the service, has - # viewed the details of a job, including the full description. This - # event doesn't apply to the viewing a snippet of a job appearing as a - # part of the job search results. Viewing a snippet is associated with an - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::IMPRESSION impression}). - VIEW = 2 - - # The job seeker or other entity interacting with the service - # performed an action to view a job and was redirected to a different - # website for job. - VIEW_REDIRECT = 3 - - # The job seeker or other entity interacting with the service - # began the process or demonstrated the intention of applying for a job. - APPLICATION_START = 4 - - # The job seeker or other entity interacting with the service - # submitted an application for a job. - APPLICATION_FINISH = 5 - - # The job seeker or other entity interacting with the service - # submitted an application for a job with a single click without - # entering information. If a job seeker performs this action, send only - # this event to the service. Do not also send - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START} - # or - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} - # events. - APPLICATION_QUICK_SUBMISSION = 6 - - # The job seeker or other entity interacting with the service - # performed an action to apply to a job and was redirected to a different - # website to complete the application. - APPLICATION_REDIRECT = 7 - - # The job seeker or other entity interacting with the service began the - # process or demonstrated the intention of applying for a job from the - # search results page without viewing the details of the job posting. - # If sending this event, JobEventType.VIEW event shouldn't be sent. - APPLICATION_START_FROM_SEARCH = 8 - - # The job seeker, or other entity interacting with the service, performs an - # action with a single click from the search results page to apply to a job - # (without viewing the details of the job posting), and is redirected - # to a different website to complete the application. If a candidate - # performs this action, send only this event to the service. Do not also - # send - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START}, - # {::Google::Cloud::Talent::V4::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} - # or {::Google::Cloud::Talent::V4::JobEvent::JobEventType::VIEW JobEventType.VIEW} - # events. - APPLICATION_REDIRECT_FROM_SEARCH = 9 - - # This event should be used when a company submits an application - # on behalf of a job seeker. This event is intended for use by staffing - # agencies attempting to place candidates. - APPLICATION_COMPANY_SUBMIT = 10 - - # The job seeker or other entity interacting with the service demonstrated - # an interest in a job by bookmarking or saving it. - BOOKMARK = 11 - - # The job seeker or other entity interacting with the service was - # sent a notification, such as an email alert or device notification, - # containing one or more jobs listings generated by the service. - NOTIFICATION = 12 - - # The job seeker or other entity interacting with the service was - # employed by the hiring entity (employer). Send this event - # only if the job seeker was hired through an application that was - # initiated by a search conducted through the Cloud Talent Solution - # service. - HIRED = 13 - - # A recruiter or staffing agency submitted an application on behalf of the - # candidate after interacting with the service to identify a suitable job - # posting. - SENT_CV = 14 - - # The entity interacting with the service (for example, the job seeker), - # was granted an initial interview by the hiring entity (employer). This - # event should only be sent if the job seeker was granted an interview as - # part of an application that was initiated by a search conducted through / - # recommendation provided by the Cloud Talent Solution service. - INTERVIEW_GRANTED = 15 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb deleted file mode 100644 index 284850e682bb..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/event_service.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # The report event request. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] client_event - # @return [::Google::Cloud::Talent::V4::ClientEvent] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - class CreateClientEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb deleted file mode 100644 index 65be9377eb17..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/filters.rb +++ /dev/null @@ -1,392 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # The query required to perform a search query. - # @!attribute [rw] query - # @return [::String] - # The query string that matches against the job title, description, and - # location fields. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] query_language_code - # @return [::String] - # The language code of {::Google::Cloud::Talent::V4::JobQuery#query query}. For - # example, "en-US". This field helps to better interpret the query. - # - # If a value isn't specified, the query language code is automatically - # detected, which may not be accurate. - # - # Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # @!attribute [rw] companies - # @return [::Array<::String>] - # This filter specifies the company entities to search against. - # - # If a value isn't specified, jobs are searched for against all - # companies. - # - # If multiple values are specified, jobs are searched against the - # companies specified. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For - # example, "projects/foo/tenants/bar/companies/baz". - # - # At most 20 company filters are allowed. - # @!attribute [rw] location_filters - # @return [::Array<::Google::Cloud::Talent::V4::LocationFilter>] - # The location filter specifies geo-regions containing the jobs to - # search against. See {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} - # for more information. - # - # If a location value isn't specified, jobs fitting the other search - # criteria are retrieved regardless of where they're located. - # - # If multiple values are specified, jobs are retrieved from any of the - # specified locations. If different values are specified for the - # {::Google::Cloud::Talent::V4::LocationFilter#distance_in_miles LocationFilter.distance_in_miles} - # parameter, the maximum provided distance is used for all locations. - # - # At most 5 location filters are allowed. - # @!attribute [rw] job_categories - # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] - # The category filter specifies the categories of jobs to search against. - # See {::Google::Cloud::Talent::V4::JobCategory JobCategory} for more information. - # - # If a value isn't specified, jobs from any category are searched against. - # - # If multiple values are specified, jobs from any of the specified - # categories are searched against. - # @!attribute [rw] commute_filter - # @return [::Google::Cloud::Talent::V4::CommuteFilter] - # Allows filtering jobs by commute time with different travel methods (for - # example, driving or public transit). - # - # Note: This only works when you specify a - # {::Google::Cloud::Talent::V4::CommuteMethod CommuteMethod}. In this case, - # {::Google::Cloud::Talent::V4::JobQuery#location_filters location_filters} is - # ignored. - # - # Currently we don't support sorting by commute time. - # @!attribute [rw] company_display_names - # @return [::Array<::String>] - # This filter specifies the company - # {::Google::Cloud::Talent::V4::Company#display_name Company.display_name} of the - # jobs to search against. The company name must match the value exactly. - # - # Alternatively, the value being searched for can be wrapped in different - # match operators. - # `SUBSTRING_MATCH([value])` - # The company name must contain a case insensitive substring match of the - # value. Using this function may increase latency. - # - # Sample Value: `SUBSTRING_MATCH(google)` - # - # `MULTI_WORD_TOKEN_MATCH([value])` - # The value will be treated as a multi word token and the company name must - # contain a case insensitive match of the value. Using this function may - # increase latency. - # - # Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` - # - # If a value isn't specified, jobs within the search results are - # associated with any company. - # - # If multiple values are specified, jobs within the search results may be - # associated with any of the specified companies. - # - # At most 20 company display name filters are allowed. - # @!attribute [rw] compensation_filter - # @return [::Google::Cloud::Talent::V4::CompensationFilter] - # This search filter is applied only to - # {::Google::Cloud::Talent::V4::Job#compensation_info Job.compensation_info}. For - # example, if the filter is specified as "Hourly job with per-hour - # compensation > $15", only jobs meeting these criteria are searched. If a - # filter isn't defined, all open jobs are searched. - # @!attribute [rw] custom_attribute_filter - # @return [::String] - # This filter specifies a structured syntax to match against the - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} - # marked as `filterable`. - # - # The syntax for this expression is a subset of SQL syntax. - # - # Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the - # left of the operator is a custom field key and the right of the operator - # is a number or a quoted string. You must escape backslash (\\) and - # quote (\") characters. - # - # Supported functions are `LOWER([field_name])` to - # perform a case insensitive match and `EMPTY([field_name])` to filter on the - # existence of a key. - # - # Boolean expressions (AND/OR/NOT) are supported up to 3 levels of - # nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 - # comparisons or functions are allowed in the expression. The expression - # must be < 10000 bytes in length. - # - # Sample Query: - # `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND - # driving_years > 10` - # @!attribute [rw] disable_spell_check - # @return [::Boolean] - # This flag controls the spell-check feature. If false, the - # service attempts to correct a misspelled query, - # for example, "enginee" is corrected to "engineer". - # - # Defaults to false: a spell check is performed. - # @!attribute [rw] employment_types - # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] - # The employment type filter specifies the employment type of jobs to - # search against, such as - # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME EmploymentType.FULL_TIME}. - # - # If a value isn't specified, jobs in the search results includes any - # employment type. - # - # If multiple values are specified, jobs in the search results include - # any of the specified employment types. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # This filter specifies the locale of jobs to search against, - # for example, "en-US". - # - # If a value isn't specified, the search results can contain jobs in any - # locale. - # - # - # Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # At most 10 language code filters are allowed. - # @!attribute [rw] publish_time_range - # @return [::Google::Cloud::Talent::V4::TimestampRange] - # Jobs published within a range specified by this filter are searched - # against. - # @!attribute [rw] excluded_jobs - # @return [::Array<::String>] - # This filter specifies a list of job names to be excluded during search. - # - # At most 400 excluded job names are allowed. - class JobQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Geographic region of the search. - # @!attribute [rw] address - # @return [::String] - # The address name, such as "Mountain View" or "Bay Area". - # @!attribute [rw] region_code - # @return [::String] - # CLDR region code of the country/region. This field may be used in two ways: - # - # 1) If telecommute preference is not set, this field is used address - # ambiguity of the user-input address. For example, "Liverpool" may refer to - # "Liverpool, NY, US" or "Liverpool, UK". This region code biases the - # address resolution toward a specific country or territory. If this field is - # not set, address resolution is biased toward the United States by default. - # - # 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the - # telecommute location filter will be limited to the region specified in this - # field. If this field is not set, the telecommute job locations will not be - # - # See - # https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # The latitude and longitude of the geographic center to search from. This - # field is ignored if `address` is provided. - # @!attribute [rw] distance_in_miles - # @return [::Float] - # The distance_in_miles is applied when the location being searched for is - # identified as a city or smaller. This field is ignored if the location - # being searched for is a state or larger. - # @!attribute [rw] telecommute_preference - # @return [::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference] - # Allows the client to return jobs without a - # set location, specifically, telecommuting jobs (telecommuting is considered - # by the service as a special location). - # {::Google::Cloud::Talent::V4::Job#posting_region Job.posting_region} indicates - # if a job permits telecommuting. If this field is set to - # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_ALLOWED TelecommutePreference.TELECOMMUTE_ALLOWED}, - # telecommuting jobs are searched, and - # {::Google::Cloud::Talent::V4::LocationFilter#address address} and - # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng} are ignored. If - # not set or set to - # {::Google::Cloud::Talent::V4::LocationFilter::TelecommutePreference::TELECOMMUTE_EXCLUDED TelecommutePreference.TELECOMMUTE_EXCLUDED}, - # the telecommute status of the jobs is ignored. Jobs that have - # {::Google::Cloud::Talent::V4::PostingRegion::TELECOMMUTE PostingRegion.TELECOMMUTE} - # and have additional {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} - # may still be matched based on other location filters using - # {::Google::Cloud::Talent::V4::LocationFilter#address address} or - # {::Google::Cloud::Talent::V4::LocationFilter#lat_lng lat_lng}. - # - # This filter can be used by itself to search exclusively for telecommuting - # jobs, or it can be combined with another location - # filter to search for a combination of job locations, - # such as "Mountain View" or "telecommuting" jobs. However, when used in - # combination with other location filters, telecommuting jobs can be - # treated as less relevant than other jobs in the search response. - # - # This field is only used for job search requests. - class LocationFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specify whether to include telecommute jobs. - module TelecommutePreference - # Default value if the telecommute preference isn't specified. - TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 - - # Deprecated: Ignore telecommute status of jobs. Use - # TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. - TELECOMMUTE_EXCLUDED = 1 - - # Allow telecommute jobs. - TELECOMMUTE_ALLOWED = 2 - - # Exclude telecommute jobs. - TELECOMMUTE_JOBS_EXCLUDED = 3 - end - end - - # Filter on job compensation type and amount. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4::CompensationFilter::FilterType] - # Required. Type of filter. - # @!attribute [rw] units - # @return [::Array<::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit>] - # Required. Specify desired `base compensation entry's` - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange] - # Compensation range. - # @!attribute [rw] include_jobs_with_unspecified_compensation_range - # @return [::Boolean] - # If set to true, jobs with unspecified compensation range fields are - # included. - class CompensationFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specify the type of filtering. - module FilterType - # Filter type unspecified. Position holder, INVALID, should never be used. - FILTER_TYPE_UNSPECIFIED = 0 - - # Filter by `base compensation entry's` unit. A job is a match if and - # only if the job contains a base CompensationEntry and the base - # CompensationEntry's unit matches provided - # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. Populate one or - # more {::Google::Cloud::Talent::V4::CompensationFilter#units units}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} - # for definition of base compensation entry. - UNIT_ONLY = 1 - - # Filter by `base compensation entry's` unit and amount / range. A job - # is a match if and only if the job contains a base CompensationEntry, and - # the base entry's unit matches provided - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationUnit} - # and amount or range overlaps with provided - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationRange CompensationRange}. - # - # See - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} - # for definition of base compensation entry. - # - # Set exactly one {::Google::Cloud::Talent::V4::CompensationFilter#units units} - # and populate {::Google::Cloud::Talent::V4::CompensationFilter#range range}. - UNIT_AND_AMOUNT = 2 - - # Filter by annualized base compensation amount and `base compensation - # entry's` unit. Populate - # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more - # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. - ANNUALIZED_BASE_AMOUNT = 3 - - # Filter by annualized total compensation amount and `base compensation - # entry's` unit . Populate - # {::Google::Cloud::Talent::V4::CompensationFilter#range range} and zero or more - # {::Google::Cloud::Talent::V4::CompensationFilter#units units}. - ANNUALIZED_TOTAL_AMOUNT = 4 - end - end - - # Parameters needed for commute search. - # @!attribute [rw] commute_method - # @return [::Google::Cloud::Talent::V4::CommuteMethod] - # Required. The method of transportation to calculate the commute time for. - # @!attribute [rw] start_coordinates - # @return [::Google::Type::LatLng] - # Required. The latitude and longitude of the location to calculate the - # commute time from. - # @!attribute [rw] travel_duration - # @return [::Google::Protobuf::Duration] - # Required. The maximum travel time in seconds. The maximum allowed value is - # `3600s` (one hour). Format is `123s`. - # @!attribute [rw] allow_imprecise_addresses - # @return [::Boolean] - # If `true`, jobs without street level addresses may also be returned. - # For city level addresses, the city center is used. For state and coarser - # level addresses, text matching is used. - # If this field is set to `false` or isn't specified, only jobs that include - # street level addresses will be returned by commute search. - # @!attribute [rw] road_traffic - # @return [::Google::Cloud::Talent::V4::CommuteFilter::RoadTraffic] - # Specifies the traffic density to use when calculating commute time. - # - # Note: The following fields are mutually exclusive: `road_traffic`, `departure_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] departure_time - # @return [::Google::Type::TimeOfDay] - # The departure time used to calculate traffic impact, represented as - # {::Google::Type::TimeOfDay google.type.TimeOfDay} in local time zone. - # - # Currently traffic model is restricted to hour level resolution. - # - # Note: The following fields are mutually exclusive: `departure_time`, `road_traffic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class CommuteFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The traffic density to use when calculating commute time. - module RoadTraffic - # Road traffic situation isn't specified. - ROAD_TRAFFIC_UNSPECIFIED = 0 - - # Optimal commute time without considering any traffic impact. - TRAFFIC_FREE = 1 - - # Commute time calculation takes in account the peak traffic impact. - BUSY_HOUR = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb deleted file mode 100644 index 486c5466ca9e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/histogram.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # The histogram request. - # @!attribute [rw] histogram_query - # @return [::String] - # An expression specifies a histogram request against matching jobs for - # searches. - # - # See - # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries} - # for details about syntax. - class HistogramQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Histogram result that matches - # {::Google::Cloud::Talent::V4::HistogramQuery HistogramQuery} specified in - # searches. - # @!attribute [rw] histogram_query - # @return [::String] - # Requested histogram expression. - # @!attribute [rw] histogram - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # A map from the values of the facet associated with distinct values to the - # number of matching entries with corresponding value. - # - # The key format is: - # - # * (for string histogram) string values stored in the field. - # * (for named numeric bucket) name specified in `bucket()` function, like - # for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. - # * (for anonymous numeric bucket) range formatted as `-`, for - # example, `0-1000`, `MIN-0`, and `0-MAX`. - class HistogramQueryResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class HistogramEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb deleted file mode 100644 index bf21f608f3bf..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job.rb +++ /dev/null @@ -1,392 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # A Job resource represents a job posting (also referred to as a "job listing" - # or "job requisition"). A job belongs to a - # {::Google::Cloud::Talent::V4::Company Company}, which is the hiring entity - # responsible for the job. - # @!attribute [rw] name - # @return [::String] - # Required during job update. - # - # The resource name for the job. This is generated by the service when a - # job is created. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # Use of this field in job queries and API calls is preferred over the use of - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} since this - # value is unique. - # @!attribute [rw] company - # @return [::String] - # Required. The resource name of the company listing the job. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For - # example, "projects/foo/tenants/bar/companies/baz". - # @!attribute [rw] requisition_id - # @return [::String] - # Required. The requisition ID, also referred to as the posting ID, is - # assigned by the client to identify a job. This field is intended to be used - # by clients for client identification and tracking of postings. A job isn't - # allowed to be created if there is another job with the same - # {::Google::Cloud::Talent::V4::Job#name company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] title - # @return [::String] - # Required. The title of the job, such as "Software Engineer" - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] description - # @return [::String] - # Required. The description of the job, which typically includes a - # multi-paragraph description of the company and related information. - # Separate fields are provided on the job object for - # {::Google::Cloud::Talent::V4::Job#responsibilities responsibilities}, - # {::Google::Cloud::Talent::V4::Job#qualifications qualifications}, and other job - # characteristics. Use of these separate job fields is recommended. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 100,000. - # @!attribute [rw] addresses - # @return [::Array<::String>] - # Strongly recommended for the best service experience. - # - # Location(s) where the employer is looking to hire for this job posting. - # - # Specifying the full street address(es) of the hiring location enables - # better API results, especially job searches by commute time. - # - # At most 50 locations are allowed for best search performance. If a job has - # more locations, it is suggested to split it into multiple jobs with unique - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}s (e.g. 'ReqA' - # becomes 'ReqA-1', 'ReqA-2', and so on.) as multiple jobs with the same - # {::Google::Cloud::Talent::V4::Job#company company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} are not - # allowed. If the original - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id} must be - # preserved, a custom field should be used for storage. It is also suggested - # to group the locations that close to each other in the same job for better - # search experience. - # - # Jobs with multiple addresses must have their addresses with the same - # {::Google::Cloud::Talent::V4::Location::LocationType LocationType} to allow - # location filtering to work properly. (For example, a Job with addresses - # "1600 Amphitheatre Parkway, Mountain View, CA, USA" and "London, UK" may - # not have location filters applied correctly at search time since the first - # is a - # {::Google::Cloud::Talent::V4::Location::LocationType::STREET_ADDRESS LocationType.STREET_ADDRESS} - # and the second is a - # {::Google::Cloud::Talent::V4::Location::LocationType::LOCALITY LocationType.LOCALITY}.) - # If a job needs to have multiple addresses, it is suggested to split it into - # multiple jobs with same LocationTypes. - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] application_info - # @return [::Google::Cloud::Talent::V4::Job::ApplicationInfo] - # Job application information. - # @!attribute [rw] job_benefits - # @return [::Array<::Google::Cloud::Talent::V4::JobBenefit>] - # The benefits included with the job. - # @!attribute [rw] compensation_info - # @return [::Google::Cloud::Talent::V4::CompensationInfo] - # Job compensation information (a.k.a. "pay rate") i.e., the compensation - # that will paid to the employee. - # @!attribute [rw] custom_attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Talent::V4::CustomAttribute}] - # A map of fields to hold both filterable and non-filterable custom job - # attributes that are not covered by the provided structured fields. - # - # The keys of the map are strings up to 64 bytes and must match the - # pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or - # KEY_1_LIKE_THIS. - # - # At most 100 filterable and at most 100 unfilterable keys are supported. - # For filterable `string_values`, across all keys at most 200 values are - # allowed, with each string no more than 255 characters. For unfilterable - # `string_values`, the maximum total size of `string_values` across all keys - # is 50KB. - # @!attribute [rw] degree_types - # @return [::Array<::Google::Cloud::Talent::V4::DegreeType>] - # The desired education degrees for the job, such as Bachelors, Masters. - # @!attribute [rw] department - # @return [::String] - # The department or functional area within the company with the open - # position. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] employment_types - # @return [::Array<::Google::Cloud::Talent::V4::EmploymentType>] - # The employment type(s) of a job, for example, - # {::Google::Cloud::Talent::V4::EmploymentType::FULL_TIME full time} or - # {::Google::Cloud::Talent::V4::EmploymentType::PART_TIME part time}. - # @!attribute [rw] incentives - # @return [::String] - # A description of bonus, commission, and other compensation - # incentives associated with the job not including salary or pay. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] language_code - # @return [::String] - # The language of the posting. This field is distinct from - # any requirements for fluency that are associated with the job. - # - # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: - # class="external" target="_blank" }. - # - # If this field is unspecified and - # {::Google::Cloud::Talent::V4::Job#description Job.description} is present, - # detected language code based on - # {::Google::Cloud::Talent::V4::Job#description Job.description} is assigned, - # otherwise defaults to 'en_US'. - # @!attribute [rw] job_level - # @return [::Google::Cloud::Talent::V4::JobLevel] - # The experience level associated with the job, such as "Entry Level". - # @!attribute [rw] promotion_value - # @return [::Integer] - # A promotion value of the job, as determined by the client. - # The value determines the sort order of the jobs returned when searching for - # jobs using the featured jobs search call, with higher promotional values - # being returned first and ties being resolved by relevance sort. Only the - # jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. - # - # Default value is 0, and negative values are treated as 0. - # @!attribute [rw] qualifications - # @return [::String] - # A description of the qualifications required to perform the - # job. The use of this field is recommended - # as an alternative to using the more general - # {::Google::Cloud::Talent::V4::Job#description description} field. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] responsibilities - # @return [::String] - # A description of job responsibilities. The use of this field is - # recommended as an alternative to using the more general - # {::Google::Cloud::Talent::V4::Job#description description} field. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] posting_region - # @return [::Google::Cloud::Talent::V4::PostingRegion] - # The job {::Google::Cloud::Talent::V4::PostingRegion PostingRegion} (for example, - # state, country) throughout which the job is available. If this field is - # set, a {::Google::Cloud::Talent::V4::LocationFilter LocationFilter} in a search - # query within the job region finds this job posting if an exact location - # match isn't specified. If this field is set to - # {::Google::Cloud::Talent::V4::PostingRegion::NATION PostingRegion.NATION} or - # {::Google::Cloud::Talent::V4::PostingRegion::ADMINISTRATIVE_AREA PostingRegion.ADMINISTRATIVE_AREA}, - # setting job {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} to the - # same location level as this field is strongly recommended. - # @!attribute [rw] visibility - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Talent::V4::Visibility] - # Deprecated. The job is only visible to the owner. - # - # The visibility of the job. - # - # Defaults to - # {::Google::Cloud::Talent::V4::Visibility::ACCOUNT_ONLY Visibility.ACCOUNT_ONLY} - # if not specified. - # @!attribute [rw] job_start_time - # @return [::Google::Protobuf::Timestamp] - # The start timestamp of the job in UTC time zone. Typically this field - # is used for contracting engagements. Invalid timestamps are ignored. - # @!attribute [rw] job_end_time - # @return [::Google::Protobuf::Timestamp] - # The end timestamp of the job. Typically this field is used for contracting - # engagements. Invalid timestamps are ignored. - # @!attribute [rw] posting_publish_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp this job posting was most recently published. The default - # value is the time the request arrives at the server. Invalid timestamps are - # ignored. - # @!attribute [rw] posting_expire_time - # @return [::Google::Protobuf::Timestamp] - # Strongly recommended for the best service experience. - # - # The expiration timestamp of the job. After this timestamp, the - # job is marked as expired, and it no longer appears in search results. The - # expired job can't be listed by the - # {::Google::Cloud::Talent::V4::JobService::Client#list_jobs ListJobs} API, but it can be - # retrieved with the {::Google::Cloud::Talent::V4::JobService::Client#get_job GetJob} API - # or updated with the - # {::Google::Cloud::Talent::V4::JobService::Client#update_job UpdateJob} API or deleted - # with the {::Google::Cloud::Talent::V4::JobService::Client#delete_job DeleteJob} API. An - # expired job can be updated and opened again by using a future expiration - # timestamp. Updating an expired job fails if there is another existing open - # job with same {::Google::Cloud::Talent::V4::Job#company company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}. - # - # The expired jobs are retained in our system for 90 days. However, the - # overall expired job count cannot exceed 3 times the maximum number of - # open jobs over previous 7 days. If this threshold is exceeded, - # expired jobs are cleaned out in order of earliest expire time. - # Expired jobs are no longer accessible after they are cleaned - # out. - # - # Invalid timestamps are ignored, and treated as expire time not provided. - # - # If the timestamp is before the instant request is made, the job - # is treated as expired immediately on creation. This kind of job can - # not be updated. And when creating a job with past timestamp, the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time posting_publish_time} - # must be set before - # {::Google::Cloud::Talent::V4::Job#posting_expire_time posting_expire_time}. The - # purpose of this feature is to allow other objects, such as - # {::Google::Cloud::Talent::V4::Job::ApplicationInfo ApplicationInfo}, to refer a - # job that didn't exist in the system prior to becoming expired. If you want - # to modify a job that was expired on creation, delete it and create a new - # one. - # - # If this value isn't provided at the time of job creation or is invalid, - # the job posting expires after 30 days from the job's creation time. For - # example, if the job was created on 2017/01/01 13:00AM UTC with an - # unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. - # - # If this value isn't provided on job update, it depends on the field masks - # set by - # {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask UpdateJobRequest.update_mask}. - # If the field masks include - # {::Google::Cloud::Talent::V4::Job#job_end_time job_end_time}, or the masks are - # empty meaning that every field is updated, the job posting expires after 30 - # days from the job's last update time. Otherwise the expiration date isn't - # updated. - # @!attribute [r] posting_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this job posting was created. - # @!attribute [r] posting_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this job posting was last updated. - # @!attribute [r] company_display_name - # @return [::String] - # Output only. Display name of the company listing the job. - # @!attribute [r] derived_info - # @return [::Google::Cloud::Talent::V4::Job::DerivedInfo] - # Output only. Derived details about the job posting. - # @!attribute [rw] processing_options - # @return [::Google::Cloud::Talent::V4::Job::ProcessingOptions] - # Options for job processing. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Application related details of a job posting. - # @!attribute [rw] emails - # @return [::Array<::String>] - # Use this field to specify email address(es) to which resumes or - # applications can be sent. - # - # The maximum number of allowed characters for each entry is 255. - # @!attribute [rw] instruction - # @return [::String] - # Use this field to provide instructions, such as "Mail your application - # to ...", that a candidate can follow to apply for the job. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 3,000. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Use this URI field to direct an applicant to a website, for example to - # link to an online application form. - # - # The maximum number of allowed characters for each entry is 2,000. - class ApplicationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Derived details about the job posting. - # @!attribute [rw] locations - # @return [::Array<::Google::Cloud::Talent::V4::Location>] - # Structured locations of the job, resolved from - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}. - # - # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations locations} are exactly - # matched to {::Google::Cloud::Talent::V4::Job#addresses Job.addresses} in the - # same order. - # @!attribute [rw] job_categories - # @return [::Array<::Google::Cloud::Talent::V4::JobCategory>] - # Job categories derived from {::Google::Cloud::Talent::V4::Job#title Job.title} - # and {::Google::Cloud::Talent::V4::Job#description Job.description}. - class DerivedInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for job processing. - # @!attribute [rw] disable_street_address_resolution - # @return [::Boolean] - # If set to `true`, the service does not attempt to resolve a - # more precise address for the job. - # @!attribute [rw] html_sanitization - # @return [::Google::Cloud::Talent::V4::HtmlSanitization] - # Option for job HTML content sanitization. Applied fields are: - # - # * description - # * applicationInfo.instruction - # * incentives - # * qualifications - # * responsibilities - # - # HTML tags in these fields may be stripped if sanitiazation isn't - # disabled. - # - # Defaults to - # {::Google::Cloud::Talent::V4::HtmlSanitization::SIMPLE_FORMATTING_ONLY HtmlSanitization.SIMPLE_FORMATTING_ONLY}. - class ProcessingOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Talent::V4::CustomAttribute] - class CustomAttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb deleted file mode 100644 index 8f673511ad12..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # Create job request. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Required. The Job to be created. - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Get job request. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Update job request. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Required. The Job to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise - # all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - class UpdateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Delete job request. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List jobs request. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] filter - # @return [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @!attribute [rw] page_token - # @return [::String] - # The starting point of a query result. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @!attribute [rw] job_view - # @return [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no - # value is specified. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List jobs response. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4::Job>] - # The Jobs for a given company. - # - # The maximum number of items returned is based on the limit field - # provided in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Request body of the `SearchJobs` call. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] search_mode - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @!attribute [rw] request_metadata - # @return [::Google::Cloud::Talent::V4::RequestMetadata] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @!attribute [rw] job_query - # @return [::Google::Cloud::Talent::V4::JobQuery] - # Query used to search against jobs, such as keyword, location filters, etc. - # @!attribute [rw] enable_broadening - # @return [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @!attribute [rw] histogram_queries - # @return [::Array<::Google::Cloud::Talent::V4::HistogramQuery>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for - # example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example, - # "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @!attribute [rw] job_view - # @return [::Google::Cloud::Talent::V4::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if - # no value is specified. - # @!attribute [rw] offset - # @return [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @!attribute [rw] max_page_size - # @return [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @!attribute [rw] page_token - # @return [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @!attribute [rw] order_by - # @return [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}. - # @!attribute [rw] diversification_level - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @!attribute [rw] custom_ranking_info - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @!attribute [rw] disable_keyword_match - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @!attribute [rw] keyword_match_mode - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. If both keyword_match_mode and - # disable_keyword_match are set, keyword_match_mode will take precedence. - # - # Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @!attribute [rw] relevance_threshold - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - class SearchJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Custom ranking information for - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] importance_level - # @return [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo::ImportanceLevel] - # Required. Controls over how important the score of - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression} - # gets applied to job's final ranking position. - # - # An error is thrown if not specified. - # @!attribute [rw] ranking_expression - # @return [::String] - # Required. Controls over how job documents get ranked on top of existing - # relevance score (determined by API algorithm). A combination of the - # ranking expression and relevance score is used to determine job's final - # ranking position. - # - # The syntax for this expression is a subset of Google SQL syntax. - # - # Supported operators are: +, -, *, /, where the left and right side of - # the operator is either a numeric - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} - # key, integer/double value or an expression that can be evaluated to a - # number. - # - # Parenthesis are supported to adjust calculation precedence. The - # expression must be < 200 characters in length. - # - # The expression is considered invalid for a job if the expression - # references custom attributes that are not populated on the job or if the - # expression results in a divide by zero. If an expression is invalid for a - # job, that job is demoted to the end of the results. - # - # Sample ranking expression - # (year + 25) * 0.25 - (freshness / 0.5) - class CustomRankingInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The importance level for - # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression}. - module ImportanceLevel - # Default value if the importance level isn't specified. - IMPORTANCE_LEVEL_UNSPECIFIED = 0 - - # The given ranking expression is of None importance, existing relevance - # score (determined by API algorithm) dominates job's final ranking - # position. - NONE = 1 - - # The given ranking expression is of Low importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - LOW = 2 - - # The given ranking expression is of Mild importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - MILD = 3 - - # The given ranking expression is of Medium importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - MEDIUM = 4 - - # The given ranking expression is of High importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - HIGH = 5 - - # The given ranking expression is of Extreme importance, and dominates - # job's final ranking position with existing relevance - # score (determined by API algorithm) ignored. - EXTREME = 6 - end - end - - # A string-represented enumeration of the job search mode. The service - # operate differently for different modes of service. - module SearchMode - # The mode of the search method isn't specified. The default search - # behavior is identical to JOB_SEARCH search behavior. - SEARCH_MODE_UNSPECIFIED = 0 - - # The job search matches against all jobs, and featured jobs - # (jobs with promotionValue > 0) are not specially handled. - JOB_SEARCH = 1 - - # The job search matches only against featured jobs (jobs with a - # promotionValue > 0). This method doesn't return any jobs having a - # promotionValue <= 0. The search results order is determined by the - # promotionValue (jobs with a higher promotionValue are returned higher up - # in the search results), with relevance being used as a tiebreaker. - FEATURED_JOB_SEARCH = 2 - end - - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # If you are using pageToken to page through the result set, - # latency might be lower but we can't guarantee that all results are - # returned. If you are using page offset, latency might be higher but all - # results are returned. - module DiversificationLevel - # The diversification level isn't specified. - DIVERSIFICATION_LEVEL_UNSPECIFIED = 0 - - # Disables diversification. Jobs that would normally be pushed to the last - # page would not have their positions altered. This may result in highly - # similar jobs appearing in sequence in the search results. - DISABLED = 1 - - # Default diversifying behavior. The result list is ordered so that - # highly similar results are pushed to the end of the last page of search - # results. - SIMPLE = 2 - - # Only one job from the same company will be shown at once, other jobs - # under same company are pushed to the end of the last page of search - # result. - ONE_PER_COMPANY = 3 - - # Similar to ONE_PER_COMPANY, but it allows at most two jobs in the - # same company to be shown at once, the other jobs under same company are - # pushed to the end of the last page of search result. - TWO_PER_COMPANY = 4 - - # Similar to ONE_PER_COMPANY, but it allows at most three jobs in the - # same company to be shown at once, the other jobs under same company are - # dropped. - MAX_THREE_PER_COMPANY = 6 - - # The result list is ordered such that somewhat similar results are pushed - # to the end of the last page of the search results. This option is - # recommended if SIMPLE diversification does not diversify enough. - DIVERSIFY_BY_LOOSER_SIMILARITY = 5 - end - - # Controls what keyword matching behavior the search has. When keyword - # matching is enabled, a keyword match returns jobs that may not match given - # category filters when there are matching keywords. For example, for the - # query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a - # job posting with the title "software developer," which doesn't fall into - # "program manager" ontology, and "program manager" appearing in its - # description will be surfaced. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this enum's value. - # - # Use - # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - module KeywordMatchMode - # The keyword match option isn't specified. Defaults to - # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # behavior. - KEYWORD_MATCH_MODE_UNSPECIFIED = 0 - - # Disables keyword matching. - KEYWORD_MATCH_DISABLED = 1 - - # Enable keyword matching over - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}, - # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}, and - # keyword searchable - # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} - # fields. - KEYWORD_MATCH_ALL = 2 - - # Only enable keyword matching over - # {::Google::Cloud::Talent::V4::Job#title Job.title}. - KEYWORD_MATCH_TITLE_ONLY = 3 - end - - # The relevance threshold of the search results. The higher relevance - # threshold is, the higher relevant results are shown and the less number of - # results are returned. - module RelevanceThreshold - # Default value. In this case, server behavior defaults to Google defined - # threshold. - RELEVANCE_THRESHOLD_UNSPECIFIED = 0 - - # Lowest relevance threshold. - LOWEST = 1 - - # Low relevance threshold. - LOW = 2 - - # Medium relevance threshold. - MEDIUM = 3 - - # High relevance threshold. - HIGH = 4 - end - end - - # Response for SearchJob method. - # @!attribute [rw] matching_jobs - # @return [::Array<::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob>] - # The Job entities that match the specified - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] histogram_query_results - # @return [::Array<::Google::Cloud::Talent::V4::HistogramQueryResult>] - # The histogram results that match with specified - # {::Google::Cloud::Talent::V4::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries}. - # @!attribute [rw] next_page_token - # @return [::String] - # The token that specifies the starting position of the next page of results. - # This field is empty if there are no more results. - # @!attribute [rw] location_filters - # @return [::Array<::Google::Cloud::Talent::V4::Location>] - # The location filters that the service applied to the specified query. If - # any filters are lat-lng based, the - # {::Google::Cloud::Talent::V4::Location#location_type Location.location_type} is - # {::Google::Cloud::Talent::V4::Location::LocationType::LOCATION_TYPE_UNSPECIFIED Location.LocationType.LOCATION_TYPE_UNSPECIFIED}. - # @!attribute [rw] total_size - # @return [::Integer] - # Number of jobs that match the specified query. - # - # Note: This size is precise only if the total is less than 100,000. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - # @!attribute [rw] broadened_query_jobs_count - # @return [::Integer] - # If query broadening is enabled, we may append additional results from the - # broadened query. This number indicates how many of the jobs returned in the - # jobs field are from the broadened query. These results are always at the - # end of the jobs list. In particular, a value of 0, or if the field isn't - # set, all the jobs in the jobs list are from the original - # (without broadening) query. If this field is non-zero, subsequent requests - # with offset after this result set should contain all broadened results. - # @!attribute [rw] spell_correction - # @return [::Google::Cloud::Talent::V4::SpellingCorrection] - # The spell checking result, and correction. - class SearchJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Job entry with metadata inside - # {::Google::Cloud::Talent::V4::SearchJobsResponse SearchJobsResponse}. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Job resource that matches the specified - # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] job_summary - # @return [::String] - # A summary of the job with core information that's displayed on the search - # results listing page. - # @!attribute [rw] job_title_snippet - # @return [::String] - # Contains snippets of text from the - # {::Google::Cloud::Talent::V4::Job#title Job.title} field most closely matching - # a search query's keywords, if available. The matching query keywords are - # enclosed in HTML bold tags. - # @!attribute [rw] search_text_snippet - # @return [::String] - # Contains snippets of text from the - # {::Google::Cloud::Talent::V4::Job#description Job.description} and similar - # fields that most closely match a search query's keywords, if available. - # All HTML tags in the original fields are stripped when returned in this - # field, and matching query keywords are enclosed in HTML bold tags. - # @!attribute [rw] commute_info - # @return [::Google::Cloud::Talent::V4::SearchJobsResponse::CommuteInfo] - # Commute information which is generated based on specified - # {::Google::Cloud::Talent::V4::CommuteFilter CommuteFilter}. - class MatchingJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Commute details related to this job. - # @!attribute [rw] job_location - # @return [::Google::Cloud::Talent::V4::Location] - # Location used as the destination in the commute calculation. - # @!attribute [rw] travel_duration - # @return [::Google::Protobuf::Duration] - # The number of seconds required to travel to the job location from the - # query location. A duration of 0 seconds indicates that the job isn't - # reachable within the requested duration, but was returned as part of an - # expanded query. - class CommuteInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request to create a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4::Job>] - # Required. The jobs to be created. - # A maximum of 200 jobs can be created in a batch. - class BatchCreateJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to update a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4::Job>] - # Required. The jobs to be updated. - # A maximum of 200 jobs can be updated in a batch. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job} - # are updated. Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported. - # - # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside - # {::Google::Cloud::Talent::V4::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields, - # which can yield a very large response. - class BatchUpdateJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenants/bar". - # - # The parent of all of the jobs specified in `names` must match this field. - # @!attribute [rw] names - # @return [::Array<::String>] - # The names of the jobs to delete. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". - # For example, "projects/foo/tenants/bar/jobs/baz". - # - # A maximum of 200 jobs can be deleted in a batch. - class BatchDeleteJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mutation result of a job from a batch operation. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4::Job] - # Here {::Google::Cloud::Talent::V4::Job Job} only contains basic information - # including {::Google::Cloud::Talent::V4::Job#name name}, - # {::Google::Cloud::Talent::V4::Job#company company}, - # {::Google::Cloud::Talent::V4::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4::Job#requisition_id requisition_id}, use getJob - # method to retrieve detailed information of the created/updated job. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status of the job processed. This field is populated if the - # processing of the {::Google::Cloud::Talent::V4::JobResult#job job} fails. - class JobResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of - # {::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs JobService.BatchCreateJobs}. - # It's used to replace - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # in case of success. - # @!attribute [rw] job_results - # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] - # List of job mutation results from a batch create operation. It can change - # until operation status is FINISHED, FAILED or CANCELLED. - class BatchCreateJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of - # {::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs JobService.BatchUpdateJobs}. - # It's used to replace - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # in case of success. - # @!attribute [rw] job_results - # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] - # List of job mutation results from a batch update operation. It can change - # until operation status is FINISHED, FAILED or CANCELLED. - class BatchUpdateJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of - # {::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs JobService.BatchDeleteJobs}. - # It's used to replace - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # in case of success. - # @!attribute [rw] job_results - # @return [::Array<::Google::Cloud::Talent::V4::JobResult>] - # List of job mutation results from a batch delete operation. It can change - # until operation status is FINISHED, FAILED or CANCELLED. - class BatchDeleteJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An enum that specifies the job attributes that are returned in the - # {::Google::Cloud::Talent::V4::SearchJobsResponse::MatchingJob#job MatchingJob.job} - # or {::Google::Cloud::Talent::V4::ListJobsResponse#jobs ListJobsResponse.jobs} - # fields. - module JobView - # Default value. - JOB_VIEW_UNSPECIFIED = 0 - - # A ID only view of job, with following attributes: - # {::Google::Cloud::Talent::V4::Job#name Job.name}, - # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. - JOB_VIEW_ID_ONLY = 1 - - # A minimal view of the job, with the following attributes: - # {::Google::Cloud::Talent::V4::Job#name Job.name}, - # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#company Job.company}, - # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}. - JOB_VIEW_MINIMAL = 2 - - # A small view of the job, with the following attributes in the search - # results: {::Google::Cloud::Talent::V4::Job#name Job.name}, - # {::Google::Cloud::Talent::V4::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4::Job#title Job.title}, - # {::Google::Cloud::Talent::V4::Job#company Job.company}, - # {::Google::Cloud::Talent::V4::Job::DerivedInfo#locations Job.DerivedInfo.locations}, - # {::Google::Cloud::Talent::V4::Job#visibility Job.visibility}, - # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, - # {::Google::Cloud::Talent::V4::Job#description Job.description}. - JOB_VIEW_SMALL = 3 - - # All available attributes are included in the search results. - JOB_VIEW_FULL = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb deleted file mode 100644 index 75689dcc538b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # A Tenant resource represents a tenant in the service. A tenant is a group or - # entity that shares common access with specific privileges for resources like - # jobs. Customer may create multiple tenants to provide data isolation for - # different groups. - # @!attribute [rw] name - # @return [::String] - # Required during tenant update. - # - # The resource name for a tenant. This is generated by the service when a - # tenant is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] external_id - # @return [::String] - # Required. Client side tenant identifier, used to uniquely identify the - # tenant. - # - # The maximum number of allowed characters is 255. - class Tenant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb deleted file mode 100644 index 69e01584823c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/tenant_service.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4 - # The Request of the CreateTenant method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @!attribute [rw] tenant - # @return [::Google::Cloud::Talent::V4::Tenant] - # Required. The tenant to be created. - class CreateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a tenant by name. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - class GetTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for updating a specified tenant. - # @!attribute [rw] tenant - # @return [::Google::Cloud::Talent::V4::Tenant] - # Required. The tenant resource to replace the current resource in the - # system. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is - # provided, only the specified fields in - # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated. - # Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported. - class UpdateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a tenant. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - class DeleteTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List tenants for which the client has ACL visibility. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @!attribute [rw] page_token - # @return [::String] - # The starting indicator from which to return results. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - class ListTenantsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The List tenants response object. - # @!attribute [rw] tenants - # @return [::Array<::Google::Cloud::Talent::V4::Tenant>] - # Tenants for the current client. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListTenantsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-talent-v4/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 1b485b0c3456..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb deleted file mode 100644 index c15e78a39a56..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/latlng.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # An object that represents a latitude/longitude pair. This is expressed as a - # pair of doubles to represent degrees latitude and degrees longitude. Unless - # specified otherwise, this must conform to the - # WGS84 - # standard. Values must be within normalized ranges. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude in degrees. It must be in the range [-90.0, +90.0]. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude in degrees. It must be in the range [-180.0, +180.0]. - class LatLng - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb deleted file mode 100644 index 56a32eee300d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/money.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 an amount of money with its currency type. - # @!attribute [rw] currency_code - # @return [::String] - # The three-letter currency code defined in ISO 4217. - # @!attribute [rw] units - # @return [::Integer] - # The whole units of the amount. - # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - # @!attribute [rw] nanos - # @return [::Integer] - # Number of nano (10^-9) units of the amount. - # The value must be between -999,999,999 and +999,999,999 inclusive. - # If `units` is positive, `nanos` must be positive or zero. - # If `units` is zero, `nanos` can be positive, zero, or negative. - # If `units` is negative, `nanos` must be negative or zero. - # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - class Money - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb deleted file mode 100644 index 9cd0c16495dd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/postal_address.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 postal address, e.g. for postal delivery or payments addresses. - # Given a postal address, a postal service can deliver items to a premise, P.O. - # Box or similar. - # It is not intended to model geographical locations (roads, towns, - # mountains). - # - # In typical usage an address would be created via user input or from importing - # existing data, depending on the type of process. - # - # Advice on address input / editing: - # - Use an i18n-ready address widget such as - # https://github.com/google/libaddressinput) - # - Users should not be presented with UI elements for input or editing of - # fields outside countries where that field is used. - # - # For more guidance on how to use this schema, please see: - # https://support.google.com/business/answer/6397478 - # @!attribute [rw] revision - # @return [::Integer] - # The schema revision of the `PostalAddress`. This must be set to 0, which is - # the latest revision. - # - # All new revisions **must** be backward compatible with old revisions. - # @!attribute [rw] region_code - # @return [::String] - # Required. CLDR region code of the country/region of the address. This - # is never inferred and it is up to the user to ensure the value is - # correct. See http://cldr.unicode.org/ and - # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] language_code - # @return [::String] - # Optional. BCP-47 language code of the contents of this address (if - # known). This is often the UI language of the input form or is expected - # to match one of the languages used in the address' country/region, or their - # transliterated equivalents. - # This can affect formatting in certain countries, but is not critical - # to the correctness of the data and will never affect any validation or - # other non-formatting related operations. - # - # If this value is not known, it should be omitted (rather than specifying a - # possibly incorrect default). - # - # Examples: "zh-Hant", "ja", "ja-Latn", "en". - # @!attribute [rw] postal_code - # @return [::String] - # Optional. Postal code of the address. Not all countries use or require - # postal codes to be present, but where they are used, they may trigger - # additional validation with other parts of the address (e.g. state/zip - # validation in the U.S.A.). - # @!attribute [rw] sorting_code - # @return [::String] - # Optional. Additional, country-specific, sorting code. This is not used - # in most regions. Where it is used, the value is either a string like - # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number - # alone, representing the "sector code" (Jamaica), "delivery area indicator" - # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). - # @!attribute [rw] administrative_area - # @return [::String] - # Optional. Highest administrative subdivision which is used for postal - # addresses of a country or region. - # For example, this can be a state, a province, an oblast, or a prefecture. - # Specifically, for Spain this is the province and not the autonomous - # community (e.g. "Barcelona" and not "Catalonia"). - # Many countries don't use an administrative area in postal addresses. E.g. - # in Switzerland this should be left unpopulated. - # @!attribute [rw] locality - # @return [::String] - # Optional. Generally refers to the city/town portion of the address. - # Examples: US city, IT comune, UK post town. - # In regions of the world where localities are not well defined or do not fit - # into this structure well, leave locality empty and use address_lines. - # @!attribute [rw] sublocality - # @return [::String] - # Optional. Sublocality of the address. - # For example, this can be neighborhoods, boroughs, districts. - # @!attribute [rw] address_lines - # @return [::Array<::String>] - # Unstructured address lines describing the lower levels of an address. - # - # Because values in address_lines do not have type information and may - # sometimes contain multiple values in a single field (e.g. - # "Austin, TX"), it is important that the line order is clear. The order of - # address lines should be "envelope order" for the country/region of the - # address. In places where this can vary (e.g. Japan), address_language is - # used to make it explicit (e.g. "ja" for large-to-small ordering and - # "ja-Latn" or "en" for small-to-large). This way, the most specific line of - # an address can be selected based on the language. - # - # The minimum permitted structural representation of an address consists - # of a region_code with all remaining information placed in the - # address_lines. It would be possible to format such an address very - # approximately without geocoding, but no semantic reasoning could be - # made about any of the address components until it was at least - # partially resolved. - # - # Creating an address only containing a region_code and address_lines, and - # then geocoding is the recommended way to handle completely unstructured - # addresses (as opposed to guessing which parts of the address should be - # localities or administrative areas). - # @!attribute [rw] recipients - # @return [::Array<::String>] - # Optional. The recipient at the address. - # This field may, under certain circumstances, contain multiline information. - # For example, it might contain "care of" information. - # @!attribute [rw] organization - # @return [::String] - # Optional. The name of the organization at the address. - class PostalAddress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/proto_docs/google/type/timeofday.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 of day. The date and time zone are either not significant - # or are specified elsewhere. An API may choose to allow leap seconds. Related - # types are [google.type.Date][google.type.Date] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] hours - # @return [::Integer] - # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - # to allow the value "24:00:00" for scenarios like business closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Seconds of minutes of the time. Must normally be from 0 to 59. An API may - # allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - class TimeOfDay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile b/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile deleted file mode 100644 index b3bffd08bc08..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4", path: "../" -else - gem "google-cloud-talent-v4" -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-talent-v4/snippets/company_service/create_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb deleted file mode 100644 index e56a55c05094..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/create_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_CreateCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_company call in the CompanyService 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::Talent::V4::CompanyService::Client#create_company. -# -def create_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateCompanyRequest.new - - # Call the create_company method. - result = client.create_company request - - # The returned object is of type Google::Cloud::Talent::V4::Company. - p result -end -# [END jobs_v4_generated_CompanyService_CreateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb deleted file mode 100644 index 40fdb75b8cc4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/delete_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_DeleteCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the delete_company call in the CompanyService 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::Talent::V4::CompanyService::Client#delete_company. -# -def delete_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new - - # Call the delete_company method. - result = client.delete_company request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4_generated_CompanyService_DeleteCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb deleted file mode 100644 index 9c22acb2386a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/get_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_GetCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the get_company call in the CompanyService 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::Talent::V4::CompanyService::Client#get_company. -# -def get_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::GetCompanyRequest.new - - # Call the get_company method. - result = client.get_company request - - # The returned object is of type Google::Cloud::Talent::V4::Company. - p result -end -# [END jobs_v4_generated_CompanyService_GetCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb deleted file mode 100644 index 020a9f51d83c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/list_companies.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_ListCompanies_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the list_companies call in the CompanyService 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::Talent::V4::CompanyService::Client#list_companies. -# -def list_companies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::ListCompaniesRequest.new - - # Call the list_companies method. - result = client.list_companies 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::Talent::V4::Company. - p item - end -end -# [END jobs_v4_generated_CompanyService_ListCompanies_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb deleted file mode 100644 index 8b646272a21b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/company_service/update_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_CompanyService_UpdateCompany_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the update_company call in the CompanyService 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::Talent::V4::CompanyService::Client#update_company. -# -def update_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new - - # Call the update_company method. - result = client.update_company request - - # The returned object is of type Google::Cloud::Talent::V4::Company. - p result -end -# [END jobs_v4_generated_CompanyService_UpdateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb deleted file mode 100644 index 43f84207b6e0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/completion/complete_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_Completion_CompleteQuery_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the complete_query call in the Completion 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::Talent::V4::Completion::Client#complete_query. -# -def complete_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::Completion::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CompleteQueryRequest.new - - # Call the complete_query method. - result = client.complete_query request - - # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. - p result -end -# [END jobs_v4_generated_Completion_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb deleted file mode 100644 index ade74776472e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/event_service/create_client_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_EventService_CreateClientEvent_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_client_event call in the EventService 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::Talent::V4::EventService::Client#create_client_event. -# -def create_client_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::EventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateClientEventRequest.new - - # Call the create_client_event method. - result = client.create_client_event request - - # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. - p result -end -# [END jobs_v4_generated_EventService_CreateClientEvent_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb deleted file mode 100644 index 21835b11ffce..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_BatchCreateJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the batch_create_jobs call in the JobService 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::Talent::V4::JobService::Client#batch_create_jobs. -# -def batch_create_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new - - # Call the batch_create_jobs method. - result = client.batch_create_jobs 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 jobs_v4_generated_JobService_BatchCreateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb deleted file mode 100644 index 0cb9e4d13b0b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_BatchDeleteJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the batch_delete_jobs call in the JobService 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::Talent::V4::JobService::Client#batch_delete_jobs. -# -def batch_delete_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new - - # Call the batch_delete_jobs method. - result = client.batch_delete_jobs 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 jobs_v4_generated_JobService_BatchDeleteJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb deleted file mode 100644 index bb184ab697d5..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_BatchUpdateJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the batch_update_jobs call in the JobService 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::Talent::V4::JobService::Client#batch_update_jobs. -# -def batch_update_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new - - # Call the batch_update_jobs method. - result = client.batch_update_jobs 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 jobs_v4_generated_JobService_BatchUpdateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb deleted file mode 100644 index aba1bba6ca7b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/create_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_CreateJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_job call in the JobService 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::Talent::V4::JobService::Client#create_job. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Google::Cloud::Talent::V4::Job. - p result -end -# [END jobs_v4_generated_JobService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb deleted file mode 100644 index 1391253de76b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/delete_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_DeleteJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the delete_job call in the JobService 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::Talent::V4::JobService::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::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 jobs_v4_generated_JobService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb deleted file mode 100644 index 16f9c7382f55..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/get_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_GetJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the get_job call in the JobService 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::Talent::V4::JobService::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Talent::V4::Job. - p result -end -# [END jobs_v4_generated_JobService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb deleted file mode 100644 index 2445a495de35..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/list_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_ListJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the list_jobs call in the JobService 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::Talent::V4::JobService::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::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::Talent::V4::Job. - p item - end -end -# [END jobs_v4_generated_JobService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb deleted file mode 100644 index 6b29ad36b790..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_SearchJobs_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the search_jobs call in the JobService 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::Talent::V4::JobService::Client#search_jobs. -# -def search_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::SearchJobsRequest.new - - # Call the search_jobs method. - result = client.search_jobs request - - # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - p result -end -# [END jobs_v4_generated_JobService_SearchJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb deleted file mode 100644 index 3e422ee69d93..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_SearchJobsForAlert_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the search_jobs_for_alert call in the JobService 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::Talent::V4::JobService::Client#search_jobs_for_alert. -# -def search_jobs_for_alert - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::SearchJobsRequest.new - - # Call the search_jobs_for_alert method. - result = client.search_jobs_for_alert request - - # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. - p result -end -# [END jobs_v4_generated_JobService_SearchJobsForAlert_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb deleted file mode 100644 index 7be182860d89..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/job_service/update_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_JobService_UpdateJob_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the update_job call in the JobService 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::Talent::V4::JobService::Client#update_job. -# -def update_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::UpdateJobRequest.new - - # Call the update_job method. - result = client.update_job request - - # The returned object is of type Google::Cloud::Talent::V4::Job. - p result -end -# [END jobs_v4_generated_JobService_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json b/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json deleted file mode 100644 index 282652fed372..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-talent-v4", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.talent.v4", - "version": "v4" - } - ] - }, - "snippets": [ - { - "region_tag": "jobs_v4_generated_CompanyService_CreateCompany_sync", - "title": "Snippet for the create_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#create_company.", - "file": "company_service/create_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#create_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "CreateCompany", - "full_name": "google.cloud.talent.v4.CompanyService.CreateCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_GetCompany_sync", - "title": "Snippet for the get_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#get_company.", - "file": "company_service/get_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#get_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::GetCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "GetCompany", - "full_name": "google.cloud.talent.v4.CompanyService.GetCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_UpdateCompany_sync", - "title": "Snippet for the update_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#update_company.", - "file": "company_service/update_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#update_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::UpdateCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "UpdateCompany", - "full_name": "google.cloud.talent.v4.CompanyService.UpdateCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_DeleteCompany_sync", - "title": "Snippet for the delete_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#delete_company.", - "file": "company_service/delete_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_company", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#delete_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::DeleteCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "DeleteCompany", - "full_name": "google.cloud.talent.v4.CompanyService.DeleteCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_CompanyService_ListCompanies_sync", - "title": "Snippet for the list_companies call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::CompanyService::Client#list_companies.", - "file": "company_service/list_companies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_companies", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client#list_companies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::ListCompaniesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ListCompaniesResponse", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4::CompanyService::Client" - }, - "method": { - "short_name": "ListCompanies", - "full_name": "google.cloud.talent.v4.CompanyService.ListCompanies", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_Completion_CompleteQuery_sync", - "title": "Snippet for the complete_query call in the Completion service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::Completion::Client#complete_query.", - "file": "completion/complete_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "complete_query", - "full_name": "::Google::Cloud::Talent::V4::Completion::Client#complete_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CompleteQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::CompleteQueryResponse", - "client": { - "short_name": "Completion::Client", - "full_name": "::Google::Cloud::Talent::V4::Completion::Client" - }, - "method": { - "short_name": "CompleteQuery", - "full_name": "google.cloud.talent.v4.Completion.CompleteQuery", - "service": { - "short_name": "Completion", - "full_name": "google.cloud.talent.v4.Completion" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_EventService_CreateClientEvent_sync", - "title": "Snippet for the create_client_event call in the EventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::EventService::Client#create_client_event.", - "file": "event_service/create_client_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_client_event", - "full_name": "::Google::Cloud::Talent::V4::EventService::Client#create_client_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateClientEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ClientEvent", - "client": { - "short_name": "EventService::Client", - "full_name": "::Google::Cloud::Talent::V4::EventService::Client" - }, - "method": { - "short_name": "CreateClientEvent", - "full_name": "google.cloud.talent.v4.EventService.CreateClientEvent", - "service": { - "short_name": "EventService", - "full_name": "google.cloud.talent.v4.EventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_CreateJob_sync", - "title": "Snippet for the create_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#create_job.", - "file": "job_service/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.talent.v4.JobService.CreateJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_BatchCreateJobs_sync", - "title": "Snippet for the batch_create_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs.", - "file": "job_service/batch_create_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::BatchCreateJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "BatchCreateJobs", - "full_name": "google.cloud.talent.v4.JobService.BatchCreateJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_GetJob_sync", - "title": "Snippet for the get_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#get_job.", - "file": "job_service/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.talent.v4.JobService.GetJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_UpdateJob_sync", - "title": "Snippet for the update_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#update_job.", - "file": "job_service/update_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#update_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::UpdateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "UpdateJob", - "full_name": "google.cloud.talent.v4.JobService.UpdateJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_BatchUpdateJobs_sync", - "title": "Snippet for the batch_update_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs.", - "file": "job_service/batch_update_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::BatchUpdateJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "BatchUpdateJobs", - "full_name": "google.cloud.talent.v4.JobService.BatchUpdateJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_DeleteJob_sync", - "title": "Snippet for the delete_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#delete_job.", - "file": "job_service/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.talent.v4.JobService.DeleteJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_BatchDeleteJobs_sync", - "title": "Snippet for the batch_delete_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs.", - "file": "job_service/batch_delete_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::BatchDeleteJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "BatchDeleteJobs", - "full_name": "google.cloud.talent.v4.JobService.BatchDeleteJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_ListJobs_sync", - "title": "Snippet for the list_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#list_jobs.", - "file": "job_service/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ListJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.talent.v4.JobService.ListJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_SearchJobs_sync", - "title": "Snippet for the search_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs.", - "file": "job_service/search_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_jobs", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "SearchJobs", - "full_name": "google.cloud.talent.v4.JobService.SearchJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_JobService_SearchJobsForAlert_sync", - "title": "Snippet for the search_jobs_for_alert call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert.", - "file": "job_service/search_jobs_for_alert.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_jobs_for_alert", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::SearchJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::SearchJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4::JobService::Client" - }, - "method": { - "short_name": "SearchJobsForAlert", - "full_name": "google.cloud.talent.v4.JobService.SearchJobsForAlert", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_CreateTenant_sync", - "title": "Snippet for the create_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#create_tenant.", - "file": "tenant_service/create_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#create_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::CreateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "CreateTenant", - "full_name": "google.cloud.talent.v4.TenantService.CreateTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_GetTenant_sync", - "title": "Snippet for the get_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#get_tenant.", - "file": "tenant_service/get_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#get_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::GetTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "GetTenant", - "full_name": "google.cloud.talent.v4.TenantService.GetTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_UpdateTenant_sync", - "title": "Snippet for the update_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#update_tenant.", - "file": "tenant_service/update_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#update_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::UpdateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "UpdateTenant", - "full_name": "google.cloud.talent.v4.TenantService.UpdateTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_DeleteTenant_sync", - "title": "Snippet for the delete_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#delete_tenant.", - "file": "tenant_service/delete_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tenant", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#delete_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::DeleteTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "DeleteTenant", - "full_name": "google.cloud.talent.v4.TenantService.DeleteTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4_generated_TenantService_ListTenants_sync", - "title": "Snippet for the list_tenants call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4::TenantService::Client#list_tenants.", - "file": "tenant_service/list_tenants.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tenants", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client#list_tenants", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4::ListTenantsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4::ListTenantsResponse", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4::TenantService::Client" - }, - "method": { - "short_name": "ListTenants", - "full_name": "google.cloud.talent.v4.TenantService.ListTenants", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb deleted file mode 100644 index 665aba99974d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_CreateTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the create_tenant call in the TenantService 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::Talent::V4::TenantService::Client#create_tenant. -# -def create_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::CreateTenantRequest.new - - # Call the create_tenant method. - result = client.create_tenant request - - # The returned object is of type Google::Cloud::Talent::V4::Tenant. - p result -end -# [END jobs_v4_generated_TenantService_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb deleted file mode 100644 index f0ee2dc8605a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_DeleteTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the delete_tenant call in the TenantService 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::Talent::V4::TenantService::Client#delete_tenant. -# -def delete_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::DeleteTenantRequest.new - - # Call the delete_tenant method. - result = client.delete_tenant request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4_generated_TenantService_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb deleted file mode 100644 index 92928f5b47d7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_GetTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the get_tenant call in the TenantService 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::Talent::V4::TenantService::Client#get_tenant. -# -def get_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::GetTenantRequest.new - - # Call the get_tenant method. - result = client.get_tenant request - - # The returned object is of type Google::Cloud::Talent::V4::Tenant. - p result -end -# [END jobs_v4_generated_TenantService_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb deleted file mode 100644 index 4cfc79e6fc24..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_ListTenants_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the list_tenants call in the TenantService 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::Talent::V4::TenantService::Client#list_tenants. -# -def list_tenants - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::ListTenantsRequest.new - - # Call the list_tenants method. - result = client.list_tenants 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::Talent::V4::Tenant. - p item - end -end -# [END jobs_v4_generated_TenantService_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb b/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb deleted file mode 100644 index 19154714e44b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4_generated_TenantService_UpdateTenant_sync] -require "google/cloud/talent/v4" - -## -# Snippet for the update_tenant call in the TenantService 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::Talent::V4::TenantService::Client#update_tenant. -# -def update_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4::UpdateTenantRequest.new - - # Call the update_tenant method. - result = client.update_tenant request - - # The returned object is of type Google::Cloud::Talent::V4::Tenant. - p result -end -# [END jobs_v4_generated_TenantService_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb deleted file mode 100644 index 51d748c725d6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service" - -class ::Google::Cloud::Talent::V4::CompanyService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb deleted file mode 100644 index 55e30df49147..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_rest_test.rb +++ /dev/null @@ -1,374 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" -require "google/cloud/talent/v4/company_service/rest" - - -class ::Google::Cloud::Talent::V4::CompanyService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - company = {} - - create_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_create_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_company({ parent: parent, company: company }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_company parent: parent, company: company do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_company({ parent: parent, company: company }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_company_client_stub.call_count - end - end - end - - def test_get_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_get_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_company({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_company name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_company({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_company(::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_company_client_stub.call_count - end - end - end - - def test_update_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - company = {} - update_mask = {} - - update_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_update_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_company({ company: company, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_company company: company, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_company({ company: company, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_company_client_stub.call_count - end - end - end - - def test_delete_company - # 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_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_delete_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_company({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_company name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_company({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_company_client_stub.call_count - end - end - end - - def test_list_companies - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ListCompaniesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - require_open_jobs = true - - list_companies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::CompanyService::Rest::ServiceStub.stub :transcode_list_companies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_companies_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_companies_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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb deleted file mode 100644 index e4827e8d8ef9..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/company_service_test.rb +++ /dev/null @@ -1,409 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/company_service_pb" -require "google/cloud/talent/v4/company_service" - -class ::Google::Cloud::Talent::V4::CompanyService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Company.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" - company = {} - - create_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_company, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateCompanyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_company({ parent: parent, company: company }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_company parent: parent, company: company do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_company ::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_company({ parent: parent, company: company }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_company(::Google::Cloud::Talent::V4::CreateCompanyRequest.new(parent: parent, company: company), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_company_client_stub.call_rpc_count - end - end - - def test_get_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Company.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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_company, name - assert_kind_of ::Google::Cloud::Talent::V4::GetCompanyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_company({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_company name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_company ::Google::Cloud::Talent::V4::GetCompanyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_company({ 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_company(::Google::Cloud::Talent::V4::GetCompanyRequest.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_company_client_stub.call_rpc_count - end - end - - def test_update_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Company.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. - company = {} - update_mask = {} - - update_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_company, name - assert_kind_of ::Google::Cloud::Talent::V4::UpdateCompanyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Company), request["company"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_company({ company: company, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_company company: company, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_company ::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company({ company: company, 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_company(::Google::Cloud::Talent::V4::UpdateCompanyRequest.new(company: company, 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_company_client_stub.call_rpc_count - end - end - - def test_delete_company - # 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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_company, name - assert_kind_of ::Google::Cloud::Talent::V4::DeleteCompanyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_company({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_company name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_company ::Google::Cloud::Talent::V4::DeleteCompanyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_company({ 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_company(::Google::Cloud::Talent::V4::DeleteCompanyRequest.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_company_client_stub.call_rpc_count - end - end - - def test_list_companies - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::ListCompaniesResponse.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_token = "hello world" - page_size = 42 - require_open_jobs = true - - list_companies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_companies, name - assert_kind_of ::Google::Cloud::Talent::V4::ListCompaniesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal true, request["require_open_jobs"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_companies_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) 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_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs 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_companies ::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) 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_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, 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_companies(::Google::Cloud::Talent::V4::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), 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_companies_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::Talent::V4::CompanyService::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::Talent::V4::CompanyService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4::CompanyService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::CompanyService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb deleted file mode 100644 index aeb6b9d2f969..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion" - -class ::Google::Cloud::Talent::V4::Completion::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb deleted file mode 100644 index 4a17510d2b0d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_rest_test.rb +++ /dev/null @@ -1,159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" -require "google/cloud/talent/v4/completion/rest" - - -class ::Google::Cloud::Talent::V4::Completion::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::CompleteQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - tenant = "hello world" - query = "hello world" - language_codes = ["hello world"] - page_size = 42 - company = "hello world" - scope = :COMPLETION_SCOPE_UNSPECIFIED - type = :COMPLETION_TYPE_UNSPECIFIED - - complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::Completion::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::Completion::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, complete_query_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::Talent::V4::Completion::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::Talent::V4::Completion::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb deleted file mode 100644 index 1099c4c1ade7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/completion_test.rb +++ /dev/null @@ -1,174 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/completion_service_pb" -require "google/cloud/talent/v4/completion" - -class ::Google::Cloud::Talent::V4::Completion::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::CompleteQueryResponse.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. - tenant = "hello world" - query = "hello world" - language_codes = ["hello world"] - page_size = 42 - company = "hello world" - scope = :COMPLETION_SCOPE_UNSPECIFIED - type = :COMPLETION_TYPE_UNSPECIFIED - - complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :complete_query, name - assert_kind_of ::Google::Cloud::Talent::V4::CompleteQueryRequest, request - assert_equal "hello world", request["tenant"] - assert_equal "hello world", request["query"] - assert_equal ["hello world"], request["language_codes"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["company"] - assert_equal :COMPLETION_SCOPE_UNSPECIFIED, request["scope"] - assert_equal :COMPLETION_TYPE_UNSPECIFIED, request["type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.complete_query tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.complete_query({ tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Talent::V4::CompleteQueryRequest.new(tenant: tenant, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, complete_query_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::Talent::V4::Completion::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::Talent::V4::Completion::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4::Completion::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::Completion::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb deleted file mode 100644 index 9812de9567dd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service" - -class ::Google::Cloud::Talent::V4::EventService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb deleted file mode 100644 index 9d149f603fb8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_rest_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" -require "google/cloud/talent/v4/event_service/rest" - - -class ::Google::Cloud::Talent::V4::EventService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_client_event - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ClientEvent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - client_event = {} - - create_client_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::EventService::Rest::ServiceStub.stub :transcode_create_client_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_client_event_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::EventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_client_event({ parent: parent, client_event: client_event }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_client_event parent: parent, client_event: client_event do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_client_event({ parent: parent, client_event: client_event }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_client_event_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::Talent::V4::EventService::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::Talent::V4::EventService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb deleted file mode 100644 index 90ae40a15d96..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/event_service_test.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/event_service_pb" -require "google/cloud/talent/v4/event_service" - -class ::Google::Cloud::Talent::V4::EventService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_client_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::ClientEvent.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" - client_event = {} - - create_client_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_client_event, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateClientEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::ClientEvent), request["client_event"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_client_event_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_client_event({ parent: parent, client_event: client_event }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_client_event parent: parent, client_event: client_event do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_client_event ::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_client_event({ parent: parent, client_event: client_event }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_client_event(::Google::Cloud::Talent::V4::CreateClientEventRequest.new(parent: parent, client_event: client_event), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_client_event_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::Talent::V4::EventService::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::Talent::V4::EventService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::EventService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb deleted file mode 100644 index 21555365b3e2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service_services_pb" -require "google/cloud/talent/v4/job_service" - -class ::Google::Cloud::Talent::V4::JobService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::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::Talent::V4::JobService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb deleted file mode 100644 index c7a1a286edc7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service" - -class ::Google::Cloud::Talent::V4::JobService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - end - end - - def test_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", tenant: "value1", job: "value2" - assert_equal "projects/value0/tenants/value1/jobs/value2", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb deleted file mode 100644 index f898410562ca..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_rest_test.rb +++ /dev/null @@ -1,679 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service/rest" - - -class ::Google::Cloud::Talent::V4::JobService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job: job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_batch_create_jobs - # 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" - jobs = [{}] - - batch_create_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_create_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_jobs({ parent: parent, jobs: jobs }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_jobs parent: parent, jobs: jobs do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_jobs({ parent: parent, jobs: jobs }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_jobs_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Talent::V4::GetJobRequest.new(name: name), 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_update_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_job 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::Talent::V4::UpdateJobRequest.new(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({ 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::Talent::V4::UpdateJobRequest.new(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_batch_update_jobs - # 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" - jobs = [{}] - update_mask = {} - - batch_update_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_update_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_jobs_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. - name = "hello world" - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name), 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_batch_delete_jobs - # 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" - names = ["hello world"] - - batch_delete_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_batch_delete_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_delete_jobs({ parent: parent, names: names }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_delete_jobs parent: parent, names: names do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_delete_jobs({ parent: parent, names: names }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_jobs_client_stub.call_count - end - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - job_view = :JOB_VIEW_UNSPECIFIED - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_jobs_client_stub.call_count - end - end - end - - def test_search_jobs_for_alert - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::SearchJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::JobService::Rest::ServiceStub.stub :transcode_search_jobs_for_alert_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_jobs_for_alert_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_jobs_for_alert_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::Talent::V4::JobService::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::Talent::V4::JobService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb deleted file mode 100644 index d450c7816e63..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/job_service_test.rb +++ /dev/null @@ -1,798 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/job_service_pb" -require "google/cloud/talent/v4/job_service" - -class ::Google::Cloud::Talent::V4::JobService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::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. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Job), request["job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_job parent: parent, job: job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_job ::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Talent::V4::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_rpc_count - end - end - - def test_batch_create_jobs - # 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" - jobs = [{}] - - batch_create_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_jobs({ parent: parent, jobs: jobs }) 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.batch_create_jobs parent: parent, jobs: jobs 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.batch_create_jobs ::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) 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.batch_create_jobs({ parent: parent, jobs: jobs }, 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.batch_create_jobs(::Google::Cloud::Talent::V4::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), 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, batch_create_jobs_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::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. - name = "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::Talent::V4::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Talent::V4::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ 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_job(::Google::Cloud::Talent::V4::GetJobRequest.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_job_client_stub.call_rpc_count - end - end - - def test_update_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::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. - 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::Talent::V4::UpdateJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::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::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_job({ 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 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::Talent::V4::UpdateJobRequest.new(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({ 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::Talent::V4::UpdateJobRequest.new(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_batch_update_jobs - # 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" - jobs = [{}] - update_mask = {} - - batch_update_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Talent::V4::Job, request["jobs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) 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.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask 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.batch_update_jobs ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) 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.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, 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.batch_update_jobs(::Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), 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, batch_update_jobs_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. - name = "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::Talent::V4::DeleteJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Talent::V4::DeleteJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ 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_job(::Google::Cloud::Talent::V4::DeleteJobRequest.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_job_client_stub.call_rpc_count - end - end - - def test_batch_delete_jobs - # 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" - names = ["hello world"] - - batch_delete_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["names"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_delete_jobs({ parent: parent, names: names }) 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.batch_delete_jobs parent: parent, names: names 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.batch_delete_jobs ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names) 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.batch_delete_jobs({ parent: parent, names: names }, 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.batch_delete_jobs(::Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new(parent: parent, names: names), 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, batch_delete_jobs_client_stub.call_rpc_count - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::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. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - job_view = :JOB_VIEW_UNSPECIFIED - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::ListJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) 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 parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view 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::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) 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({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, 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::Talent::V4::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.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" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] - assert_equal true, request["enable_broadening"] - assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - assert_equal 42, request["offset"] - assert_equal 42, request["max_page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] - assert_equal true, request["disable_keyword_match"] - assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_jobs ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_jobs(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_jobs_client_stub.call_rpc_count - end - end - - def test_search_jobs_for_alert - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::SearchJobsResponse.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" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - max_page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_for_alert_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_jobs_for_alert, name - assert_kind_of ::Google::Cloud::Talent::V4::SearchJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::RequestMetadata), request["request_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::JobQuery), request["job_query"] - assert_equal true, request["enable_broadening"] - assert_kind_of ::Google::Cloud::Talent::V4::HistogramQuery, request["histogram_queries"].first - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - assert_equal 42, request["offset"] - assert_equal 42, request["max_page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] - assert_equal true, request["disable_keyword_match"] - assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_jobs_for_alert_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_jobs_for_alert ::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_jobs_for_alert(::Google::Cloud::Talent::V4::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, histogram_queries: histogram_queries, job_view: job_view, offset: offset, max_page_size: max_page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_jobs_for_alert_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::Talent::V4::JobService::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::Talent::V4::JobService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4::JobService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::JobService::Client, client - assert_equal creds, client.configure.credentials - end - 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::Talent::V4::JobService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Talent::V4::JobService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb deleted file mode 100644 index 0b082784d6bd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service" - -class ::Google::Cloud::Talent::V4::TenantService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb deleted file mode 100644 index ea21ef440774..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_rest_test.rb +++ /dev/null @@ -1,373 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" -require "google/cloud/talent/v4/tenant_service/rest" - - -class ::Google::Cloud::Talent::V4::TenantService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - tenant = {} - - create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tenant({ parent: parent, tenant: tenant }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tenant parent: parent, tenant: tenant do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant: tenant }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_count - end - end - end - - def test_get_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_tenant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_tenant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_tenant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_tenant_client_stub.call_count - end - end - end - - def test_update_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - tenant = {} - update_mask = {} - - update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_tenant tenant: tenant, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_tenant({ tenant: tenant, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_tenant_client_stub.call_count - end - end - end - - def test_delete_tenant - # 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_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tenant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tenant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tenant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tenant_client_stub.call_count - end - end - end - - def test_list_tenants - # Create test objects. - client_result = ::Google::Cloud::Talent::V4::ListTenantsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4::TenantService::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_tenants_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::Talent::V4::TenantService::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::Talent::V4::TenantService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb b/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb deleted file mode 100644 index 9f48a5264f89..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/google/cloud/talent/v4/tenant_service_test.rb +++ /dev/null @@ -1,407 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4/tenant_service_pb" -require "google/cloud/talent/v4/tenant_service" - -class ::Google::Cloud::Talent::V4::TenantService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Tenant.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" - tenant = {} - - create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::CreateTenantRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tenant({ parent: parent, tenant: tenant }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_tenant parent: parent, tenant: tenant do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant: tenant }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::Talent::V4::CreateTenantRequest.new(parent: parent, tenant: tenant), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_rpc_count - end - end - - def test_get_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Tenant.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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::GetTenantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_tenant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_tenant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::Talent::V4::GetTenantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_tenant({ 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_tenant(::Google::Cloud::Talent::V4::GetTenantRequest.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_tenant_client_stub.call_rpc_count - end - end - - def test_update_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::Tenant.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. - tenant = {} - update_mask = {} - - update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::UpdateTenantRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4::Tenant), request["tenant"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_tenant tenant: tenant, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, 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_tenant({ tenant: tenant, 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_tenant(::Google::Cloud::Talent::V4::UpdateTenantRequest.new(tenant: tenant, 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_tenant_client_stub.call_rpc_count - end - end - - def test_delete_tenant - # 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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4::DeleteTenantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tenant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_tenant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::Talent::V4::DeleteTenantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_tenant({ 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_tenant(::Google::Cloud::Talent::V4::DeleteTenantRequest.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_tenant_client_stub.call_rpc_count - end - end - - def test_list_tenants - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4::ListTenantsResponse.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_token = "hello world" - page_size = 42 - - list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tenants, name - assert_kind_of ::Google::Cloud::Talent::V4::ListTenantsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) 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_tenants parent: parent, page_token: page_token, page_size: page_size 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_tenants ::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_tenants({ parent: parent, page_token: page_token, page_size: page_size }, 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_tenants(::Google::Cloud::Talent::V4::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_tenants_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::Talent::V4::TenantService::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::Talent::V4::TenantService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4::TenantService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4/test/helper.rb b/owl-bot-staging/google-cloud-talent-v4/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/.gitignore b/owl-bot-staging/google-cloud-talent-v4beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/.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-talent-v4beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-talent-v4beta1/.repo-metadata.json deleted file mode 100644 index 64fc84b59ea7..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "jobs.googleapis.com", - "api_shortname": "jobs", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest", - "distribution_name": "google-cloud-talent-v4beta1", - "is_cloud": true, - "language": "ruby", - "name": "jobs", - "name_pretty": "Cloud Talent Solution V4beta1 API", - "product_documentation": "https://cloud.google.com/solutions/talent-solution", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TALENT", - "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml b/owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml deleted file mode 100644 index 8fe2d7ec9ecd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-talent-v4beta1.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-talent-v4beta1.rb" diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb b/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/.yardopts b/owl-bot-staging/google-cloud-talent-v4beta1/.yardopts deleted file mode 100644 index 72b9d2c72c9c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Talent Solution V4beta1 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-talent-v4beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent-v4beta1/AUTHENTICATION.md deleted file mode 100644 index 26b135cba9b3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-talent-v4beta1 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-talent-v4beta1 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/talent/v4beta1" - -client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/talent/v4beta1" - -::Google::Cloud::Talent::V4beta1::CompanyService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Talent::V4beta1::CompanyService::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-talent-v4beta1 -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/talent/v4beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Talent::V4beta1::CompanyService::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-talent-v4beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-talent-v4beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile b/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-talent-v4beta1/LICENSE.md b/owl-bot-staging/google-cloud-talent-v4beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/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-talent-v4beta1/README.md b/owl-bot-staging/google-cloud-talent-v4beta1/README.md deleted file mode 100644 index 5a72cfcb8d08..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Talent Solution V4beta1 API - -Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters. - -Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. - -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 Talent Solution V4beta1 API. Most users should consider using -the main client gem, -[google-cloud-talent](https://rubygems.org/gems/google-cloud-talent). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-talent-v4beta1 -``` - -## 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/jobs.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/talent/v4beta1" - -client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new -request = ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new # (request fields as keyword arguments...) -response = client.create_company request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/talent/v4beta1" -require "logger" - -client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-talent`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-talent-v4beta1`. -_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-talent`. -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-talent-v4beta1`. - -### 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-talent-v4beta1/Rakefile b/owl-bot-staging/google-cloud-talent-v4beta1/Rakefile deleted file mode 100644 index fa2bfbd46707..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TALENT_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TALENT_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/talent/v4beta1/company_service/credentials" - ::Google::Cloud::Talent::V4beta1::CompanyService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TALENT_PROJECT"] = project - ENV["TALENT_TEST_PROJECT"] = project - ENV["TALENT_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-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-talent-v4beta1" - header "google-cloud-talent-v4beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-talent-v4beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1 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-talent-v4beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-talent-v4beta1/gapic_metadata.json deleted file mode 100644 index 91c70fb53d53..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/gapic_metadata.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.talent.v4beta1", - "libraryPackage": "::Google::Cloud::Talent::V4beta1", - "services": { - "CompanyService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4beta1::CompanyService::Client", - "rpcs": { - "CreateCompany": { - "methods": [ - "create_company" - ] - }, - "GetCompany": { - "methods": [ - "get_company" - ] - }, - "UpdateCompany": { - "methods": [ - "update_company" - ] - }, - "DeleteCompany": { - "methods": [ - "delete_company" - ] - }, - "ListCompanies": { - "methods": [ - "list_companies" - ] - } - } - } - } - }, - "Completion": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4beta1::Completion::Client", - "rpcs": { - "CompleteQuery": { - "methods": [ - "complete_query" - ] - } - } - } - } - }, - "EventService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4beta1::EventService::Client", - "rpcs": { - "CreateClientEvent": { - "methods": [ - "create_client_event" - ] - } - } - } - } - }, - "JobService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4beta1::JobService::Client", - "rpcs": { - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "BatchCreateJobs": { - "methods": [ - "batch_create_jobs" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "UpdateJob": { - "methods": [ - "update_job" - ] - }, - "BatchUpdateJobs": { - "methods": [ - "batch_update_jobs" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "BatchDeleteJobs": { - "methods": [ - "batch_delete_jobs" - ] - }, - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "SearchJobs": { - "methods": [ - "search_jobs" - ] - }, - "SearchJobsForAlert": { - "methods": [ - "search_jobs_for_alert" - ] - } - } - } - } - }, - "TenantService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Talent::V4beta1::TenantService::Client", - "rpcs": { - "CreateTenant": { - "methods": [ - "create_tenant" - ] - }, - "GetTenant": { - "methods": [ - "get_tenant" - ] - }, - "UpdateTenant": { - "methods": [ - "update_tenant" - ] - }, - "DeleteTenant": { - "methods": [ - "delete_tenant" - ] - }, - "ListTenants": { - "methods": [ - "list_tenants" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec b/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec deleted file mode 100644 index 377804f34680..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/google-cloud-talent-v4beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/talent/v4beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-talent-v4beta1" - gem.version = Google::Cloud::Talent::V4beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search to provide candidates and employers with an enhanced talent acquisition experience. Note that google-cloud-talent-v4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-talent instead. See the readme for more details." - gem.summary = "Cloud Talent Solution provides the capability to create, read, update, and delete job postings, as well as search jobs based on keywords and filters." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb deleted file mode 100644 index 53968619b7a8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google-cloud-talent-v4beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1" diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb deleted file mode 100644 index 52a7a7baa5bd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service" -require "google/cloud/talent/v4beta1/completion" -require "google/cloud/talent/v4beta1/event_service" -require "google/cloud/talent/v4beta1/job_service" -require "google/cloud/talent/v4beta1/tenant_service" -require "google/cloud/talent/v4beta1/version" - -module Google - module Cloud - module Talent - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/talent/v4beta1" - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/talent/v4beta1" - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - module V4beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v4beta1", "_helpers.rb" -require "google/cloud/talent/v4beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb deleted file mode 100644 index 1371b5a492c2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/batch_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/batch.proto - -require 'google/protobuf' - - -descriptor_data = "\n\'google/cloud/talent/v4beta1/batch.proto\x12\x1bgoogle.cloud.talent.v4beta1Bn\n\x1f\x63om.google.cloud.talent.v4beta1B\nBatchProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ - ] - 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 Talent - module V4beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb deleted file mode 100644 index 02b00f41a380..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/common_pb.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/type/latlng_pb' -require 'google/type/money_pb' -require 'google/type/postal_address_pb' - - -descriptor_data = "\n(google/cloud/talent/v4beta1/common.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x18google/type/latlng.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\"n\n\x0eTimestampRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb7\x03\n\x08Location\x12I\n\rlocation_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.Location.LocationType\x12\x32\n\x0epostal_address\x18\x02 \x01(\x0b\x32\x1a.google.type.PostalAddress\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x14\n\x0cradius_miles\x18\x04 \x01(\x01\"\xef\x01\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OUNTRY\x10\x01\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x02\x12\x1b\n\x17SUB_ADMINISTRATIVE_AREA\x10\x03\x12\x0c\n\x08LOCALITY\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x10\n\x0cSUB_LOCALITY\x10\x06\x12\x12\n\x0eSUB_LOCALITY_1\x10\x07\x12\x12\n\x0eSUB_LOCALITY_2\x10\x08\x12\x10\n\x0cNEIGHBORHOOD\x10\t\x12\x12\n\x0eSTREET_ADDRESS\x10\n\"\x9f\x01\n\x0fRequestMetadata\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x19\n\x11\x61llow_missing_ids\x18\x04 \x01(\x08\x12<\n\x0b\x64\x65vice_info\x18\x05 \x01(\x0b\x32\'.google.cloud.talent.v4beta1.DeviceInfo\"&\n\x10ResponseMetadata\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\xcf\x01\n\nDeviceInfo\x12G\n\x0b\x64\x65vice_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.DeviceInfo.DeviceType\x12\n\n\x02id\x18\x02 \x01(\t\"l\n\nDeviceType\x12\x1b\n\x17\x44\x45VICE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0e\n\nMOBILE_WEB\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x07\n\x03IOS\x10\x04\x12\x07\n\x03\x42OT\x10\x05\x12\t\n\x05OTHER\x10\x06\"m\n\x0f\x43ustomAttribute\x12\x15\n\rstring_values\x18\x01 \x03(\t\x12\x13\n\x0blong_values\x18\x02 \x03(\x03\x12\x12\n\nfilterable\x18\x03 \x01(\x08\x12\x1a\n\x12keyword_searchable\x18\x04 \x01(\x08\"W\n\x12SpellingCorrection\x12\x11\n\tcorrected\x18\x01 \x01(\x08\x12\x16\n\x0e\x63orrected_text\x18\x02 \x01(\t\x12\x16\n\x0e\x63orrected_html\x18\x03 \x01(\t\"\xa6\t\n\x10\x43ompensationInfo\x12P\n\x07\x65ntries\x18\x01 \x03(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry\x12p\n\"annualized_base_compensation_range\x18\x02 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x12q\n#annualized_total_compensation_range\x18\x03 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x1a\x92\x03\n\x11\x43ompensationEntry\x12L\n\x04type\x18\x01 \x01(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationType\x12L\n\x04unit\x18\x02 \x01(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit\x12$\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12P\n\x05range\x18\x04 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12=\n\x17\x65xpected_units_per_year\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValueB\x15\n\x13\x63ompensation_amount\x1ao\n\x11\x43ompensationRange\x12,\n\x10max_compensation\x18\x02 \x01(\x0b\x32\x12.google.type.Money\x12,\n\x10min_compensation\x18\x01 \x01(\x0b\x32\x12.google.type.Money\"\xb5\x01\n\x10\x43ompensationType\x12!\n\x1d\x43OMPENSATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42\x41SE\x10\x01\x12\t\n\x05\x42ONUS\x10\x02\x12\x11\n\rSIGNING_BONUS\x10\x03\x12\n\n\x06\x45QUITY\x10\x04\x12\x12\n\x0ePROFIT_SHARING\x10\x05\x12\x0f\n\x0b\x43OMMISSIONS\x10\x06\x12\x08\n\x04TIPS\x10\x07\x12\x1b\n\x17OTHER_COMPENSATION_TYPE\x10\x08\"\x9c\x01\n\x10\x43ompensationUnit\x12!\n\x1d\x43OMPENSATION_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06HOURLY\x10\x01\x12\t\n\x05\x44\x41ILY\x10\x02\x12\n\n\x06WEEKLY\x10\x03\x12\x0b\n\x07MONTHLY\x10\x04\x12\n\n\x06YEARLY\x10\x05\x12\x0c\n\x08ONE_TIME\x10\x06\x12\x1b\n\x17OTHER_COMPENSATION_UNIT\x10\x07\"\xcc\x03\n\x16\x42\x61tchOperationMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.BatchOperationMetadata.State\x12\x19\n\x11state_description\x18\x02 \x01(\t\x12\x15\n\rsuccess_count\x18\x03 \x01(\x05\x12\x15\n\rfailure_count\x18\x04 \x01(\x05\x12\x13\n\x0btotal_count\x18\x05 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"z\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06*y\n\x0b\x43ompanySize\x12\x1c\n\x18\x43OMPANY_SIZE_UNSPECIFIED\x10\x00\x12\x08\n\x04MINI\x10\x01\x12\t\n\x05SMALL\x10\x02\x12\x0b\n\x07SMEDIUM\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x07\n\x03\x42IG\x10\x05\x12\n\n\x06\x42IGGER\x10\x06\x12\t\n\x05GIANT\x10\x07*\xe2\x01\n\nJobBenefit\x12\x1b\n\x17JOB_BENEFIT_UNSPECIFIED\x10\x00\x12\x0e\n\nCHILD_CARE\x10\x01\x12\n\n\x06\x44\x45NTAL\x10\x02\x12\x14\n\x10\x44OMESTIC_PARTNER\x10\x03\x12\x12\n\x0e\x46LEXIBLE_HOURS\x10\x04\x12\x0b\n\x07MEDICAL\x10\x05\x12\x12\n\x0eLIFE_INSURANCE\x10\x06\x12\x12\n\x0ePARENTAL_LEAVE\x10\x07\x12\x13\n\x0fRETIREMENT_PLAN\x10\x08\x12\r\n\tSICK_DAYS\x10\t\x12\x0c\n\x08VACATION\x10\n\x12\n\n\x06VISION\x10\x0b*\x8e\x02\n\nDegreeType\x12\x1b\n\x17\x44\x45GREE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PRIMARY_EDUCATION\x10\x01\x12\x1d\n\x19LOWER_SECONDARY_EDUCATION\x10\x02\x12\x1d\n\x19UPPER_SECONDARY_EDUCATION\x10\x03\x12\x1c\n\x18\x41\x44ULT_REMEDIAL_EDUCATION\x10\x04\x12\x1c\n\x18\x41SSOCIATES_OR_EQUIVALENT\x10\x05\x12\x1b\n\x17\x42\x41\x43HELORS_OR_EQUIVALENT\x10\x06\x12\x19\n\x15MASTERS_OR_EQUIVALENT\x10\x07\x12\x1a\n\x16\x44OCTORAL_OR_EQUIVALENT\x10\x08*\xdc\x01\n\x0e\x45mploymentType\x12\x1f\n\x1b\x45MPLOYMENT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFULL_TIME\x10\x01\x12\r\n\tPART_TIME\x10\x02\x12\x0e\n\nCONTRACTOR\x10\x03\x12\x14\n\x10\x43ONTRACT_TO_HIRE\x10\x04\x12\r\n\tTEMPORARY\x10\x05\x12\n\n\x06INTERN\x10\x06\x12\r\n\tVOLUNTEER\x10\x07\x12\x0c\n\x08PER_DIEM\x10\x08\x12\x12\n\x0e\x46LY_IN_FLY_OUT\x10\t\x12\x19\n\x15OTHER_EMPLOYMENT_TYPE\x10\n*q\n\x08JobLevel\x12\x19\n\x15JOB_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45NTRY_LEVEL\x10\x01\x12\x0f\n\x0b\x45XPERIENCED\x10\x02\x12\x0b\n\x07MANAGER\x10\x03\x12\x0c\n\x08\x44IRECTOR\x10\x04\x12\r\n\tEXECUTIVE\x10\x05*\xba\x06\n\x0bJobCategory\x12\x1c\n\x18JOB_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41\x43\x43OUNTING_AND_FINANCE\x10\x01\x12\x1d\n\x19\x41\x44MINISTRATIVE_AND_OFFICE\x10\x02\x12\x1d\n\x19\x41\x44VERTISING_AND_MARKETING\x10\x03\x12\x0f\n\x0b\x41NIMAL_CARE\x10\x04\x12\x1a\n\x16\x41RT_FASHION_AND_DESIGN\x10\x05\x12\x17\n\x13\x42USINESS_OPERATIONS\x10\x06\x12\x1b\n\x17\x43LEANING_AND_FACILITIES\x10\x07\x12\x13\n\x0f\x43OMPUTER_AND_IT\x10\x08\x12\x10\n\x0c\x43ONSTRUCTION\x10\t\x12\x14\n\x10\x43USTOMER_SERVICE\x10\n\x12\r\n\tEDUCATION\x10\x0b\x12\x1c\n\x18\x45NTERTAINMENT_AND_TRAVEL\x10\x0c\x12\x18\n\x14\x46\x41RMING_AND_OUTDOORS\x10\r\x12\x0e\n\nHEALTHCARE\x10\x0e\x12\x13\n\x0fHUMAN_RESOURCES\x10\x0f\x12\'\n#INSTALLATION_MAINTENANCE_AND_REPAIR\x10\x10\x12\t\n\x05LEGAL\x10\x11\x12\x0e\n\nMANAGEMENT\x10\x12\x12\x1f\n\x1bMANUFACTURING_AND_WAREHOUSE\x10\x13\x12$\n MEDIA_COMMUNICATIONS_AND_WRITING\x10\x14\x12\x16\n\x12OIL_GAS_AND_MINING\x10\x15\x12\x1e\n\x1aPERSONAL_CARE_AND_SERVICES\x10\x16\x12\x17\n\x13PROTECTIVE_SERVICES\x10\x17\x12\x0f\n\x0bREAL_ESTATE\x10\x18\x12\x1e\n\x1aRESTAURANT_AND_HOSPITALITY\x10\x19\x12\x14\n\x10SALES_AND_RETAIL\x10\x1a\x12\x1b\n\x17SCIENCE_AND_ENGINEERING\x10\x1b\x12\"\n\x1eSOCIAL_SERVICES_AND_NON_PROFIT\x10\x1c\x12!\n\x1dSPORTS_FITNESS_AND_RECREATION\x10\x1d\x12 \n\x1cTRANSPORTATION_AND_LOGISTICS\x10\x1e*e\n\rPostingRegion\x12\x1e\n\x1aPOSTING_REGION_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x01\x12\n\n\x06NATION\x10\x02\x12\x0f\n\x0bTELECOMMUTE\x10\x03*n\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x41\x43\x43OUNT_ONLY\x10\x01\x12\x16\n\x12SHARED_WITH_GOOGLE\x10\x02\x12\x16\n\x12SHARED_WITH_PUBLIC\x10\x03\x1a\x02\x18\x01*q\n\x10HtmlSanitization\x12!\n\x1dHTML_SANITIZATION_UNSPECIFIED\x10\x00\x12\x1e\n\x1aHTML_SANITIZATION_DISABLED\x10\x01\x12\x1a\n\x16SIMPLE_FORMATTING_ONLY\x10\x02*c\n\rCommuteMethod\x12\x1e\n\x1a\x43OMMUTE_METHOD_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44RIVING\x10\x01\x12\x0b\n\x07TRANSIT\x10\x02\x12\x0b\n\x07WALKING\x10\x03\x12\x0b\n\x07\x43YCLING\x10\x04\x42o\n\x1f\x63om.google.cloud.talent.v4beta1B\x0b\x43ommonProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.type.PostalAddress", "google/type/postal_address.proto"], - ["google.type.LatLng", "google/type/latlng.proto"], - ["google.type.Money", "google/type/money.proto"], - ["google.protobuf.DoubleValue", "google/protobuf/wrappers.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 Talent - module V4beta1 - TimestampRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.TimestampRange").msgclass - Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Location").msgclass - Location::LocationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Location.LocationType").enummodule - RequestMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.RequestMetadata").msgclass - ResponseMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ResponseMetadata").msgclass - DeviceInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeviceInfo").msgclass - DeviceInfo::DeviceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeviceInfo.DeviceType").enummodule - CustomAttribute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CustomAttribute").msgclass - SpellingCorrection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SpellingCorrection").msgclass - CompensationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo").msgclass - CompensationInfo::CompensationEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry").msgclass - CompensationInfo::CompensationRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationRange").msgclass - CompensationInfo::CompensationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationType").enummodule - CompensationInfo::CompensationUnit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit").enummodule - BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchOperationMetadata").msgclass - BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchOperationMetadata.State").enummodule - CompanySize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompanySize").enummodule - JobBenefit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobBenefit").enummodule - DegreeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DegreeType").enummodule - EmploymentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.EmploymentType").enummodule - JobLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobLevel").enummodule - JobCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobCategory").enummodule - PostingRegion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.PostingRegion").enummodule - Visibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Visibility").enummodule - HtmlSanitization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.HtmlSanitization").enummodule - CommuteMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CommuteMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb deleted file mode 100644 index 2201405030f8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/company.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4beta1/common_pb' - - -descriptor_data = "\n)google/cloud/talent/v4beta1/company.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\"\x80\x05\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x65xternal_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x04size\x18\x04 \x01(\x0e\x32(.google.cloud.talent.v4beta1.CompanySize\x12\x1c\n\x14headquarters_address\x18\x05 \x01(\t\x12\x15\n\rhiring_agency\x18\x06 \x01(\x08\x12\x10\n\x08\x65\x65o_text\x18\x07 \x01(\t\x12\x13\n\x0bwebsite_uri\x18\x08 \x01(\t\x12\x17\n\x0f\x63\x61reer_site_uri\x18\t \x01(\t\x12\x11\n\timage_uri\x18\n \x01(\t\x12\x34\n(keyword_searchable_job_custom_attributes\x18\x0b \x03(\tB\x02\x18\x01\x12K\n\x0c\x64\x65rived_info\x18\x0c \x01(\x0b\x32\x30.google.cloud.talent.v4beta1.Company.DerivedInfoB\x03\xe0\x41\x03\x12\x16\n\tsuspended\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x1aS\n\x0b\x44\x65rivedInfo\x12\x44\n\x15headquarters_location\x18\x01 \x01(\x0b\x32%.google.cloud.talent.v4beta1.Location:\x81\x01\xea\x41~\n\x1bjobs.googleapis.com/Company\x12\x37projects/{project}/tenants/{tenant}/companies/{company}\x12&projects/{project}/companies/{company}Bx\n\x1f\x63om.google.cloud.talent.v4beta1B\x14\x43ompanyResourceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Location", "google/cloud/talent/v4beta1/common.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 Talent - module V4beta1 - Company = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company").msgclass - Company::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company.DerivedInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb deleted file mode 100644 index 4478c38d82e3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/company_service/credentials" -require "google/cloud/talent/v4beta1/company_service/paths" -require "google/cloud/talent/v4beta1/company_service/client" -require "google/cloud/talent/v4beta1/company_service/rest" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service that handles company management, including CRUD and enumeration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4beta1/company_service" - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4beta1/company_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - module CompanyService - end - end - end - end -end - -helper_path = ::File.join __dir__, "company_service", "helpers.rb" -require "google/cloud/talent/v4beta1/company_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb deleted file mode 100644 index 9763c82b34b0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/client.rb +++ /dev/null @@ -1,920 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module CompanyService - ## - # Client for the CompanyService service. - # - # A service that handles company management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :company_service_stub - - ## - # Configure the CompanyService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::CompanyService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompanyService clients - # ::Google::Cloud::Talent::V4beta1::CompanyService::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", "Talent", "V4beta1"] - 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_company.timeout = 30.0 - - default_config.rpcs.get_company.timeout = 30.0 - default_config.rpcs.get_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_company.timeout = 30.0 - - default_config.rpcs.delete_company.timeout = 30.0 - default_config.rpcs.delete_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_companies.timeout = 30.0 - default_config.rpcs.list_companies.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompanyService 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::Talent::V4beta1::CompanyService::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 - @company_service_stub.universe_domain - end - - ## - # Create a new CompanyService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompanyService 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/talent/v4beta1/company_service_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 - - @company_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4beta1::CompanyService::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, - logger: @config.logger - ) - - @company_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @company_service_stub.logger - end - - # Service calls - - ## - # Creates a new company entity. - # - # @overload create_company(request, options = nil) - # Pass arguments to `create_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) - # Pass arguments to `create_company` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created, for example, "projects/foo". - # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] - # Required. The company to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new - # - # # Call the create_company method. - # result = client.create_company request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - # p result - # - def create_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :create_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified company. - # - # @overload get_company(request, options = nil) - # Pass arguments to `get_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::GetCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `get_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/api-test-project/companies/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new - # - # # Call the get_company method. - # result = client.get_company request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - # p result - # - def get_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :get_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified company. - # - # @overload update_company(request, options = nil) - # Pass arguments to `update_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) - # Pass arguments to `update_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] - # Required. The company resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are - # updated. Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Company Company} are - # supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Company] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new - # - # # Call the update_company method. - # result = client.update_company request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - # p result - # - def update_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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.company&.name - header_params["company.name"] = request.company.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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :update_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified company. - # Prerequisite: The company has no jobs associated with it. - # - # @overload delete_company(request, options = nil) - # Pass arguments to `delete_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `delete_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo/companies/bar". - # - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new - # - # # Call the delete_company method. - # result = client.delete_company request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :delete_company, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all companies associated with the project. - # - # @overload list_companies(request, options = nil) - # Pass arguments to `list_companies` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) - # Pass arguments to `list_companies` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". - # - # If tenant id is unspecified, the default tenant will be used, for - # example, "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @param require_open_jobs [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new - # - # # Call the list_companies method. - # result = client.list_companies 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::Talent::V4beta1::Company. - # p item - # end - # - def list_companies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest - - # Converts hash 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_companies.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::Talent::V4beta1::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_companies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_companies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.call_rpc :list_companies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @company_service_stub, :list_companies, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CompanyService API. - # - # This class represents the configuration for CompanyService, - # 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::Talent::V4beta1::CompanyService::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_company to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::CompanyService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CompanyService 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_company` - # @return [::Gapic::Config::Method] - # - attr_reader :create_company - ## - # RPC-specific configuration for `get_company` - # @return [::Gapic::Config::Method] - # - attr_reader :get_company - ## - # RPC-specific configuration for `update_company` - # @return [::Gapic::Config::Method] - # - attr_reader :update_company - ## - # RPC-specific configuration for `delete_company` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_company - ## - # RPC-specific configuration for `list_companies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_companies - - # @private - def initialize parent_rpcs = nil - create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company - @create_company = ::Gapic::Config::Method.new create_company_config - get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company - @get_company = ::Gapic::Config::Method.new get_company_config - update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company - @update_company = ::Gapic::Config::Method.new update_company_config - delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company - @delete_company = ::Gapic::Config::Method.new delete_company_config - list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies - @list_companies = ::Gapic::Config::Method.new list_companies_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb deleted file mode 100644 index 9856588eab54..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module CompanyService - # Credentials for the CompanyService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb deleted file mode 100644 index dee2daa131de..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/paths.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module CompanyService - # Path helper methods for the CompanyService API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # @overload company_path(project:, tenant:, company:) - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @overload company_path(project:, company:) - # The resource will be in the following format: - # - # `projects/{project}/companies/{company}` - # - # @param project [String] - # @param company [String] - # - # @return [::String] - def company_path **args - resources = { - "company:project:tenant" => (proc do |project:, tenant:, company:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end), - "company:project" => (proc do |project:, company:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/companies/#{company}" - 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 Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb deleted file mode 100644 index e0bde75185ad..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/company_service/credentials" -require "google/cloud/talent/v4beta1/company_service/paths" -require "google/cloud/talent/v4beta1/company_service/rest/client" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service that handles company management, including CRUD and enumeration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4beta1/company_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - module CompanyService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4beta1/company_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb deleted file mode 100644 index df00c372ce9f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +++ /dev/null @@ -1,842 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" -require "google/cloud/talent/v4beta1/company_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4beta1 - module CompanyService - module Rest - ## - # REST client for the CompanyService service. - # - # A service that handles company management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :company_service_stub - - ## - # Configure the CompanyService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CompanyService clients - # ::Google::Cloud::Talent::V4beta1::CompanyService::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", "Talent", "V4beta1"] - 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_company.timeout = 30.0 - - default_config.rpcs.get_company.timeout = 30.0 - default_config.rpcs.get_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_company.timeout = 30.0 - - default_config.rpcs.delete_company.timeout = 30.0 - default_config.rpcs.delete_company.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_companies.timeout = 30.0 - default_config.rpcs.list_companies.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CompanyService 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::Talent::V4beta1::CompanyService::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 - @company_service_stub.universe_domain - end - - ## - # Create a new CompanyService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CompanyService 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 - - @company_service_stub = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @company_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @company_service_stub.logger - end - - # Service calls - - ## - # Creates a new company entity. - # - # @overload create_company(request, options = nil) - # Pass arguments to `create_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(parent: nil, company: nil) - # Pass arguments to `create_company` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created, for example, "projects/foo". - # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] - # Required. The company to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new - # - # # Call the create_company method. - # result = client.create_company request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - # p result - # - def create_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.create_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified company. - # - # @overload get_company(request, options = nil) - # Pass arguments to `get_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::GetCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `get_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/api-test-project/companies/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new - # - # # Call the get_company method. - # result = client.get_company request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - # p result - # - def get_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.get_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified company. - # - # @overload update_company(request, options = nil) - # Pass arguments to `update_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(company: nil, update_mask: nil) - # Pass arguments to `update_company` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash] - # Required. The company resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are - # updated. Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Company Company} are - # supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new - # - # # Call the update_company method. - # result = client.update_company request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - # p result - # - def update_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.update_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified company. - # Prerequisite: The company has no jobs associated with it. - # - # @overload delete_company(request, options = nil) - # Pass arguments to `delete_company` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_company(name: nil) - # Pass arguments to `delete_company` via keyword arguments. Note that at - # least one keyword argument is 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 company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo/companies/bar". - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new - # - # # Call the delete_company method. - # result = client.delete_company request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_company request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest - - # Converts hash 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_company.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::Talent::V4beta1::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_company.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_company.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.delete_company request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all companies associated with the project. - # - # @overload list_companies(request, options = nil) - # Pass arguments to `list_companies` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil) - # Pass arguments to `list_companies` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". - # - # If tenant id is unspecified, the default tenant will be used, for - # example, "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @param require_open_jobs [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new - # - # # Call the list_companies method. - # result = client.list_companies 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::Talent::V4beta1::Company. - # p item - # end - # - def list_companies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest - - # Converts hash 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_companies.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::Talent::V4beta1::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_companies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_companies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @company_service_stub.list_companies request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CompanyService REST API. - # - # This class represents the configuration for CompanyService 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::Talent::V4beta1::CompanyService::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_company to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_company.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CompanyService 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_company` - # @return [::Gapic::Config::Method] - # - attr_reader :create_company - ## - # RPC-specific configuration for `get_company` - # @return [::Gapic::Config::Method] - # - attr_reader :get_company - ## - # RPC-specific configuration for `update_company` - # @return [::Gapic::Config::Method] - # - attr_reader :update_company - ## - # RPC-specific configuration for `delete_company` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_company - ## - # RPC-specific configuration for `list_companies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_companies - - # @private - def initialize parent_rpcs = nil - create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company - @create_company = ::Gapic::Config::Method.new create_company_config - get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company - @get_company = ::Gapic::Config::Method.new get_company_config - update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company - @update_company = ::Gapic::Config::Method.new update_company_config - delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company - @delete_company = ::Gapic::Config::Method.new delete_company_config - list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies - @list_companies = ::Gapic::Config::Method.new list_companies_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb deleted file mode 100644 index 34eb591b219f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +++ /dev/null @@ -1,425 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module CompanyService - module Rest - ## - # REST service stub for the CompanyService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest] - # 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::Talent::V4beta1::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # A result object deserialized from the server's reply - def create_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_company_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, - method_name: "create_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::GetCompanyRequest] - # 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::Talent::V4beta1::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # A result object deserialized from the server's reply - def get_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_company_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, - method_name: "get_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest] - # 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::Talent::V4beta1::Company] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Company] - # A result object deserialized from the server's reply - def update_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_company_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, - method_name: "update_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Company.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest] - # 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_company request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_company_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, - method_name: "delete_company", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_companies REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest] - # 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::Talent::V4beta1::ListCompaniesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::ListCompaniesResponse] - # A result object deserialized from the server's reply - def list_companies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_companies_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, - method_name: "list_companies", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/companies", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/companies", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::GetCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v4beta1/{company.name}", - body: "*", - matches: [ - ["company.name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v4beta1/{company.name}", - body: "*", - matches: [ - ["company.name", %r{^projects/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_company REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest] - # 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_company_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/companies/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/companies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_companies REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest] - # 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_companies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{parent}/companies", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{parent}/companies", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb deleted file mode 100644 index 8297b6a2911e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/company_service.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/talent/v4beta1/common_pb' -require 'google/cloud/talent/v4beta1/company_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n1google/cloud/talent/v4beta1/company_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a)google/cloud/talent/v4beta1/company.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x87\x01\n\x14\x43reateCompanyRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12:\n\x07\x63ompany\x18\x02 \x01(\x0b\x32$.google.cloud.talent.v4beta1.CompanyB\x03\xe0\x41\x02\"F\n\x11GetCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x83\x01\n\x14UpdateCompanyRequest\x12:\n\x07\x63ompany\x18\x01 \x01(\x0b\x32$.google.cloud.talent.v4beta1.CompanyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x14\x44\x65leteCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\"\x8d\x01\n\x14ListCompaniesRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x19\n\x11require_open_jobs\x18\x04 \x01(\x08\"\xaa\x01\n\x15ListCompaniesResponse\x12\x37\n\tcompanies\x18\x01 \x03(\x0b\x32$.google.cloud.talent.v4beta1.Company\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata2\xd2\t\n\x0e\x43ompanyService\x12\xe3\x01\n\rCreateCompany\x12\x31.google.cloud.talent.v4beta1.CreateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"y\xda\x41\x0eparent,company\x82\xd3\xe4\x93\x02\x62\"0/v4beta1/{parent=projects/*/tenants/*}/companies:\x01*Z+\"&/v4beta1/{parent=projects/*}/companies:\x01*\x12\xcd\x01\n\nGetCompany\x12..google.cloud.talent.v4beta1.GetCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{name=projects/*/tenants/*/companies/*}Z(\x12&/v4beta1/{name=projects/*/companies/*}\x12\xed\x01\n\rUpdateCompany\x12\x31.google.cloud.talent.v4beta1.UpdateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company\"\x82\x01\xda\x41\x07\x63ompany\x82\xd3\xe4\x93\x02r28/v4beta1/{company.name=projects/*/tenants/*/companies/*}:\x01*Z32./v4beta1/{company.name=projects/*/companies/*}:\x01*\x12\xc5\x01\n\rDeleteCompany\x12\x31.google.cloud.talent.v4beta1.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\*0/v4beta1/{name=projects/*/tenants/*/companies/*}Z(*&/v4beta1/{name=projects/*/companies/*}\x12\xe3\x01\n\rListCompanies\x12\x31.google.cloud.talent.v4beta1.ListCompaniesRequest\x1a\x32.google.cloud.talent.v4beta1.ListCompaniesResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{parent=projects/*/tenants/*}/companiesZ(\x12&/v4beta1/{parent=projects/*}/companies\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBw\n\x1f\x63om.google.cloud.talent.v4beta1B\x13\x43ompanyServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Company", "google/cloud/talent/v4beta1/company.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.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 Talent - module V4beta1 - CreateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateCompanyRequest").msgclass - GetCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetCompanyRequest").msgclass - UpdateCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateCompanyRequest").msgclass - DeleteCompanyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteCompanyRequest").msgclass - ListCompaniesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesRequest").msgclass - ListCompaniesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb deleted file mode 100644 index 1ca2bca7f790..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4beta1/company_service.proto for package 'google.cloud.talent.v4beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4beta1/company_service_pb' - -module Google - module Cloud - module Talent - module V4beta1 - module CompanyService - # A service that handles company management, including CRUD and enumeration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4beta1.CompanyService' - - # Creates a new company entity. - rpc :CreateCompany, ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company - # Retrieves specified company. - rpc :GetCompany, ::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company - # Updates specified company. - rpc :UpdateCompany, ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Google::Cloud::Talent::V4beta1::Company - # Deletes specified company. - # Prerequisite: The company has no jobs associated with it. - rpc :DeleteCompany, ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Google::Protobuf::Empty - # Lists all companies associated with the project. - rpc :ListCompanies, ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb deleted file mode 100644 index 962a8cd878ed..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/completion/credentials" -require "google/cloud/talent/v4beta1/completion/paths" -require "google/cloud/talent/v4beta1/completion/client" -require "google/cloud/talent/v4beta1/completion/rest" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service handles auto completion. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4beta1/completion" - # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4beta1/completion/rest" - # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new - # - module Completion - end - end - end - end -end - -helper_path = ::File.join __dir__, "completion", "helpers.rb" -require "google/cloud/talent/v4beta1/completion/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb deleted file mode 100644 index 8823298d5537..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/client.rb +++ /dev/null @@ -1,516 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module Completion - ## - # Client for the Completion service. - # - # A service handles auto completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_stub - - ## - # Configure the Completion Client class. - # - # See {::Google::Cloud::Talent::V4beta1::Completion::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Completion clients - # ::Google::Cloud::Talent::V4beta1::Completion::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", "Talent", "V4beta1"] - 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.complete_query.timeout = 30.0 - default_config.rpcs.complete_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Completion 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::Talent::V4beta1::Completion::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 - @completion_stub.universe_domain - end - - ## - # Create a new Completion client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Completion 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/talent/v4beta1/completion_service_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 - - @completion_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4beta1::Completion::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, - logger: @config.logger - ) - - @completion_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @completion_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload complete_query(parent: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo". - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param language_codes [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @param page_size [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @param company [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo". - # @param scope [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @param type [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::Completion::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest - - # Converts hash 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.complete_query.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::Talent::V4beta1::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.complete_query.timeout, - metadata: metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_stub.call_rpc :complete_query, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Completion API. - # - # This class represents the configuration for Completion, - # 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::Talent::V4beta1::Completion::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 - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::Completion::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 Completion 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 `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb deleted file mode 100644 index 1ad8d592642a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module Completion - # Credentials for the Completion API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb deleted file mode 100644 index 119c1f449fff..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/paths.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module Completion - # Path helper methods for the Completion API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # @overload company_path(project:, tenant:, company:) - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @overload company_path(project:, company:) - # The resource will be in the following format: - # - # `projects/{project}/companies/{company}` - # - # @param project [String] - # @param company [String] - # - # @return [::String] - def company_path **args - resources = { - "company:project:tenant" => (proc do |project:, tenant:, company:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end), - "company:project" => (proc do |project:, company:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/companies/#{company}" - 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 Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb deleted file mode 100644 index d14c1d1d8a77..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/completion/credentials" -require "google/cloud/talent/v4beta1/completion/paths" -require "google/cloud/talent/v4beta1/completion/rest/client" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service handles auto completion. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4beta1/completion/rest" - # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new - # - module Completion - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4beta1/completion/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb deleted file mode 100644 index 88bd8c435600..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +++ /dev/null @@ -1,466 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" -require "google/cloud/talent/v4beta1/completion/rest/service_stub" - -module Google - module Cloud - module Talent - module V4beta1 - module Completion - module Rest - ## - # REST client for the Completion service. - # - # A service handles auto completion. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :completion_stub - - ## - # Configure the Completion Client class. - # - # See {::Google::Cloud::Talent::V4beta1::Completion::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Completion clients - # ::Google::Cloud::Talent::V4beta1::Completion::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", "Talent", "V4beta1"] - 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.complete_query.timeout = 30.0 - default_config.rpcs.complete_query.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Completion 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::Talent::V4beta1::Completion::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 - @completion_stub.universe_domain - end - - ## - # Create a new Completion REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Completion 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 - - @completion_stub = ::Google::Cloud::Talent::V4beta1::Completion::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @completion_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @completion_stub.logger - end - - # Service calls - - ## - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - # - # @overload complete_query(request, options = nil) - # Pass arguments to `complete_query` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload complete_query(parent: nil, query: nil, language_codes: nil, page_size: nil, company: nil, scope: nil, type: nil) - # Pass arguments to `complete_query` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo". - # @param query [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @param language_codes [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @param page_size [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @param company [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo". - # @param scope [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @param type [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new - # - # # Call the complete_query method. - # result = client.complete_query request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. - # p result - # - def complete_query request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest - - # Converts hash 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.complete_query.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::Talent::V4beta1::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.complete_query.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.complete_query.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @completion_stub.complete_query request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Completion REST API. - # - # This class represents the configuration for Completion 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::Talent::V4beta1::Completion::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 - # # complete_query to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.complete_query.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 Completion 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 `complete_query` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_query - - # @private - def initialize parent_rpcs = nil - complete_query_config = parent_rpcs.complete_query if parent_rpcs.respond_to? :complete_query - @complete_query = ::Gapic::Config::Method.new complete_query_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb deleted file mode 100644 index c6c52bc71a69..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +++ /dev/null @@ -1,149 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module Completion - module Rest - ## - # REST service stub for the Completion service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the complete_query REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest] - # 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::Talent::V4beta1::CompleteQueryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryResponse] - # A result object deserialized from the server's reply - def complete_query request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_complete_query_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, - method_name: "complete_query", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the complete_query REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_complete_query_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{parent}:complete", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{parent}:complete", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb deleted file mode 100644 index 672958f7e967..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/completion_service.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/talent/v4beta1/common_pb' - - -descriptor_data = "\n4google/cloud/talent/v4beta1/completion_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\"\x93\x04\n\x14\x43ompleteQueryRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12P\n\x05scope\x18\x06 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope\x12N\n\x04type\x18\x07 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType\"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02\"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03\"\xc5\x02\n\x15\x43ompleteQueryResponse\x12_\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult\x12?\n\x08metadata\x18\x02 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x1a\x89\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12N\n\x04type\x18\x02 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xd5\x02\n\nCompletion\x12\xd8\x01\n\rCompleteQuery\x12\x31.google.cloud.talent.v4beta1.CompleteQueryRequest\x1a\x32.google.cloud.talent.v4beta1.CompleteQueryResponse\"`\x82\xd3\xe4\x93\x02Z\x12//v4beta1/{parent=projects/*/tenants/*}:completeZ\'\x12%/v4beta1/{parent=projects/*}:complete\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBz\n\x1f\x63om.google.cloud.talent.v4beta1B\x16\x43ompletionServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.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 Talent - module V4beta1 - CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest").msgclass - CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope").enummodule - CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType").enummodule - CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryResponse").msgclass - CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb deleted file mode 100644 index cb146eb364f4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4beta1/completion_service.proto for package 'google.cloud.talent.v4beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4beta1/completion_service_pb' - -module Google - module Cloud - module Talent - module V4beta1 - module Completion - # A service handles auto completion. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4beta1.Completion' - - # Completes the specified prefix with keyword suggestions. - # Intended for use by a job search auto-complete search box. - rpc :CompleteQuery, ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb deleted file mode 100644 index a8549bc825db..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/event.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\'google/cloud/talent/v4beta1/event.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc8\x01\n\x0b\x43lientEvent\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12:\n\tjob_event\x18\x05 \x01(\x0b\x32%.google.cloud.talent.v4beta1.JobEventH\x00\x12\x13\n\x0b\x65vent_notes\x18\t \x01(\tB\x07\n\x05\x65vent\"\xf6\x03\n\x08JobEvent\x12\x45\n\x04type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.JobEvent.JobEventTypeB\x03\xe0\x41\x02\x12\x11\n\x04jobs\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x0f\n\x07profile\x18\x03 \x01(\t\"\xfe\x02\n\x0cJobEventType\x12\x1e\n\x1aJOB_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x11\n\rVIEW_REDIRECT\x10\x03\x12\x15\n\x11\x41PPLICATION_START\x10\x04\x12\x16\n\x12\x41PPLICATION_FINISH\x10\x05\x12 \n\x1c\x41PPLICATION_QUICK_SUBMISSION\x10\x06\x12\x18\n\x14\x41PPLICATION_REDIRECT\x10\x07\x12!\n\x1d\x41PPLICATION_START_FROM_SEARCH\x10\x08\x12$\n APPLICATION_REDIRECT_FROM_SEARCH\x10\t\x12\x1e\n\x1a\x41PPLICATION_COMPANY_SUBMIT\x10\n\x12\x0c\n\x08\x42OOKMARK\x10\x0b\x12\x10\n\x0cNOTIFICATION\x10\x0c\x12\t\n\x05HIRED\x10\r\x12\x0b\n\x07SENT_CV\x10\x0e\x12\x15\n\x11INTERVIEW_GRANTED\x10\x0f\x42n\n\x1f\x63om.google.cloud.talent.v4beta1B\nEventProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 Talent - module V4beta1 - ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ClientEvent").msgclass - JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobEvent").msgclass - JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobEvent.JobEventType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb deleted file mode 100644 index b3704c176961..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/event_service/credentials" -require "google/cloud/talent/v4beta1/event_service/paths" -require "google/cloud/talent/v4beta1/event_service/client" -require "google/cloud/talent/v4beta1/event_service/rest" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service handles client event report. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4beta1/event_service" - # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4beta1/event_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new - # - module EventService - end - end - end - end -end - -helper_path = ::File.join __dir__, "event_service", "helpers.rb" -require "google/cloud/talent/v4beta1/event_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb deleted file mode 100644 index d94cdcbc9010..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/client.rb +++ /dev/null @@ -1,489 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module EventService - ## - # Client for the EventService service. - # - # A service handles client event report. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :event_service_stub - - ## - # Configure the EventService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::EventService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EventService clients - # ::Google::Cloud::Talent::V4beta1::EventService::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", "Talent", "V4beta1"] - 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_client_event.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EventService 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::Talent::V4beta1::EventService::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 - @event_service_stub.universe_domain - end - - ## - # Create a new EventService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EventService 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/talent/v4beta1/event_service_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 - - @event_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4beta1::EventService::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, - logger: @config.logger - ) - - @event_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @event_service_stub.logger - end - - # Service calls - - ## - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - # - # @overload create_client_event(request, options = nil) - # Pass arguments to `create_client_event` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateClientEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) - # Pass arguments to `create_client_event` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created, for example, "projects/foo". - # @param client_event [::Google::Cloud::Talent::V4beta1::ClientEvent, ::Hash] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::ClientEvent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::EventService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new - # - # # Call the create_client_event method. - # result = client.create_client_event request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. - # p result - # - def create_client_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest - - # Converts hash 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_client_event.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::Talent::V4beta1::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_client_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_client_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @event_service_stub.call_rpc :create_client_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EventService API. - # - # This class represents the configuration for EventService, - # 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::Talent::V4beta1::EventService::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_client_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::EventService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 EventService 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_client_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_client_event - - # @private - def initialize parent_rpcs = nil - create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event - @create_client_event = ::Gapic::Config::Method.new create_client_event_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb deleted file mode 100644 index 052cdab2a579..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module EventService - # Credentials for the EventService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb deleted file mode 100644 index a4194eda5367..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/paths.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module EventService - # Path helper methods for the EventService API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb deleted file mode 100644 index 5239cc30ff54..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/event_service/credentials" -require "google/cloud/talent/v4beta1/event_service/paths" -require "google/cloud/talent/v4beta1/event_service/rest/client" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service handles client event report. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4beta1/event_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new - # - module EventService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4beta1/event_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb deleted file mode 100644 index ceb888dfea87..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +++ /dev/null @@ -1,439 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" -require "google/cloud/talent/v4beta1/event_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4beta1 - module EventService - module Rest - ## - # REST client for the EventService service. - # - # A service handles client event report. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :event_service_stub - - ## - # Configure the EventService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::EventService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EventService clients - # ::Google::Cloud::Talent::V4beta1::EventService::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", "Talent", "V4beta1"] - 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_client_event.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EventService 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::Talent::V4beta1::EventService::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 - @event_service_stub.universe_domain - end - - ## - # Create a new EventService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EventService 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 - - @event_service_stub = ::Google::Cloud::Talent::V4beta1::EventService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @event_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @event_service_stub.logger - end - - # Service calls - - ## - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - # - # @overload create_client_event(request, options = nil) - # Pass arguments to `create_client_event` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateClientEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_client_event(parent: nil, client_event: nil) - # Pass arguments to `create_client_event` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created, for example, "projects/foo". - # @param client_event [::Google::Cloud::Talent::V4beta1::ClientEvent, ::Hash] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::ClientEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new - # - # # Call the create_client_event method. - # result = client.create_client_event request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. - # p result - # - def create_client_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest - - # Converts hash 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_client_event.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::Talent::V4beta1::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_client_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_client_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @event_service_stub.create_client_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the EventService REST API. - # - # This class represents the configuration for EventService 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::Talent::V4beta1::EventService::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_client_event to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_client_event.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 EventService 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_client_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_client_event - - # @private - def initialize parent_rpcs = nil - create_client_event_config = parent_rpcs.create_client_event if parent_rpcs.respond_to? :create_client_event - @create_client_event = ::Gapic::Config::Method.new create_client_event_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb deleted file mode 100644 index 0cc940fc633c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +++ /dev/null @@ -1,151 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module EventService - module Rest - ## - # REST service stub for the EventService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_client_event REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest] - # 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::Talent::V4beta1::ClientEvent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] - # A result object deserialized from the server's reply - def create_client_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_client_event_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, - method_name: "create_client_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ClientEvent.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_client_event REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateClientEventRequest] - # 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_client_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/clientEvents", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/clientEvents", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb deleted file mode 100644 index 708fe89b9de8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/event_service.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/talent/v4beta1/event_pb' - - -descriptor_data = "\n/google/cloud/talent/v4beta1/event_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/talent/v4beta1/event.proto\"\x94\x01\n\x18\x43reateClientEventRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12\x43\n\x0c\x63lient_event\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4beta1.ClientEventB\x03\xe0\x41\x02\x32\xfa\x02\n\x0c\x45ventService\x12\xfb\x01\n\x11\x43reateClientEvent\x12\x35.google.cloud.talent.v4beta1.CreateClientEventRequest\x1a(.google.cloud.talent.v4beta1.ClientEvent\"\x84\x01\xda\x41\x13parent,client_event\x82\xd3\xe4\x93\x02h\"3/v4beta1/{parent=projects/*/tenants/*}/clientEvents:\x01*Z.\")/v4beta1/{parent=projects/*}/clientEvents:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBu\n\x1f\x63om.google.cloud.talent.v4beta1B\x11\x45ventServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.ClientEvent", "google/cloud/talent/v4beta1/event.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 Talent - module V4beta1 - CreateClientEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateClientEventRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb deleted file mode 100644 index d4e95cc457ad..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4beta1/event_service.proto for package 'google.cloud.talent.v4beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4beta1/event_service_pb' - -module Google - module Cloud - module Talent - module V4beta1 - module EventService - # A service handles client event report. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4beta1.EventService' - - # Report events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. You may inspect the created events in - # [self service - # tools](https://console.cloud.google.com/talent-solution/overview). - # [Learn - # more](https://cloud.google.com/talent-solution/docs/management-tools) - # about self service tools. - rpc :CreateClientEvent, ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Google::Cloud::Talent::V4beta1::ClientEvent - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb deleted file mode 100644 index acd792c42ff1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/filters_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/filters.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/cloud/talent/v4beta1/common_pb' -require 'google/protobuf/duration_pb' -require 'google/type/latlng_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n)google/cloud/talent/v4beta1/filters.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x18google/type/latlng.proto\x1a\x1bgoogle/type/timeofday.proto\"\x80\x05\n\x08JobQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x1b\n\x13query_language_code\x18\x0e \x01(\t\x12\x11\n\tcompanies\x18\x02 \x03(\t\x12\x45\n\x10location_filters\x18\x03 \x03(\x0b\x32+.google.cloud.talent.v4beta1.LocationFilter\x12@\n\x0ejob_categories\x18\x04 \x03(\x0e\x32(.google.cloud.talent.v4beta1.JobCategory\x12\x42\n\x0e\x63ommute_filter\x18\x05 \x01(\x0b\x32*.google.cloud.talent.v4beta1.CommuteFilter\x12\x1d\n\x15\x63ompany_display_names\x18\x06 \x03(\t\x12L\n\x13\x63ompensation_filter\x18\x07 \x01(\x0b\x32/.google.cloud.talent.v4beta1.CompensationFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x08 \x01(\t\x12\x1b\n\x13\x64isable_spell_check\x18\t \x01(\x08\x12\x45\n\x10\x65mployment_types\x18\n \x03(\x0e\x32+.google.cloud.talent.v4beta1.EmploymentType\x12\x16\n\x0elanguage_codes\x18\x0b \x03(\t\x12G\n\x12publish_time_range\x18\x0c \x01(\x0b\x32+.google.cloud.talent.v4beta1.TimestampRange\x12\x15\n\rexcluded_jobs\x18\r \x03(\t\"\x83\x03\n\x0eLocationFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x19\n\x11\x64istance_in_miles\x18\x04 \x01(\x01\x12\x61\n\x16telecommute_preference\x18\x05 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference\x12\x0f\n\x07negated\x18\x06 \x01(\x08\"\x95\x01\n\x15TelecommutePreference\x12&\n\"TELECOMMUTE_PREFERENCE_UNSPECIFIED\x10\x00\x12\x1c\n\x14TELECOMMUTE_EXCLUDED\x10\x01\x1a\x02\x08\x01\x12\x17\n\x13TELECOMMUTE_ALLOWED\x10\x02\x12\x1d\n\x19TELECOMMUTE_JOBS_EXCLUDED\x10\x03\"\xca\x03\n\x12\x43ompensationFilter\x12M\n\x04type\x18\x01 \x01(\x0e\x32:.google.cloud.talent.v4beta1.CompensationFilter.FilterTypeB\x03\xe0\x41\x02\x12R\n\x05units\x18\x02 \x03(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnitB\x03\xe0\x41\x02\x12N\n\x05range\x18\x03 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange\x12\x38\n0include_jobs_with_unspecified_compensation_range\x18\x04 \x01(\x08\"\x86\x01\n\nFilterType\x12\x1b\n\x17\x46ILTER_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tUNIT_ONLY\x10\x01\x12\x13\n\x0fUNIT_AND_AMOUNT\x10\x02\x12\x1a\n\x16\x41NNUALIZED_BASE_AMOUNT\x10\x03\x12\x1b\n\x17\x41NNUALIZED_TOTAL_AMOUNT\x10\x04\"\xcb\x03\n\rCommuteFilter\x12G\n\x0e\x63ommute_method\x18\x01 \x01(\x0e\x32*.google.cloud.talent.v4beta1.CommuteMethodB\x03\xe0\x41\x02\x12\x33\n\x11start_coordinates\x18\x02 \x01(\x0b\x32\x13.google.type.LatLngB\x03\xe0\x41\x02\x12\x37\n\x0ftravel_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12!\n\x19\x61llow_imprecise_addresses\x18\x04 \x01(\x08\x12N\n\x0croad_traffic\x18\x05 \x01(\x0e\x32\x36.google.cloud.talent.v4beta1.CommuteFilter.RoadTrafficH\x00\x12\x30\n\x0e\x64\x65parture_time\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00\"L\n\x0bRoadTraffic\x12\x1c\n\x18ROAD_TRAFFIC_UNSPECIFIED\x10\x00\x12\x10\n\x0cTRAFFIC_FREE\x10\x01\x12\r\n\tBUSY_HOUR\x10\x02\x42\x10\n\x0etraffic_optionBp\n\x1f\x63om.google.cloud.talent.v4beta1B\x0c\x46iltersProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.TimestampRange", "google/cloud/talent/v4beta1/common.proto"], - ["google.type.LatLng", "google/type/latlng.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.type.TimeOfDay", "google/type/timeofday.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 Talent - module V4beta1 - JobQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobQuery").msgclass - LocationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.LocationFilter").msgclass - LocationFilter::TelecommutePreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference").enummodule - CompensationFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationFilter").msgclass - CompensationFilter::FilterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompensationFilter.FilterType").enummodule - CommuteFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CommuteFilter").msgclass - CommuteFilter::RoadTraffic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb deleted file mode 100644 index 5e0b5ae20689..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/histogram_pb.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/histogram.proto - -require 'google/protobuf' - - -descriptor_data = "\n+google/cloud/talent/v4beta1/histogram.proto\x12\x1bgoogle.cloud.talent.v4beta1\")\n\x0eHistogramQuery\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\"\xb6\x01\n\x14HistogramQueryResult\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\x12S\n\thistogram\x18\x02 \x03(\x0b\x32@.google.cloud.talent.v4beta1.HistogramQueryResult.HistogramEntry\x1a\x30\n\x0eHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42r\n\x1f\x63om.google.cloud.talent.v4beta1B\x0eHistogramProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ - ] - 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 Talent - module V4beta1 - HistogramQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.HistogramQuery").msgclass - HistogramQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.HistogramQueryResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb deleted file mode 100644 index c20d962040c1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/job.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/talent/v4beta1/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n%google/cloud/talent/v4beta1/job.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe0\x0f\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x07\x63ompany\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12\x1b\n\x0erequisition_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\taddresses\x18\x06 \x03(\t\x12J\n\x10\x61pplication_info\x18\x07 \x01(\x0b\x32\x30.google.cloud.talent.v4beta1.Job.ApplicationInfo\x12=\n\x0cjob_benefits\x18\x08 \x03(\x0e\x32\'.google.cloud.talent.v4beta1.JobBenefit\x12H\n\x11\x63ompensation_info\x18\t \x01(\x0b\x32-.google.cloud.talent.v4beta1.CompensationInfo\x12Q\n\x11\x63ustom_attributes\x18\n \x03(\x0b\x32\x36.google.cloud.talent.v4beta1.Job.CustomAttributesEntry\x12=\n\x0c\x64\x65gree_types\x18\x0b \x03(\x0e\x32\'.google.cloud.talent.v4beta1.DegreeType\x12\x12\n\ndepartment\x18\x0c \x01(\t\x12\x45\n\x10\x65mployment_types\x18\r \x03(\x0e\x32+.google.cloud.talent.v4beta1.EmploymentType\x12\x12\n\nincentives\x18\x0e \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12\x38\n\tjob_level\x18\x10 \x01(\x0e\x32%.google.cloud.talent.v4beta1.JobLevel\x12\x17\n\x0fpromotion_value\x18\x11 \x01(\x05\x12\x16\n\x0equalifications\x18\x12 \x01(\t\x12\x18\n\x10responsibilities\x18\x13 \x01(\t\x12\x42\n\x0eposting_region\x18\x14 \x01(\x0e\x32*.google.cloud.talent.v4beta1.PostingRegion\x12?\n\nvisibility\x18\x15 \x01(\x0e\x32\'.google.cloud.talent.v4beta1.VisibilityB\x02\x18\x01\x12\x32\n\x0ejob_start_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cjob_end_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14posting_publish_time\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x13posting_expire_time\x18\x19 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x13posting_create_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13posting_update_time\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12!\n\x14\x63ompany_display_name\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12G\n\x0c\x64\x65rived_info\x18\x1d \x01(\x0b\x32,.google.cloud.talent.v4beta1.Job.DerivedInfoB\x03\xe0\x41\x03\x12N\n\x12processing_options\x18\x1e \x01(\x0b\x32\x32.google.cloud.talent.v4beta1.Job.ProcessingOptions\x1a\x44\n\x0f\x41pplicationInfo\x12\x0e\n\x06\x65mails\x18\x01 \x03(\t\x12\x13\n\x0binstruction\x18\x02 \x01(\t\x12\x0c\n\x04uris\x18\x03 \x03(\t\x1a\x89\x01\n\x0b\x44\x65rivedInfo\x12\x38\n\tlocations\x18\x01 \x03(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12@\n\x0ejob_categories\x18\x03 \x03(\x0e\x32(.google.cloud.talent.v4beta1.JobCategory\x1a\x88\x01\n\x11ProcessingOptions\x12)\n!disable_street_address_resolution\x18\x01 \x01(\x08\x12H\n\x11html_sanitization\x18\x02 \x01(\x0e\x32-.google.cloud.talent.v4beta1.HtmlSanitization\x1a\x65\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.talent.v4beta1.CustomAttribute:\x02\x38\x01:k\xea\x41h\n\x17jobs.googleapis.com/Job\x12.projects/{project}/tenants/{tenant}/jobs/{job}\x12\x1dprojects/{project}/jobs/{job}Bt\n\x1f\x63om.google.cloud.talent.v4beta1B\x10JobResourceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.CompensationInfo", "google/cloud/talent/v4beta1/common.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 Talent - module V4beta1 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job").msgclass - Job::ApplicationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job.ApplicationInfo").msgclass - Job::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job.DerivedInfo").msgclass - Job::ProcessingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Job.ProcessingOptions").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb deleted file mode 100644 index e0b6ed615036..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/job_service/credentials" -require "google/cloud/talent/v4beta1/job_service/paths" -require "google/cloud/talent/v4beta1/job_service/operations" -require "google/cloud/talent/v4beta1/job_service/client" -require "google/cloud/talent/v4beta1/job_service/rest" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service handles job management, including job CRUD, enumeration and search. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4beta1/job_service" - # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4beta1/job_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - module JobService - end - end - end - end -end - -helper_path = ::File.join __dir__, "job_service", "helpers.rb" -require "google/cloud/talent/v4beta1/job_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb deleted file mode 100644 index 184abd491294..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb +++ /dev/null @@ -1,2083 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module JobService - ## - # Client for the JobService service. - # - # A service handles job management, including job CRUD, enumeration and search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :job_service_stub - - ## - # Configure the JobService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::JobService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobService clients - # ::Google::Cloud::Talent::V4beta1::JobService::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", "Talent", "V4beta1"] - 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_job.timeout = 30.0 - - default_config.rpcs.batch_create_jobs.timeout = 30.0 - - default_config.rpcs.get_job.timeout = 30.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_job.timeout = 30.0 - - default_config.rpcs.batch_update_jobs.timeout = 30.0 - - default_config.rpcs.delete_job.timeout = 30.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_delete_jobs.timeout = 30.0 - - default_config.rpcs.list_jobs.timeout = 30.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_jobs.timeout = 30.0 - - default_config.rpcs.search_jobs_for_alert.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobService 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::Talent::V4beta1::JobService::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_service_stub.universe_domain - end - - ## - # Create a new JobService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobService 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/talent/v4beta1/job_service_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_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4beta1::JobService::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, - logger: @config.logger - ) - - @job_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4beta1::JobService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @job_service_stub.logger - end - - # Service calls - - ## - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) - # Pass arguments to `create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified a default tenant - # is created. For example, "projects/foo". - # @param job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] - # Required. The Job to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateJobRequest - - # Converts hash 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_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::Talent::V4beta1::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_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :create_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch create jobs operation. - # - # @overload batch_create_jobs(request, options = nil) - # Pass arguments to `batch_create_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_create_jobs(parent: nil, jobs: nil) - # Pass arguments to `batch_create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] - # Required. The jobs to be created. - # - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new - # - # # Call the batch_create_jobs method. - # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest - - # Converts hash 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.batch_create_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::Talent::V4beta1::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.batch_create_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_create_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/jobs/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_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_service_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(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 job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] - # Required. The Job to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. - # Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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.job&.name - header_params["job.name"] = request.job.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_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_service_stub.call_rpc :update_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch update jobs operation. - # - # @overload batch_update_jobs(request, options = nil) - # Pass arguments to `batch_update_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) - # Pass arguments to `batch_update_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] - # Required. The jobs to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the - # fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. - # - # If - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4beta1::Job Job} inside - # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4beta1::Job Job} will include all fields, - # which can yield a very large response. - # - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new - # - # # Call the batch_update_jobs method. - # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest - - # Converts hash 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.batch_update_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::Talent::V4beta1::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.batch_update_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_update_jobs, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/jobs/bar". - # - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_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_service_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a list of {::Google::Cloud::Talent::V4beta1::Job Job}s by filter. - # - # @overload batch_delete_jobs(request, options = nil) - # Pass arguments to `batch_delete_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_delete_jobs(parent: nil, filter: nil) - # Pass arguments to `batch_delete_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param filter [::String] - # Required. The filter string specifies the jobs to be deleted. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` (Required) - # * `requisitionId` (Required) - # - # Sample Query: companyName = "projects/foo/companies/bar" AND - # requisitionId = "req-1" - # - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new - # - # # Call the batch_delete_jobs method. - # result = client.batch_delete_jobs request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def batch_delete_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest - - # Converts hash 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.batch_delete_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::Talent::V4beta1::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.batch_delete_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :batch_delete_jobs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists jobs by filter. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param filter [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @param page_token [::String] - # The starting point of a query result. - # @param page_size [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4beta1::ListJobsRequest#job_view job_view} is set - # to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} - # if no value is specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_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_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @job_service_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. - # - # This call constrains the - # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in - # the database, and only returns jobs that the caller has permission to - # search against. - # - # @overload search_jobs(request, options = nil) - # Pass arguments to `search_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_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 parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param require_precise_result_size [::Boolean] - # This field is deprecated. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, - # for example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, - # "SMALL", "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for - # example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, - # "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for - # example, "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} - # if no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is - # unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new - # - # # Call the search_jobs method. - # result = client.search_jobs request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. - # p result - # - def search_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest - - # Converts hash 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.search_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::Talent::V4beta1::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.search_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :search_jobs, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), and has different algorithmic - # adjustments that are targeted to passive job seekers. - # - # This call constrains the - # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in - # the database, and only returns jobs the caller has permission to search - # against. - # - # @overload search_jobs_for_alert(request, options = nil) - # Pass arguments to `search_jobs_for_alert` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param require_precise_result_size [::Boolean] - # This field is deprecated. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, - # for example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, - # "SMALL", "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for - # example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, - # "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for - # example, "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} - # if no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is - # unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new - # - # # Call the search_jobs_for_alert method. - # result = client.search_jobs_for_alert request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. - # p result - # - def search_jobs_for_alert request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest - - # Converts hash 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.search_jobs_for_alert.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::Talent::V4beta1::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.search_jobs_for_alert.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.call_rpc :search_jobs_for_alert, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the JobService API. - # - # This class represents the configuration for JobService, - # 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::Talent::V4beta1::JobService::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_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::JobService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 JobService 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_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `batch_create_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `batch_update_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_jobs - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `batch_delete_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_jobs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `search_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs - ## - # RPC-specific configuration for `search_jobs_for_alert` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs_for_alert - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs - @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs - @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs - @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs - @search_jobs = ::Gapic::Config::Method.new search_jobs_config - search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert - @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb deleted file mode 100644 index b63aa1a22303..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module JobService - # Credentials for the JobService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb deleted file mode 100644 index ccad6093971e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module JobService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobService 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 JobService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::Talent::V4beta1::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? - throw :response, 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::Talent::V4beta1::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? - throw :response, 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::Talent::V4beta1::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? - 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::Talent::V4beta1::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? - 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::Talent::V4beta1::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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb deleted file mode 100644 index 71e690c1552a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/paths.rb +++ /dev/null @@ -1,146 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module JobService - # Path helper methods for the JobService API. - module Paths - ## - # Create a fully-qualified Company resource string. - # - # @overload company_path(project:, tenant:, company:) - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/companies/{company}` - # - # @param project [String] - # @param tenant [String] - # @param company [String] - # - # @overload company_path(project:, company:) - # The resource will be in the following format: - # - # `projects/{project}/companies/{company}` - # - # @param project [String] - # @param company [String] - # - # @return [::String] - def company_path **args - resources = { - "company:project:tenant" => (proc do |project:, tenant:, company:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/companies/#{company}" - end), - "company:project" => (proc do |project:, company:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/companies/#{company}" - 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 Job resource string. - # - # @overload job_path(project:, tenant:, job:) - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}/jobs/{job}` - # - # @param project [String] - # @param tenant [String] - # @param job [String] - # - # @overload job_path(project:, job:) - # The resource will be in the following format: - # - # `projects/{project}/jobs/{job}` - # - # @param project [String] - # @param job [String] - # - # @return [::String] - def job_path **args - resources = { - "job:project:tenant" => (proc do |project:, tenant:, job:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}/jobs/#{job}" - end), - "job:project" => (proc do |project:, job:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/jobs/#{job}" - 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 Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb deleted file mode 100644 index f2f14e59264e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/job_service/credentials" -require "google/cloud/talent/v4beta1/job_service/paths" -require "google/cloud/talent/v4beta1/job_service/rest/operations" -require "google/cloud/talent/v4beta1/job_service/rest/client" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service handles job management, including job CRUD, enumeration and search. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4beta1/job_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - module JobService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4beta1/job_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb deleted file mode 100644 index 3c6fdb997cbc..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +++ /dev/null @@ -1,1970 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" -require "google/cloud/talent/v4beta1/job_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4beta1 - module JobService - module Rest - ## - # REST client for the JobService service. - # - # A service handles job management, including job CRUD, enumeration and search. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :job_service_stub - - ## - # Configure the JobService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::JobService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobService clients - # ::Google::Cloud::Talent::V4beta1::JobService::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", "Talent", "V4beta1"] - 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_job.timeout = 30.0 - - default_config.rpcs.batch_create_jobs.timeout = 30.0 - - default_config.rpcs.get_job.timeout = 30.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_job.timeout = 30.0 - - default_config.rpcs.batch_update_jobs.timeout = 30.0 - - default_config.rpcs.delete_job.timeout = 30.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.batch_delete_jobs.timeout = 30.0 - - default_config.rpcs.list_jobs.timeout = 30.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_jobs.timeout = 30.0 - - default_config.rpcs.search_jobs_for_alert.timeout = 30.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobService 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::Talent::V4beta1::JobService::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_service_stub.universe_domain - end - - ## - # Create a new JobService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobService 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::Talent::V4beta1::JobService::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_service_stub = ::Google::Cloud::Talent::V4beta1::JobService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @job_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Talent::V4beta1::JobService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @job_service_stub.logger - end - - # Service calls - - ## - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_job(parent: nil, job: nil) - # Pass arguments to `create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified a default tenant - # is created. For example, "projects/foo". - # @param job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] - # Required. The Job to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateJobRequest - - # Converts hash 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_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::Talent::V4beta1::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_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.create_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch create jobs operation. - # - # @overload batch_create_jobs(request, options = nil) - # Pass arguments to `batch_create_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_create_jobs(parent: nil, jobs: nil) - # Pass arguments to `batch_create_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] - # Required. The jobs to be created. - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new - # - # # Call the batch_create_jobs method. - # result = client.batch_create_jobs 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 batch_create_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest - - # Converts hash 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.batch_create_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::Talent::V4beta1::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.batch_create_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_create_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/jobs/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(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 job [::Google::Cloud::Talent::V4beta1::Job, ::Hash] - # Required. The Job to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. - # Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.update_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Begins executing a batch update jobs operation. - # - # @overload batch_update_jobs(request, options = nil) - # Pass arguments to `batch_update_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil) - # Pass arguments to `batch_update_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param jobs [::Array<::Google::Cloud::Talent::V4beta1::Job, ::Hash>] - # Required. The jobs to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the - # fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. - # - # If - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4beta1::Job Job} inside - # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4beta1::Job Job} will include all fields, - # which can yield a very large response. - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new - # - # # Call the batch_update_jobs method. - # result = client.batch_update_jobs 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 batch_update_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest - - # Converts hash 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.batch_update_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::Talent::V4beta1::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.batch_update_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_update_jobs request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(name: 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 name [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/jobs/bar". - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.delete_job request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a list of {::Google::Cloud::Talent::V4beta1::Job Job}s by filter. - # - # @overload batch_delete_jobs(request, options = nil) - # Pass arguments to `batch_delete_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_delete_jobs(parent: nil, filter: nil) - # Pass arguments to `batch_delete_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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param filter [::String] - # Required. The filter string specifies the jobs to be deleted. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` (Required) - # * `requisitionId` (Required) - # - # Sample Query: companyName = "projects/foo/companies/bar" AND - # requisitionId = "req-1" - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new - # - # # Call the batch_delete_jobs method. - # result = client.batch_delete_jobs request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def batch_delete_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest - - # Converts hash 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.batch_delete_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::Talent::V4beta1::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.batch_delete_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.batch_delete_jobs request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists jobs by filter. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::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(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: 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 parent [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param filter [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @param page_token [::String] - # The starting point of a query result. - # @param page_size [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4beta1::ListJobsRequest#job_view job_view} is set - # to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} - # if no value is specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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::Talent::V4beta1::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_service_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_jobs, "jobs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. - # - # This call constrains the - # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in - # the database, and only returns jobs that the caller has permission to - # search against. - # - # @overload search_jobs(request, options = nil) - # Pass arguments to `search_jobs` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_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 parent [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param require_precise_result_size [::Boolean] - # This field is deprecated. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, - # for example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, - # "SMALL", "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for - # example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, - # "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for - # example, "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} - # if no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is - # unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new - # - # # Call the search_jobs method. - # result = client.search_jobs request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. - # p result - # - def search_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest - - # Converts hash 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.search_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::Talent::V4beta1::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.search_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.search_jobs request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches for jobs using the provided - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), and has different algorithmic - # adjustments that are targeted to passive job seekers. - # - # This call constrains the - # {::Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs present in - # the database, and only returns jobs the caller has permission to search - # against. - # - # @overload search_jobs_for_alert(request, options = nil) - # Pass arguments to `search_jobs_for_alert` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, require_precise_result_size: nil, histogram_queries: nil, job_view: nil, offset: nil, page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil, relevance_threshold: nil) - # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @param search_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @param request_metadata [::Google::Cloud::Talent::V4beta1::RequestMetadata, ::Hash] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @param job_query [::Google::Cloud::Talent::V4beta1::JobQuery, ::Hash] - # Query used to search against jobs, such as keyword, location filters, etc. - # @param enable_broadening [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @param require_precise_result_size [::Boolean] - # This field is deprecated. - # @param histogram_queries [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery, ::Hash>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, - # for example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, - # "SMALL", "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for - # example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, - # "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for - # example, "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @param job_view [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} - # if no value is specified. - # @param offset [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is - # unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @param page_size [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @param page_token [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @param order_by [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. - # @param diversification_level [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @param custom_ranking_info [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo, ::Hash] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @param disable_keyword_match [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @param keyword_match_mode [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @param relevance_threshold [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new - # - # # Call the search_jobs_for_alert method. - # result = client.search_jobs_for_alert request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. - # p result - # - def search_jobs_for_alert request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest - - # Converts hash 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.search_jobs_for_alert.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::Talent::V4beta1::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.search_jobs_for_alert.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_service_stub.search_jobs_for_alert request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the JobService REST API. - # - # This class represents the configuration for JobService 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::Talent::V4beta1::JobService::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_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 JobService 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_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `batch_create_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_jobs - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `batch_update_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_jobs - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `batch_delete_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_jobs - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `search_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs - ## - # RPC-specific configuration for `search_jobs_for_alert` - # @return [::Gapic::Config::Method] - # - attr_reader :search_jobs_for_alert - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs - @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs - @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs - @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs - @search_jobs = ::Gapic::Config::Method.new search_jobs_config - search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert - @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb deleted file mode 100644 index c761a2506531..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +++ /dev/null @@ -1,925 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module JobService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobService 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 JobService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @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::Talent::V4beta1::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? - throw :response, 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::Talent::V4beta1::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? - throw :response, 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::Talent::V4beta1::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? - 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::Talent::V4beta1::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? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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{^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: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/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{^operations(?:/.*)?$}, true] - ] - ) - 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", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb deleted file mode 100644 index 34c521a34b94..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +++ /dev/null @@ -1,774 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module JobService - module Rest - ## - # REST service stub for the JobService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateJobRequest] - # 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::Talent::V4beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Job] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_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, - method_name: "create_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_create_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest] - # 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 batch_create_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_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, - method_name: "batch_create_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::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, - method_name: "get_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::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, - method_name: "update_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Job.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_update_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest] - # 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 batch_update_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_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, - method_name: "batch_update_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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, - method_name: "delete_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_delete_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest] - # 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 batch_delete_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_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, - method_name: "batch_delete_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::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, - method_name: "list_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] - # 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::Talent::V4beta1::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # A result object deserialized from the server's reply - def search_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_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, - method_name: "search_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_jobs_for_alert REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] - # 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::Talent::V4beta1::SearchJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse] - # A result object deserialized from the server's reply - def search_jobs_for_alert request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_jobs_for_alert_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, - method_name: "search_jobs_for_alert", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateJobRequest] - # 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_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_create_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{job.name}", - body: "*", - matches: [ - ["job.name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v4beta1/{job.name}", - body: "*", - matches: [ - ["job.name", %r{^projects/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_update_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_delete_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:batchDelete", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::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: "/v4beta1/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_jobs REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:search", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:search", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_jobs_for_alert REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::SearchJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_jobs_for_alert_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:searchForAlert", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/jobs:searchForAlert", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb deleted file mode 100644 index ead68c23f2d4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_pb.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/job_service.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/talent/v4beta1/common_pb' -require 'google/cloud/talent/v4beta1/filters_pb' -require 'google/cloud/talent/v4beta1/histogram_pb' -require 'google/cloud/talent/v4beta1/job_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n-google/cloud/talent/v4beta1/job_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a)google/cloud/talent/v4beta1/filters.proto\x1a+google/cloud/talent/v4beta1/histogram.proto\x1a%google/cloud/talent/v4beta1/job.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto\"w\n\x10\x43reateJobRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x32\n\x03job\x18\x02 \x01(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\">\n\rGetJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"w\n\x10UpdateJobRequest\x12\x32\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"A\n\x10\x44\x65leteJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job\"^\n\x16\x42\x61tchDeleteJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xb6\x01\n\x0fListJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x36\n\x08job_view\x18\x05 \x01(\x0e\x32$.google.cloud.talent.v4beta1.JobView\"\x9c\x01\n\x10ListJobsResponse\x12.\n\x04jobs\x18\x01 \x03(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\"\x86\r\n\x11SearchJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12N\n\x0bsearch_mode\x18\x02 \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode\x12K\n\x10request_metadata\x18\x03 \x01(\x0b\x32,.google.cloud.talent.v4beta1.RequestMetadataB\x03\xe0\x41\x02\x12\x38\n\tjob_query\x18\x04 \x01(\x0b\x32%.google.cloud.talent.v4beta1.JobQuery\x12\x19\n\x11\x65nable_broadening\x18\x05 \x01(\x08\x12\'\n\x1brequire_precise_result_size\x18\x06 \x01(\x08\x42\x02\x18\x01\x12\x46\n\x11histogram_queries\x18\x07 \x03(\x0b\x32+.google.cloud.talent.v4beta1.HistogramQuery\x12\x36\n\x08job_view\x18\x08 \x01(\x0e\x32$.google.cloud.talent.v4beta1.JobView\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x11\n\tpage_size\x18\n \x01(\x05\x12\x12\n\npage_token\x18\x0b \x01(\t\x12\x10\n\x08order_by\x18\x0c \x01(\t\x12\x62\n\x15\x64iversification_level\x18\r \x01(\x0e\x32\x43.google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel\x12]\n\x13\x63ustom_ranking_info\x18\x0e \x01(\x0b\x32@.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo\x12\x1d\n\x15\x64isable_keyword_match\x18\x10 \x01(\x08\x12[\n\x12keyword_match_mode\x18\x12 \x01(\x0e\x32?.google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode\x12\x63\n\x13relevance_threshold\x18\x13 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.SearchJobsRequest.RelevanceThresholdB\x03\xe0\x41\x01\x1a\x9a\x02\n\x11\x43ustomRankingInfo\x12o\n\x10importance_level\x18\x01 \x01(\x0e\x32P.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevelB\x03\xe0\x41\x02\x12\x1f\n\x12ranking_expression\x18\x02 \x01(\tB\x03\xe0\x41\x02\"s\n\x0fImportanceLevel\x12 \n\x1cIMPORTANCE_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\x08\n\x04MILD\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\x0b\n\x07\x45XTREME\x10\x06\"R\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nJOB_SEARCH\x10\x01\x12\x17\n\x13\x46\x45\x41TURED_JOB_SEARCH\x10\x02\"W\n\x14\x44iversificationLevel\x12%\n!DIVERSIFICATION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\n\n\x06SIMPLE\x10\x02\"\x87\x01\n\x10KeywordMatchMode\x12\"\n\x1eKEYWORD_MATCH_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16KEYWORD_MATCH_DISABLED\x10\x01\x12\x15\n\x11KEYWORD_MATCH_ALL\x10\x02\x12\x1c\n\x18KEYWORD_MATCH_TITLE_ONLY\x10\x03\"d\n\x12RelevanceThreshold\x12#\n\x1fRELEVANCE_THRESHOLD_UNSPECIFIED\x10\x00\x12\n\n\x06LOWEST\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x08\n\x04HIGH\x10\x04\"\xd7\x06\n\x12SearchJobsResponse\x12R\n\rmatching_jobs\x18\x01 \x03(\x0b\x32;.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob\x12R\n\x17histogram_query_results\x18\x02 \x03(\x0b\x32\x31.google.cloud.talent.v4beta1.HistogramQueryResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12?\n\x10location_filters\x18\x04 \x03(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12\x1c\n\x14\x65stimated_total_size\x18\x05 \x01(\x05\x12\x12\n\ntotal_size\x18\x06 \x01(\x05\x12?\n\x08metadata\x18\x07 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x12\"\n\x1a\x62roadened_query_jobs_count\x18\x08 \x01(\x05\x12I\n\x10spell_correction\x18\t \x01(\x0b\x32/.google.cloud.talent.v4beta1.SpellingCorrection\x1a\xdc\x01\n\x0bMatchingJob\x12-\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\x13\n\x0bjob_summary\x18\x02 \x01(\t\x12\x19\n\x11job_title_snippet\x18\x03 \x01(\t\x12\x1b\n\x13search_text_snippet\x18\x04 \x01(\t\x12Q\n\x0c\x63ommute_info\x18\x05 \x01(\x0b\x32;.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo\x1a~\n\x0b\x43ommuteInfo\x12;\n\x0cjob_location\x18\x01 \x01(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12\x32\n\x0ftravel_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"~\n\x16\x42\x61tchCreateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x33\n\x04jobs\x18\x02 \x03(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\"\xaf\x01\n\x16\x42\x61tchUpdateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x33\n\x04jobs\x18\x02 \x03(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xc4\x01\n\x12JobOperationResult\x12N\n\x0bjob_results\x18\x01 \x03(\x0b\x32\x39.google.cloud.talent.v4beta1.JobOperationResult.JobResult\x1a^\n\tJobResult\x12-\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status*v\n\x07JobView\x12\x18\n\x14JOB_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_VIEW_ID_ONLY\x10\x01\x12\x14\n\x10JOB_VIEW_MINIMAL\x10\x02\x12\x12\n\x0eJOB_VIEW_SMALL\x10\x03\x12\x11\n\rJOB_VIEW_FULL\x10\x04\x32\xce\x12\n\nJobService\x12\xc9\x01\n\tCreateJob\x12-.google.cloud.talent.v4beta1.CreateJobRequest\x1a .google.cloud.talent.v4beta1.Job\"k\xda\x41\nparent,job\x82\xd3\xe4\x93\x02X\"+/v4beta1/{parent=projects/*/tenants/*}/jobs:\x01*Z&\"!/v4beta1/{parent=projects/*}/jobs:\x01*\x12\x9b\x02\n\x0f\x42\x61tchCreateJobs\x12\x33.google.cloud.talent.v4beta1.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchCreate:\x01*\x12\xb7\x01\n\x06GetJob\x12*.google.cloud.talent.v4beta1.GetJobRequest\x1a .google.cloud.talent.v4beta1.Job\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#\x12!/v4beta1/{name=projects/*/jobs/*}\x12\xca\x01\n\tUpdateJob\x12-.google.cloud.talent.v4beta1.UpdateJobRequest\x1a .google.cloud.talent.v4beta1.Job\"l\xda\x41\x03job\x82\xd3\xe4\x93\x02`2//v4beta1/{job.name=projects/*/tenants/*/jobs/*}:\x01*Z*2%/v4beta1/{job.name=projects/*/jobs/*}:\x01*\x12\x9b\x02\n\x0f\x42\x61tchUpdateJobs\x12\x33.google.cloud.talent.v4beta1.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation\"\xb3\x01\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\xda\x41\x0bparent,jobs\x82\xd3\xe4\x93\x02p\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*Z2\"-/v4beta1/{parent=projects/*}/jobs:batchUpdate:\x01*\x12\xb3\x01\n\tDeleteJob\x12-.google.cloud.talent.v4beta1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R*+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#*!/v4beta1/{name=projects/*/jobs/*}\x12\xe4\x01\n\x0f\x42\x61tchDeleteJobs\x12\x33.google.cloud.talent.v4beta1.BatchDeleteJobsRequest\x1a\x16.google.protobuf.Empty\"\x83\x01\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02m\"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*Z/\"-/v4beta1/{parent=projects/*}/jobs:batchDelete\x12\xd1\x01\n\x08ListJobs\x12,.google.cloud.talent.v4beta1.ListJobsRequest\x1a-.google.cloud.talent.v4beta1.ListJobsResponse\"h\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{parent=projects/*/tenants/*}/jobsZ#\x12!/v4beta1/{parent=projects/*}/jobs\x12\xdb\x01\n\nSearchJobs\x12..google.cloud.talent.v4beta1.SearchJobsRequest\x1a/.google.cloud.talent.v4beta1.SearchJobsResponse\"l\x82\xd3\xe4\x93\x02\x66\"2/v4beta1/{parent=projects/*/tenants/*}/jobs:search:\x01*Z-\"(/v4beta1/{parent=projects/*}/jobs:search:\x01*\x12\xf3\x01\n\x12SearchJobsForAlert\x12..google.cloud.talent.v4beta1.SearchJobsRequest\x1a/.google.cloud.talent.v4beta1.SearchJobsResponse\"|\x82\xd3\xe4\x93\x02v\":/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert:\x01*Z5\"0/v4beta1/{parent=projects/*}/jobs:searchForAlert:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBs\n\x1f\x63om.google.cloud.talent.v4beta1B\x0fJobServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Job", "google/cloud/talent/v4beta1/job.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.proto"], - ["google.cloud.talent.v4beta1.JobQuery", "google/cloud/talent/v4beta1/filters.proto"], - ["google.cloud.talent.v4beta1.HistogramQuery", "google/cloud/talent/v4beta1/histogram.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.rpc.Status", "google/rpc/status.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 Talent - module V4beta1 - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateJobRequest").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetJobRequest").msgclass - UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteJobRequest").msgclass - BatchDeleteJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchDeleteJobsRequest").msgclass - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListJobsResponse").msgclass - SearchJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest").msgclass - SearchJobsRequest::CustomRankingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo").msgclass - SearchJobsRequest::CustomRankingInfo::ImportanceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel").enummodule - SearchJobsRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode").enummodule - SearchJobsRequest::DiversificationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel").enummodule - SearchJobsRequest::KeywordMatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.KeywordMatchMode").enummodule - SearchJobsRequest::RelevanceThreshold = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsRequest.RelevanceThreshold").enummodule - SearchJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsResponse").msgclass - SearchJobsResponse::MatchingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob").msgclass - SearchJobsResponse::CommuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo").msgclass - BatchCreateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchCreateJobsRequest").msgclass - BatchUpdateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.BatchUpdateJobsRequest").msgclass - JobOperationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobOperationResult").msgclass - JobOperationResult::JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobOperationResult.JobResult").msgclass - JobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobView").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb deleted file mode 100644 index 27cb94167602..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +++ /dev/null @@ -1,90 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4beta1/job_service.proto for package 'google.cloud.talent.v4beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4beta1/job_service_pb' - -module Google - module Cloud - module Talent - module V4beta1 - module JobService - # A service handles job management, including job CRUD, enumeration and search. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4beta1.JobService' - - # Creates a new job. - # - # Typically, the job becomes searchable within 10 seconds, but it may take - # up to 5 minutes. - rpc :CreateJob, ::Google::Cloud::Talent::V4beta1::CreateJobRequest, ::Google::Cloud::Talent::V4beta1::Job - # Begins executing a batch create jobs operation. - rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, ::Google::Longrunning::Operation - # Retrieves the specified job, whose status is OPEN or recently EXPIRED - # within the last 90 days. - rpc :GetJob, ::Google::Cloud::Talent::V4beta1::GetJobRequest, ::Google::Cloud::Talent::V4beta1::Job - # Updates specified job. - # - # Typically, updated contents become visible in search results within 10 - # seconds, but it may take up to 5 minutes. - rpc :UpdateJob, ::Google::Cloud::Talent::V4beta1::UpdateJobRequest, ::Google::Cloud::Talent::V4beta1::Job - # Begins executing a batch update jobs operation. - rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, ::Google::Longrunning::Operation - # Deletes the specified job. - # - # Typically, the job becomes unsearchable within 10 seconds, but it may take - # up to 5 minutes. - rpc :DeleteJob, ::Google::Cloud::Talent::V4beta1::DeleteJobRequest, ::Google::Protobuf::Empty - # Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter. - rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, ::Google::Protobuf::Empty - # Lists jobs by filter. - rpc :ListJobs, ::Google::Cloud::Talent::V4beta1::ListJobsRequest, ::Google::Cloud::Talent::V4beta1::ListJobsResponse - # Searches for jobs using the provided - # [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - # - # This call constrains the - # [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs present in - # the database, and only returns jobs that the caller has permission to - # search against. - rpc :SearchJobs, ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Google::Cloud::Talent::V4beta1::SearchJobsResponse - # Searches for jobs using the provided - # [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - # - # This API call is intended for the use case of targeting passive job - # seekers (for example, job seekers who have signed up to receive email - # alerts about potential job opportunities), and has different algorithmic - # adjustments that are targeted to passive job seekers. - # - # This call constrains the - # [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs present in - # the database, and only returns jobs the caller has permission to search - # against. - rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Google::Cloud::Talent::V4beta1::SearchJobsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb deleted file mode 100644 index c4ff5205d5b6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/rest.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service/rest" -require "google/cloud/talent/v4beta1/completion/rest" -require "google/cloud/talent/v4beta1/event_service/rest" -require "google/cloud/talent/v4beta1/job_service/rest" -require "google/cloud/talent/v4beta1/tenant_service/rest" -require "google/cloud/talent/v4beta1/version" - -module Google - module Cloud - module Talent - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/talent/v4beta1/rest" - # client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new - # - module V4beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb deleted file mode 100644 index 8d4effb8ff24..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/tenant.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n(google/cloud/talent/v4beta1/tenant.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xc3\x02\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\nusage_type\x18\x03 \x01(\x0e\x32\x31.google.cloud.talent.v4beta1.Tenant.DataUsageType\x12\x34\n,keyword_searchable_profile_custom_attributes\x18\x04 \x03(\t\"N\n\rDataUsageType\x12\x1f\n\x1b\x44\x41TA_USAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nAGGREGATED\x10\x01\x12\x0c\n\x08ISOLATED\x10\x02:D\xea\x41\x41\n\x1ajobs.googleapis.com/Tenant\x12#projects/{project}/tenants/{tenant}Bw\n\x1f\x63om.google.cloud.talent.v4beta1B\x13TenantResourceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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 = [ - ] - 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 Talent - module V4beta1 - Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant").msgclass - Tenant::DataUsageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant.DataUsageType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb deleted file mode 100644 index 5edb4c257b75..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/tenant_service/credentials" -require "google/cloud/talent/v4beta1/tenant_service/paths" -require "google/cloud/talent/v4beta1/tenant_service/client" -require "google/cloud/talent/v4beta1/tenant_service/rest" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service that handles tenant management, including CRUD and enumeration. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/talent/v4beta1/tenant_service" - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/talent/v4beta1/tenant_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - module TenantService - end - end - end - end -end - -helper_path = ::File.join __dir__, "tenant_service", "helpers.rb" -require "google/cloud/talent/v4beta1/tenant_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb deleted file mode 100644 index 49716d04c024..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +++ /dev/null @@ -1,899 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module TenantService - ## - # Client for the TenantService service. - # - # A service that handles tenant management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tenant_service_stub - - ## - # Configure the TenantService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::TenantService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TenantService clients - # ::Google::Cloud::Talent::V4beta1::TenantService::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", "Talent", "V4beta1"] - 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_tenant.timeout = 30.0 - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tenants.timeout = 30.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TenantService 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::Talent::V4beta1::TenantService::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 - @tenant_service_stub.universe_domain - end - - ## - # Create a new TenantService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TenantService 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/talent/v4beta1/tenant_service_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 - - @tenant_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Talent::V4beta1::TenantService::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, - logger: @config.logger - ) - - @tenant_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tenant_service_stub.logger - end - - # Service calls - - ## - # Creates a new tenant entity. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] - # Required. The tenant to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] - # Required. The tenant resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are - # updated. Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Tenant Tenant} are - # supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Talent::V4beta1::Tenant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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.tenant&.name - header_params["tenant.name"] = request.tenant.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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all tenants associated with the project. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants 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::Talent::V4beta1::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListTenantsRequest - - # Converts hash 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_tenants.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::Talent::V4beta1::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_tenants.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TenantService API. - # - # This class represents the configuration for TenantService, - # 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::Talent::V4beta1::TenantService::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_tenant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::TenantService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TenantService 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_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - - # @private - def initialize parent_rpcs = nil - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb deleted file mode 100644 index 7d5457070044..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module TenantService - # Credentials for the TenantService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs" - ] - self.env_vars = [ - "TALENT_CREDENTIALS", - "TALENT_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TALENT_CREDENTIALS_JSON", - "TALENT_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-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb deleted file mode 100644 index 8e720c2b714d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - module TenantService - # Path helper methods for the TenantService API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Tenant resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/tenants/{tenant}` - # - # @param project [String] - # @param tenant [String] - # - # @return [::String] - def tenant_path project:, tenant: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/tenants/#{tenant}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb deleted file mode 100644 index 7171b337cbab..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/version" - -require "google/cloud/talent/v4beta1/tenant_service/credentials" -require "google/cloud/talent/v4beta1/tenant_service/paths" -require "google/cloud/talent/v4beta1/tenant_service/rest/client" - -module Google - module Cloud - module Talent - module V4beta1 - ## - # A service that handles tenant management, including CRUD and enumeration. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/talent/v4beta1/tenant_service/rest" - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - module TenantService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/talent/v4beta1/tenant_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb deleted file mode 100644 index be540584dba9..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +++ /dev/null @@ -1,821 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" -require "google/cloud/talent/v4beta1/tenant_service/rest/service_stub" - -module Google - module Cloud - module Talent - module V4beta1 - module TenantService - module Rest - ## - # REST client for the TenantService service. - # - # A service that handles tenant management, including CRUD and enumeration. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "jobs.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tenant_service_stub - - ## - # Configure the TenantService Client class. - # - # See {::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TenantService clients - # ::Google::Cloud::Talent::V4beta1::TenantService::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", "Talent", "V4beta1"] - 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_tenant.timeout = 30.0 - - default_config.rpcs.get_tenant.timeout = 30.0 - default_config.rpcs.get_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_tenant.timeout = 30.0 - - default_config.rpcs.delete_tenant.timeout = 30.0 - default_config.rpcs.delete_tenant.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tenants.timeout = 30.0 - default_config.rpcs.list_tenants.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TenantService 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::Talent::V4beta1::TenantService::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 - @tenant_service_stub.universe_domain - end - - ## - # Create a new TenantService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TenantService 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 - - @tenant_service_stub = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tenant_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tenant_service_stub.logger - end - - # Service calls - - ## - # Creates a new tenant entity. - # - # @overload create_tenant(request, options = nil) - # Pass arguments to `create_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::CreateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::CreateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(parent: nil, tenant: nil) - # Pass arguments to `create_tenant` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] - # Required. The tenant to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new - # - # # Call the create_tenant method. - # result = client.create_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - # p result - # - def create_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.create_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves specified tenant. - # - # @overload get_tenant(request, options = nil) - # Pass arguments to `get_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::GetTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::GetTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `get_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new - # - # # Call the get_tenant method. - # result = client.get_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - # p result - # - def get_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.get_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates specified tenant. - # - # @overload update_tenant(request, options = nil) - # Pass arguments to `update_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(tenant: nil, update_mask: nil) - # Pass arguments to `update_tenant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tenant [::Google::Cloud::Talent::V4beta1::Tenant, ::Hash] - # Required. The tenant resource to replace the current resource in the - # system. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Strongly recommended for the best service experience. - # - # If - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are - # updated. Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Tenant Tenant} are - # supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Talent::V4beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new - # - # # Call the update_tenant method. - # result = client.update_tenant request - # - # # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - # p result - # - def update_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.update_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes specified tenant. - # - # @overload delete_tenant(request, options = nil) - # Pass arguments to `delete_tenant` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::DeleteTenantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenant(name: nil) - # Pass arguments to `delete_tenant` via keyword arguments. Note that at - # least one keyword argument is 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 tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @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/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new - # - # # Call the delete_tenant method. - # result = client.delete_tenant request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tenant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest - - # Converts hash 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_tenant.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::Talent::V4beta1::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_tenant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tenant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.delete_tenant request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all tenants associated with the project. - # - # @overload list_tenants(request, options = nil) - # Pass arguments to `list_tenants` via a request object, either of type - # {::Google::Cloud::Talent::V4beta1::ListTenantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Talent::V4beta1::ListTenantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tenants(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_tenants` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @param page_token [::String] - # The starting indicator from which to return results. - # @param page_size [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/talent/v4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new - # - # # Call the list_tenants method. - # result = client.list_tenants 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::Talent::V4beta1::Tenant. - # p item - # end - # - def list_tenants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListTenantsRequest - - # Converts hash 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_tenants.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::Talent::V4beta1::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_tenants.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tenants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tenant_service_stub.list_tenants request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TenantService REST API. - # - # This class represents the configuration for TenantService 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::Talent::V4beta1::TenantService::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_tenant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tenant.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "jobs.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TenantService 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_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tenant - ## - # RPC-specific configuration for `get_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tenant - ## - # RPC-specific configuration for `update_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tenant - ## - # RPC-specific configuration for `delete_tenant` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tenant - ## - # RPC-specific configuration for `list_tenants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tenants - - # @private - def initialize parent_rpcs = nil - create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant - @create_tenant = ::Gapic::Config::Method.new create_tenant_config - get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant - @get_tenant = ::Gapic::Config::Method.new get_tenant_config - update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant - @update_tenant = ::Gapic::Config::Method.new update_tenant_config - delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant - @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config - list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants - @list_tenants = ::Gapic::Config::Method.new list_tenants_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb deleted file mode 100644 index 8c0daaca6a92..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +++ /dev/null @@ -1,388 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" - -module Google - module Cloud - module Talent - module V4beta1 - module TenantService - module Rest - ## - # REST service stub for the TenantService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateTenantRequest] - # 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::Talent::V4beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # A result object deserialized from the server's reply - def create_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tenant_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, - method_name: "create_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::GetTenantRequest] - # 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::Talent::V4beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # A result object deserialized from the server's reply - def get_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_tenant_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, - method_name: "get_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest] - # 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::Talent::V4beta1::Tenant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # A result object deserialized from the server's reply - def update_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_tenant_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, - method_name: "update_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::Tenant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest] - # 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_tenant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tenant_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, - method_name: "delete_tenant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::ListTenantsRequest] - # 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::Talent::V4beta1::ListTenantsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Talent::V4beta1::ListTenantsResponse] - # A result object deserialized from the server's reply - def list_tenants request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tenants_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, - method_name: "list_tenants", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::CreateTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v4beta1/{parent}/tenants", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::GetTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::UpdateTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v4beta1/{tenant.name}", - body: "*", - matches: [ - ["tenant.name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tenant REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest] - # 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_tenant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/tenants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tenants REST call - # - # @param request_pb [::Google::Cloud::Talent::V4beta1::ListTenantsRequest] - # 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_tenants_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v4beta1/{parent}/tenants", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb deleted file mode 100644 index 4b937c734659..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent/v4beta1/tenant_service.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/talent/v4beta1/common_pb' -require 'google/cloud/talent/v4beta1/tenant_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n0google/cloud/talent/v4beta1/tenant_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/talent/v4beta1/common.proto\x1a(google/cloud/talent/v4beta1/tenant.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x94\x01\n\x13\x43reateTenantRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x38\n\x06tenant\x18\x02 \x01(\x0b\x32#.google.cloud.talent.v4beta1.TenantB\x03\xe0\x41\x02\"D\n\x10GetTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x13UpdateTenantRequest\x12\x38\n\x06tenant\x18\x01 \x01(\x0b\x32#.google.cloud.talent.v4beta1.TenantB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"G\n\x13\x44\x65leteTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\"\x80\x01\n\x12ListTenantsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\xa5\x01\n\x13ListTenantsResponse\x12\x34\n\x07tenants\x18\x01 \x03(\x0b\x32#.google.cloud.talent.v4beta1.Tenant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata2\xa0\x07\n\rTenantService\x12\xa6\x01\n\x0c\x43reateTenant\x12\x30.google.cloud.talent.v4beta1.CreateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"?\xda\x41\rparent,tenant\x82\xd3\xe4\x93\x02)\"$/v4beta1/{parent=projects/*}/tenants:\x01*\x12\x94\x01\n\tGetTenant\x12-.google.cloud.talent.v4beta1.GetTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{name=projects/*/tenants/*}\x12\xa6\x01\n\x0cUpdateTenant\x12\x30.google.cloud.talent.v4beta1.UpdateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant\"?\xda\x41\x06tenant\x82\xd3\xe4\x93\x02\x30\x32+/v4beta1/{tenant.name=projects/*/tenants/*}:\x01*\x12\x8d\x01\n\x0c\x44\x65leteTenant\x12\x30.google.cloud.talent.v4beta1.DeleteTenantRequest\x1a\x16.google.protobuf.Empty\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&*$/v4beta1/{name=projects/*/tenants/*}\x12\xa7\x01\n\x0bListTenants\x12/.google.cloud.talent.v4beta1.ListTenantsRequest\x1a\x30.google.cloud.talent.v4beta1.ListTenantsResponse\"5\xda\x41\x06parent\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{parent=projects/*}/tenants\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsBv\n\x1f\x63om.google.cloud.talent.v4beta1B\x12TenantServiceProtoP\x01Z7cloud.google.com/go/talent/apiv4beta1/talentpb;talentpb\xa2\x02\x03\x43TSb\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.talent.v4beta1.Tenant", "google/cloud/talent/v4beta1/tenant.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.talent.v4beta1.ResponseMetadata", "google/cloud/talent/v4beta1/common.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 Talent - module V4beta1 - CreateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateTenantRequest").msgclass - GetTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetTenantRequest").msgclass - UpdateTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateTenantRequest").msgclass - DeleteTenantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteTenantRequest").msgclass - ListTenantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListTenantsRequest").msgclass - ListTenantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListTenantsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb deleted file mode 100644 index 39df63566326..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/talent/v4beta1/tenant_service.proto for package 'google.cloud.talent.v4beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/talent/v4beta1/tenant_service_pb' - -module Google - module Cloud - module Talent - module V4beta1 - module TenantService - # A service that handles tenant management, including CRUD and enumeration. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.talent.v4beta1.TenantService' - - # Creates a new tenant entity. - rpc :CreateTenant, ::Google::Cloud::Talent::V4beta1::CreateTenantRequest, ::Google::Cloud::Talent::V4beta1::Tenant - # Retrieves specified tenant. - rpc :GetTenant, ::Google::Cloud::Talent::V4beta1::GetTenantRequest, ::Google::Cloud::Talent::V4beta1::Tenant - # Updates specified tenant. - rpc :UpdateTenant, ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, ::Google::Cloud::Talent::V4beta1::Tenant - # Deletes specified tenant. - rpc :DeleteTenant, ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, ::Google::Protobuf::Empty - # Lists all tenants associated with the project. - rpc :ListTenants, ::Google::Cloud::Talent::V4beta1::ListTenantsRequest, ::Google::Cloud::Talent::V4beta1::ListTenantsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb b/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb deleted file mode 100644 index aacd2f027ae5..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md deleted file mode 100644 index 287a6b375f8f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Talent Solution V4beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-talent-v4beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb deleted file mode 100644 index cea1d3a59a72..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/common.rb +++ /dev/null @@ -1,955 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # Message representing a period of time between two timestamps. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Begin of the period (inclusive). - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End of the period (exclusive). - class TimestampRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A resource that represents a location with full geographic information. - # @!attribute [rw] location_type - # @return [::Google::Cloud::Talent::V4beta1::Location::LocationType] - # The type of a location, which corresponds to the address lines field of - # {::Google::Type::PostalAddress google.type.PostalAddress}. For example, - # "Downtown, Atlanta, GA, USA" has a type of - # {::Google::Cloud::Talent::V4beta1::Location::LocationType::NEIGHBORHOOD LocationType.NEIGHBORHOOD}, - # and "Kansas City, KS, USA" has a type of - # {::Google::Cloud::Talent::V4beta1::Location::LocationType::LOCALITY LocationType.LOCALITY}. - # @!attribute [rw] postal_address - # @return [::Google::Type::PostalAddress] - # Postal address of the location that includes human readable information, - # such as postal delivery and payments addresses. Given a postal address, - # a postal service can deliver items to a premises, P.O. Box, or other - # delivery location. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # An object representing a latitude/longitude pair. - # @!attribute [rw] radius_miles - # @return [::Float] - # Radius in miles of the job location. This value is derived from the - # location bounding box in which a circle with the specified radius - # centered from {::Google::Type::LatLng google.type.LatLng} covers the area - # associated with the job location. For example, currently, "Mountain View, - # CA, USA" has a radius of 6.17 miles. - class Location - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enum which represents the type of a location. - module LocationType - # Default value if the type isn't specified. - LOCATION_TYPE_UNSPECIFIED = 0 - - # A country level location. - COUNTRY = 1 - - # A state or equivalent level location. - ADMINISTRATIVE_AREA = 2 - - # A county or equivalent level location. - SUB_ADMINISTRATIVE_AREA = 3 - - # A city or equivalent level location. - LOCALITY = 4 - - # A postal code level location. - POSTAL_CODE = 5 - - # A sublocality is a subdivision of a locality, for example a city borough, - # ward, or arrondissement. Sublocalities are usually recognized by a local - # political authority. For example, Manhattan and Brooklyn are recognized - # as boroughs by the City of New York, and are therefore modeled as - # sublocalities. - SUB_LOCALITY = 6 - - # A district or equivalent level location. - SUB_LOCALITY_1 = 7 - - # A smaller district or equivalent level display. - SUB_LOCALITY_2 = 8 - - # A neighborhood level location. - NEIGHBORHOOD = 9 - - # A street address level location. - STREET_ADDRESS = 10 - end - end - - # Meta information related to the job searcher or entity - # conducting the job search. This information is used to improve the - # performance of the service. - # @!attribute [rw] domain - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # The client-defined scope or source of the service call, which typically - # is the domain on - # which the service has been implemented and is currently being run. - # - # For example, if the service is being run by client Foo, Inc., on - # job board www.foo.com and career site www.bar.com, then this field is - # set to "foo.com" for use on the job board, and "bar.com" for use on the - # career site. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique domain. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] session_id - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # A unique session identification string. A session is defined as the - # duration of an end user's interaction with the service over a certain - # period. - # Obfuscate this field for privacy concerns before - # providing it to the service. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique session ID. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] user_id - # @return [::String] - # Required if - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#allow_missing_ids allow_missing_ids} - # is unset or `false`. - # - # A unique user identification string, as determined by the client. - # To have the strongest positive impact on search quality - # make sure the client-level is unique. - # Obfuscate this field for privacy concerns before - # providing it to the service. - # - # Note that any improvements to the model for a particular tenant site rely - # on this field being set correctly to a unique user ID. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] allow_missing_ids - # @return [::Boolean] - # Only set when any of - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#domain domain}, - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#session_id session_id} and - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#user_id user_id} isn't - # available for some reason. It is highly recommended not to set this field - # and provide accurate - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#domain domain}, - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#session_id session_id} and - # {::Google::Cloud::Talent::V4beta1::RequestMetadata#user_id user_id} for the best - # service experience. - # @!attribute [rw] device_info - # @return [::Google::Cloud::Talent::V4beta1::DeviceInfo] - # The type of device used by the job seeker at the time of the call to the - # service. - class RequestMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Additional information returned to client, such as debugging information. - # @!attribute [rw] request_id - # @return [::String] - # A unique id associated with this call. - # This id is logged for tracking purposes. - class ResponseMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Device information collected from the job seeker, candidate, or - # other entity conducting the job search. Providing this information improves - # the quality of the search results across devices. - # @!attribute [rw] device_type - # @return [::Google::Cloud::Talent::V4beta1::DeviceInfo::DeviceType] - # Type of the device. - # @!attribute [rw] id - # @return [::String] - # A device-specific ID. The ID must be a unique identifier that - # distinguishes the device from other devices. - class DeviceInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enumeration describing an API access portal and exposure mechanism. - module DeviceType - # The device type isn't specified. - DEVICE_TYPE_UNSPECIFIED = 0 - - # A desktop web browser, such as, Chrome, Firefox, Safari, or Internet - # Explorer) - WEB = 1 - - # A mobile device web browser, such as a phone or tablet with a Chrome - # browser. - MOBILE_WEB = 2 - - # An Android device native application. - ANDROID = 3 - - # An iOS device native application. - IOS = 4 - - # A bot, as opposed to a device operated by human beings, such as a web - # crawler. - BOT = 5 - - # Other devices types. - OTHER = 6 - end - end - - # Custom attribute values that are either filterable or non-filterable. - # @!attribute [rw] string_values - # @return [::Array<::String>] - # Exactly one of - # {::Google::Cloud::Talent::V4beta1::CustomAttribute#string_values string_values} - # or {::Google::Cloud::Talent::V4beta1::CustomAttribute#long_values long_values} - # must be specified. - # - # This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or - # `CASE_INSENSITIVE_MATCH`) search. - # For filterable `string_value`s, a maximum total number of 200 values - # is allowed, with each `string_value` has a byte size of no more than - # 500B. For unfilterable `string_values`, the maximum total byte size of - # unfilterable `string_values` is 50KB. - # - # Empty string isn't allowed. - # @!attribute [rw] long_values - # @return [::Array<::Integer>] - # Exactly one of - # {::Google::Cloud::Talent::V4beta1::CustomAttribute#string_values string_values} - # or {::Google::Cloud::Talent::V4beta1::CustomAttribute#long_values long_values} - # must be specified. - # - # This field is used to perform number range search. - # (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. - # - # Currently at most 1 - # {::Google::Cloud::Talent::V4beta1::CustomAttribute#long_values long_values} is - # supported. - # @!attribute [rw] filterable - # @return [::Boolean] - # If the `filterable` flag is true, the custom field values may be used for - # custom attribute filters - # {::Google::Cloud::Talent::V4beta1::JobQuery#custom_attribute_filter JobQuery.custom_attribute_filter}. - # If false, these values may not be used for custom attribute filters. - # - # Default is false. - # @!attribute [rw] keyword_searchable - # @return [::Boolean] - # If the `keyword_searchable` flag is true, the keywords in custom fields are - # searchable by keyword match. - # If false, the values are not searchable by keyword match. - # - # Default is false. - class CustomAttribute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Spell check result. - # @!attribute [rw] corrected - # @return [::Boolean] - # Indicates if the query was corrected by the spell checker. - # @!attribute [rw] corrected_text - # @return [::String] - # Correction output consisting of the corrected keyword string. - # @!attribute [rw] corrected_html - # @return [::String] - # Corrected output with html tags to highlight the corrected words. - # Corrected words are called out with the "..." html tags. - # - # For example, the user input query is "software enginear", where the second - # word, "enginear," is incorrect. It should be "engineer". When spelling - # correction is enabled, this value is - # "software engineer". - class SpellingCorrection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Job compensation details. - # @!attribute [rw] entries - # @return [::Array<::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry>] - # Job compensation information. - # - # At most one entry can be of type - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationType::BASE CompensationInfo.CompensationType.BASE}, - # which is referred as **base compensation entry** for the job. - # @!attribute [r] annualized_base_compensation_range - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] - # Output only. Annualized base compensation range. Computed as base - # compensation entry's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # times - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. - # - # See - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationEntry} - # for explanation on compensation annualization. - # @!attribute [r] annualized_total_compensation_range - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] - # Output only. Annualized total compensation range. Computed as all - # compensation entries' - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # times - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year CompensationEntry.expected_units_per_year}. - # - # See - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationEntry} - # for explanation on compensation annualization. - class CompensationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A compensation entry that represents one component of compensation, such - # as base pay, bonus, or other compensation type. - # - # Annualization: One compensation entry can be annualized if - # - it contains valid - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount amount} - # or - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range range}. - # - and its - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year} - # is set or can be derived. Its annualized range is determined as - # ({::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount amount} - # or - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range range}) - # times - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#expected_units_per_year expected_units_per_year}. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationType] - # Compensation type. - # - # Default is - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationType::COMPENSATION_TYPE_UNSPECIFIED CompensationType.COMPENSATION_TYPE_UNSPECIFIED}. - # @!attribute [rw] unit - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit] - # Frequency of the specified amount. - # - # Default is - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED}. - # @!attribute [rw] amount - # @return [::Google::Type::Money] - # Compensation amount. - # - # Note: The following fields are mutually exclusive: `amount`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] - # Compensation range. - # - # Note: The following fields are mutually exclusive: `range`, `amount`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] description - # @return [::String] - # Compensation description. For example, could - # indicate equity terms or provide additional context to an estimated - # bonus. - # @!attribute [rw] expected_units_per_year - # @return [::Google::Protobuf::DoubleValue] - # Expected number of units paid each year. If not specified, when - # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types} - # is FULLTIME, a default value is inferred based on - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#unit unit}. - # Default values: - # - HOURLY: 2080 - # - DAILY: 260 - # - WEEKLY: 52 - # - MONTHLY: 12 - # - ANNUAL: 1 - class CompensationEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Compensation range. - # @!attribute [rw] max_compensation - # @return [::Google::Type::Money] - # The maximum amount of compensation. If left empty, the value is set - # to a maximal compensation value and the currency code is set to - # match the {::Google::Type::Money#currency_code currency code} of - # min_compensation. - # @!attribute [rw] min_compensation - # @return [::Google::Type::Money] - # The minimum amount of compensation. If left empty, the value is set - # to zero and the currency code is set to match the - # {::Google::Type::Money#currency_code currency code} of max_compensation. - class CompensationRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of compensation. - # - # For compensation amounts specified in non-monetary amounts, - # describe the compensation scheme in the - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description}. - # - # For example, tipping format is described in - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # (for example, "expect 15-20% tips based on customer bill.") and an estimate - # of the tips provided in - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # or - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range CompensationEntry.range} - # ($10 per hour). - # - # For example, equity is described in - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and - # value estimated in - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#amount CompensationEntry.amount} - # or - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#range CompensationEntry.range}. - # If no value estimate is possible, units are - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit::COMPENSATION_UNIT_UNSPECIFIED CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED} - # and then further clarified in - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry#description CompensationEntry.description} - # field. - module CompensationType - # Default value. - COMPENSATION_TYPE_UNSPECIFIED = 0 - - # Base compensation: Refers to the fixed amount of money paid to an - # employee by an employer in return for work performed. Base compensation - # does not include benefits, bonuses or any other potential compensation - # from an employer. - BASE = 1 - - # Bonus. - BONUS = 2 - - # Signing bonus. - SIGNING_BONUS = 3 - - # Equity. - EQUITY = 4 - - # Profit sharing. - PROFIT_SHARING = 5 - - # Commission. - COMMISSIONS = 6 - - # Tips. - TIPS = 7 - - # Other compensation type. - OTHER_COMPENSATION_TYPE = 8 - end - - # Pay frequency. - module CompensationUnit - # Default value. - COMPENSATION_UNIT_UNSPECIFIED = 0 - - # Hourly. - HOURLY = 1 - - # Daily. - DAILY = 2 - - # Weekly - WEEKLY = 3 - - # Monthly. - MONTHLY = 4 - - # Yearly. - YEARLY = 5 - - # One time. - ONE_TIME = 6 - - # Other compensation units. - OTHER_COMPENSATION_UNIT = 7 - end - end - - # Metadata used for long running operations returned by CTS batch APIs. - # It's used to replace - # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata}. - # @!attribute [rw] state - # @return [::Google::Cloud::Talent::V4beta1::BatchOperationMetadata::State] - # The state of a long running operation. - # @!attribute [rw] state_description - # @return [::String] - # More detailed information about operation state. - # @!attribute [rw] success_count - # @return [::Integer] - # Count of successful item(s) inside an operation. - # @!attribute [rw] failure_count - # @return [::Integer] - # Count of failed item(s) inside an operation. - # @!attribute [rw] total_count - # @return [::Integer] - # Count of total item(s) inside an operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation is created. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation status is updated. The metadata and the - # {::Google::Cloud::Talent::V4beta1::BatchOperationMetadata#update_time update_time} - # is refreshed every minute otherwise cached data is returned. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch operation is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to `true`. - class BatchOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - module State - # Default value. - STATE_UNSPECIFIED = 0 - - # The batch operation is being prepared for processing. - INITIALIZING = 1 - - # The batch operation is actively being processed. - PROCESSING = 2 - - # The batch operation is processed, and at least one item has been - # successfully processed. - SUCCEEDED = 3 - - # The batch operation is done and no item has been successfully processed. - FAILED = 4 - - # The batch operation is in the process of cancelling after - # google.longrunning.Operations.CancelOperation - # is called. - CANCELLING = 5 - - # The batch operation is done after - # google.longrunning.Operations.CancelOperation - # is called. Any items processed before cancelling are returned in the - # response. - CANCELLED = 6 - end - end - - # An enum that represents the size of the company. - module CompanySize - # Default value if the size isn't specified. - COMPANY_SIZE_UNSPECIFIED = 0 - - # The company has less than 50 employees. - MINI = 1 - - # The company has between 50 and 99 employees. - SMALL = 2 - - # The company has between 100 and 499 employees. - SMEDIUM = 3 - - # The company has between 500 and 999 employees. - MEDIUM = 4 - - # The company has between 1,000 and 4,999 employees. - BIG = 5 - - # The company has between 5,000 and 9,999 employees. - BIGGER = 6 - - # The company has 10,000 or more employees. - GIANT = 7 - end - - # An enum that represents employee benefits included with the job. - module JobBenefit - # Default value if the type isn't specified. - JOB_BENEFIT_UNSPECIFIED = 0 - - # The job includes access to programs that support child care, such - # as daycare. - CHILD_CARE = 1 - - # The job includes dental services covered by a dental - # insurance plan. - DENTAL = 2 - - # The job offers specific benefits to domestic partners. - DOMESTIC_PARTNER = 3 - - # The job allows for a flexible work schedule. - FLEXIBLE_HOURS = 4 - - # The job includes health services covered by a medical insurance plan. - MEDICAL = 5 - - # The job includes a life insurance plan provided by the employer or - # available for purchase by the employee. - LIFE_INSURANCE = 6 - - # The job allows for a leave of absence to a parent to care for a newborn - # child. - PARENTAL_LEAVE = 7 - - # The job includes a workplace retirement plan provided by the - # employer or available for purchase by the employee. - RETIREMENT_PLAN = 8 - - # The job allows for paid time off due to illness. - SICK_DAYS = 9 - - # The job includes paid time off for vacation. - VACATION = 10 - - # The job includes vision services covered by a vision - # insurance plan. - VISION = 11 - end - - # Educational degree level defined in International Standard Classification - # of Education (ISCED). - module DegreeType - # Default value. Represents no degree, or early childhood education. - # Maps to ISCED code 0. - # Ex) Kindergarten - DEGREE_TYPE_UNSPECIFIED = 0 - - # Primary education which is typically the first stage of compulsory - # education. ISCED code 1. - # Ex) Elementary school - PRIMARY_EDUCATION = 1 - - # Lower secondary education; First stage of secondary education building on - # primary education, typically with a more subject-oriented curriculum. - # ISCED code 2. - # Ex) Middle school - LOWER_SECONDARY_EDUCATION = 2 - - # Middle education; Second/final stage of secondary education preparing for - # tertiary education and/or providing skills relevant to employment. - # Usually with an increased range of subject options and streams. ISCED - # code 3. - # Ex) High school - UPPER_SECONDARY_EDUCATION = 3 - - # Adult Remedial Education; Programmes providing learning experiences that - # build on secondary education and prepare for labour market entry and/or - # tertiary education. The content is broader than secondary but not as - # complex as tertiary education. ISCED code 4. - ADULT_REMEDIAL_EDUCATION = 4 - - # Associate's or equivalent; Short first tertiary programmes that are - # typically practically-based, occupationally-specific and prepare for - # labour market entry. These programmes may also provide a pathway to other - # tertiary programmes. ISCED code 5. - ASSOCIATES_OR_EQUIVALENT = 5 - - # Bachelor's or equivalent; Programmes designed to provide intermediate - # academic and/or professional knowledge, skills and competencies leading - # to a first tertiary degree or equivalent qualification. ISCED code 6. - BACHELORS_OR_EQUIVALENT = 6 - - # Master's or equivalent; Programmes designed to provide advanced academic - # and/or professional knowledge, skills and competencies leading to a - # second tertiary degree or equivalent qualification. ISCED code 7. - MASTERS_OR_EQUIVALENT = 7 - - # Doctoral or equivalent; Programmes designed primarily to lead to an - # advanced research qualification, usually concluding with the submission - # and defense of a substantive dissertation of publishable quality based on - # original research. ISCED code 8. - DOCTORAL_OR_EQUIVALENT = 8 - end - - # An enum that represents the employment type of a job. - module EmploymentType - # The default value if the employment type isn't specified. - EMPLOYMENT_TYPE_UNSPECIFIED = 0 - - # The job requires working a number of hours that constitute full - # time employment, typically 40 or more hours per week. - FULL_TIME = 1 - - # The job entails working fewer hours than a full time job, - # typically less than 40 hours a week. - PART_TIME = 2 - - # The job is offered as a contracted, as opposed to a salaried employee, - # position. - CONTRACTOR = 3 - - # The job is offered as a contracted position with the understanding - # that it's converted into a full-time position at the end of the - # contract. Jobs of this type are also returned by a search for - # {::Google::Cloud::Talent::V4beta1::EmploymentType::CONTRACTOR EmploymentType.CONTRACTOR} - # jobs. - CONTRACT_TO_HIRE = 4 - - # The job is offered as a temporary employment opportunity, usually - # a short-term engagement. - TEMPORARY = 5 - - # The job is a fixed-term opportunity for students or entry-level job - # seekers to obtain on-the-job training, typically offered as a summer - # position. - INTERN = 6 - - # The is an opportunity for an individual to volunteer, where there's no - # expectation of compensation for the provided services. - VOLUNTEER = 7 - - # The job requires an employee to work on an as-needed basis with a - # flexible schedule. - PER_DIEM = 8 - - # The job involves employing people in remote areas and flying them - # temporarily to the work site instead of relocating employees and their - # families permanently. - FLY_IN_FLY_OUT = 9 - - # The job does not fit any of the other listed types. - OTHER_EMPLOYMENT_TYPE = 10 - end - - # An enum that represents the required experience level required for the job. - module JobLevel - # The default value if the level isn't specified. - JOB_LEVEL_UNSPECIFIED = 0 - - # Entry-level individual contributors, typically with less than 2 years of - # experience in a similar role. Includes interns. - ENTRY_LEVEL = 1 - - # Experienced individual contributors, typically with 2+ years of - # experience in a similar role. - EXPERIENCED = 2 - - # Entry- to mid-level managers responsible for managing a team of people. - MANAGER = 3 - - # Senior-level managers responsible for managing teams of managers. - DIRECTOR = 4 - - # Executive-level managers and above, including C-level positions. - EXECUTIVE = 5 - end - - # An enum that represents the categorization or primary focus of specific - # role. This value is different than the "industry" associated with a role, - # which is related to the categorization of the company listing the job. - module JobCategory - # The default value if the category isn't specified. - JOB_CATEGORY_UNSPECIFIED = 0 - - # An accounting and finance job, such as an Accountant. - ACCOUNTING_AND_FINANCE = 1 - - # An administrative and office job, such as an Administrative Assistant. - ADMINISTRATIVE_AND_OFFICE = 2 - - # An advertising and marketing job, such as Marketing Manager. - ADVERTISING_AND_MARKETING = 3 - - # An animal care job, such as Veterinarian. - ANIMAL_CARE = 4 - - # An art, fashion, or design job, such as Designer. - ART_FASHION_AND_DESIGN = 5 - - # A business operations job, such as Business Operations Manager. - BUSINESS_OPERATIONS = 6 - - # A cleaning and facilities job, such as Custodial Staff. - CLEANING_AND_FACILITIES = 7 - - # A computer and IT job, such as Systems Administrator. - COMPUTER_AND_IT = 8 - - # A construction job, such as General Laborer. - CONSTRUCTION = 9 - - # A customer service job, such s Cashier. - CUSTOMER_SERVICE = 10 - - # An education job, such as School Teacher. - EDUCATION = 11 - - # An entertainment and travel job, such as Flight Attendant. - ENTERTAINMENT_AND_TRAVEL = 12 - - # A farming or outdoor job, such as Park Ranger. - FARMING_AND_OUTDOORS = 13 - - # A healthcare job, such as Registered Nurse. - HEALTHCARE = 14 - - # A human resources job, such as Human Resources Director. - HUMAN_RESOURCES = 15 - - # An installation, maintenance, or repair job, such as Electrician. - INSTALLATION_MAINTENANCE_AND_REPAIR = 16 - - # A legal job, such as Law Clerk. - LEGAL = 17 - - # A management job, often used in conjunction with another category, - # such as Store Manager. - MANAGEMENT = 18 - - # A manufacturing or warehouse job, such as Assembly Technician. - MANUFACTURING_AND_WAREHOUSE = 19 - - # A media, communications, or writing job, such as Media Relations. - MEDIA_COMMUNICATIONS_AND_WRITING = 20 - - # An oil, gas or mining job, such as Offshore Driller. - OIL_GAS_AND_MINING = 21 - - # A personal care and services job, such as Hair Stylist. - PERSONAL_CARE_AND_SERVICES = 22 - - # A protective services job, such as Security Guard. - PROTECTIVE_SERVICES = 23 - - # A real estate job, such as Buyer's Agent. - REAL_ESTATE = 24 - - # A restaurant and hospitality job, such as Restaurant Server. - RESTAURANT_AND_HOSPITALITY = 25 - - # A sales and/or retail job, such Sales Associate. - SALES_AND_RETAIL = 26 - - # A science and engineering job, such as Lab Technician. - SCIENCE_AND_ENGINEERING = 27 - - # A social services or non-profit job, such as Case Worker. - SOCIAL_SERVICES_AND_NON_PROFIT = 28 - - # A sports, fitness, or recreation job, such as Personal Trainer. - SPORTS_FITNESS_AND_RECREATION = 29 - - # A transportation or logistics job, such as Truck Driver. - TRANSPORTATION_AND_LOGISTICS = 30 - end - - # An enum that represents the job posting region. In most cases, job postings - # don't need to specify a region. If a region is given, jobs are - # eligible for searches in the specified region. - module PostingRegion - # If the region is unspecified, the job is only returned if it - # matches the {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter}. - POSTING_REGION_UNSPECIFIED = 0 - - # In addition to exact location matching, job posting is returned when the - # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} in the search - # query is in the same administrative area as the returned job posting. For - # example, if a `ADMINISTRATIVE_AREA` job is posted in "CA, USA", it's - # returned if {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} - # has "Mountain View". - # - # Administrative area refers to top-level administrative subdivision of this - # country. For example, US state, IT region, UK constituent nation and - # JP prefecture. - ADMINISTRATIVE_AREA = 1 - - # In addition to exact location matching, job is returned when - # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} in search - # query is in the same country as this job. For example, if a `NATION_WIDE` - # job is posted in "USA", it's returned if - # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} has 'Mountain - # View'. - NATION = 2 - - # Job allows employees to work remotely (telecommute). - # If locations are provided with this value, the job is - # considered as having a location, but telecommuting is allowed. - TELECOMMUTE = 3 - end - - # Deprecated. All resources are only visible to the owner. - # - # An enum that represents who has view access to the resource. - # @deprecated This enum is deprecated and may be removed in the next major version update. - module Visibility - # Default value. - VISIBILITY_UNSPECIFIED = 0 - - # The resource is only visible to the GCP account who owns it. - ACCOUNT_ONLY = 1 - - # The resource is visible to the owner and may be visible to other - # applications and processes at Google. - SHARED_WITH_GOOGLE = 2 - - # The resource is visible to the owner and may be visible to all other API - # clients. - SHARED_WITH_PUBLIC = 3 - end - - # Option for HTML content sanitization on user input fields, for example, job - # description. By setting this option, user can determine whether and how - # sanitization is performed on these fields. - module HtmlSanitization - # Default value. - HTML_SANITIZATION_UNSPECIFIED = 0 - - # Disables sanitization on HTML input. - HTML_SANITIZATION_DISABLED = 1 - - # Sanitizes HTML input, only accepts bold, italic, ordered list, and - # unordered list markup tags. - SIMPLE_FORMATTING_ONLY = 2 - end - - # Method for commute. - module CommuteMethod - # Commute method isn't specified. - COMMUTE_METHOD_UNSPECIFIED = 0 - - # Commute time is calculated based on driving time. - DRIVING = 1 - - # Commute time is calculated based on public transit including bus, metro, - # subway, and so on. - TRANSIT = 2 - - # Commute time is calculated based on walking time. - WALKING = 3 - - # Commute time is calculated based on biking time. - CYCLING = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb deleted file mode 100644 index d6890a73d259..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # A Company resource represents a company in the service. A company is the - # entity that owns job postings, that is, the hiring entity responsible for - # employing applicants for the job position. - # @!attribute [rw] name - # @return [::String] - # Required during company update. - # - # The resource name for a company. This is generated by the service when a - # company is created. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/companies/bar". - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the company, for example, "Google LLC". - # @!attribute [rw] external_id - # @return [::String] - # Required. Client side company identifier, used to uniquely identify the - # company. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] size - # @return [::Google::Cloud::Talent::V4beta1::CompanySize] - # The employer's company size. - # @!attribute [rw] headquarters_address - # @return [::String] - # The street address of the company's main headquarters, which may be - # different from the job location. The service attempts - # to geolocate the provided address, and populates a more specific - # location wherever possible in - # {::Google::Cloud::Talent::V4beta1::Company::DerivedInfo#headquarters_location DerivedInfo.headquarters_location}. - # @!attribute [rw] hiring_agency - # @return [::Boolean] - # Set to true if it is the hiring agency that post jobs for other - # employers. - # - # Defaults to false if not provided. - # @!attribute [rw] eeo_text - # @return [::String] - # Equal Employment Opportunity legal disclaimer text to be - # associated with all jobs, and typically to be displayed in all - # roles. - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] website_uri - # @return [::String] - # The URI representing the company's primary web site or home page, - # for example, "https://www.google.com". - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] career_site_uri - # @return [::String] - # The URI to employer's career site or careers page on the employer's web - # site, for example, "https://careers.google.com". - # @!attribute [rw] image_uri - # @return [::String] - # A URI that hosts the employer's company logo. - # @!attribute [rw] keyword_searchable_job_custom_attributes - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # This field is deprecated. Please set the searchability of the custom - # attribute in the - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} - # going forward. - # - # A list of keys of filterable - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}, - # whose corresponding `string_values` are used in keyword searches. Jobs with - # `string_values` under these specified field keys are returned if any - # of the values match the search keyword. Custom field values with - # parenthesis, brackets and special symbols are not searchable as-is, - # and those keyword queries must be surrounded by quotes. - # @!attribute [r] derived_info - # @return [::Google::Cloud::Talent::V4beta1::Company::DerivedInfo] - # Output only. Derived details about the company. - # @!attribute [r] suspended - # @return [::Boolean] - # Output only. Indicates whether a company is flagged to be suspended from - # public availability by the service when job content appears suspicious, - # abusive, or spammy. - class Company - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Derived details about the company. - # @!attribute [rw] headquarters_location - # @return [::Google::Cloud::Talent::V4beta1::Location] - # A structured headquarters location of the company, resolved from - # {::Google::Cloud::Talent::V4beta1::Company#headquarters_address Company.headquarters_address} - # if provided. - class DerivedInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb deleted file mode 100644 index d4047c822aef..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company_service.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # The Request of the CreateCompany method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created, for example, "projects/foo". - # @!attribute [rw] company - # @return [::Google::Cloud::Talent::V4beta1::Company] - # Required. The company to be created. - class CreateCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a company by name. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the company to be retrieved. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/api-test-project/tenants/foo/companies/bar". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/api-test-project/companies/bar". - class GetCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for updating a specified company. - # @!attribute [rw] company - # @return [::Google::Cloud::Talent::V4beta1::Company] - # Required. The company resource to replace the current resource in the - # system. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are - # updated. Otherwise all the fields are updated. - # - # A field mask to specify the company fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Company Company} are - # supported. - class UpdateCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a company. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the company to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo/companies/bar". - class DeleteCompanyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List companies for which the client has ACL visibility. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the company is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". - # - # If tenant id is unspecified, the default tenant will be used, for - # example, "projects/foo". - # @!attribute [rw] page_token - # @return [::String] - # The starting indicator from which to return results. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of companies to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - # @!attribute [rw] require_open_jobs - # @return [::Boolean] - # Set to true if the companies requested must have open jobs. - # - # Defaults to false. - # - # If true, at most - # {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of - # companies are fetched, among which only those with open jobs are returned. - class ListCompaniesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The List companies response object. - # @!attribute [rw] companies - # @return [::Array<::Google::Cloud::Talent::V4beta1::Company>] - # Companies for the current client. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListCompaniesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb deleted file mode 100644 index dea145e5da33..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/completion_service.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # Auto-complete parameters. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of tenant the completion is performed within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo". - # @!attribute [rw] query - # @return [::String] - # Required. The query used to generate suggestions. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # The list of languages of the query. This is - # the BCP-47 language code, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] page_size - # @return [::Integer] - # Required. Completion result count. - # - # The maximum allowed page size is 10. - # @!attribute [rw] company - # @return [::String] - # If provided, restricts completion to specified company. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used, for - # example, "projects/foo". - # @!attribute [rw] scope - # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope] - # The scope of the completion. The defaults is - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope.PUBLIC}. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] - # The completion topic. The default is - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED}. - class CompleteQueryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to specify the scope of completion. - module CompletionScope - # Default value. - COMPLETION_SCOPE_UNSPECIFIED = 0 - - # Suggestions are based only on the data provided by the client. - TENANT = 1 - - # Suggestions are based on all jobs data in the system that's visible to - # the client - PUBLIC = 2 - end - - # Enum to specify auto-completion topics. - module CompletionType - # Default value. - COMPLETION_TYPE_UNSPECIFIED = 0 - - # Suggest job titles for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::JOB_TITLE CompletionType.JOB_TITLE} - # type, only open jobs with the same - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} - # are returned. - JOB_TITLE = 1 - - # Suggest company names for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMPANY_NAME CompletionType.COMPANY_NAME} - # type, only companies having open jobs with the same - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} - # are returned. - COMPANY_NAME = 2 - - # Suggest both job titles and company names for jobs autocomplete. - # - # For - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType.COMBINED} - # type, only open jobs with the same - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} - # or companies having open jobs with the same - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes} - # are returned. - COMBINED = 3 - end - end - - # Response of auto-complete query. - # @!attribute [rw] completion_results - # @return [::Array<::Google::Cloud::Talent::V4beta1::CompleteQueryResponse::CompletionResult>] - # Results of the matching job/company candidates. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class CompleteQueryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Resource that represents completion results. - # @!attribute [rw] suggestion - # @return [::String] - # The suggestion for the query. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType] - # The completion topic. - # @!attribute [rw] image_uri - # @return [::String] - # The URI of the company image for - # {::Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMPANY_NAME COMPANY_NAME}. - class CompletionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb deleted file mode 100644 index c38408da15b3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # An event issued when an end user interacts with the application that - # implements Cloud Talent Solution. Providing this information improves the - # quality of results for the API clients, enabling the - # service to perform optimally. The number of events sent must be consistent - # with other calls, such as job searches, issued to the service by the client. - # @!attribute [rw] request_id - # @return [::String] - # Strongly recommended for the best service experience. - # - # A unique ID generated in the API responses. It can be found in - # {::Google::Cloud::Talent::V4beta1::ResponseMetadata#request_id ResponseMetadata.request_id}. - # @!attribute [rw] event_id - # @return [::String] - # Required. A unique identifier, generated by the client application. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Required. The timestamp of the event. - # @!attribute [rw] job_event - # @return [::Google::Cloud::Talent::V4beta1::JobEvent] - # An event issued when a job seeker interacts with the application that - # implements Cloud Talent Solution. - # @!attribute [rw] event_notes - # @return [::String] - # Notes about the event provided by recruiters or other users, for example, - # feedback on why a profile was bookmarked. - class ClientEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event issued when a job seeker interacts with the application that - # implements Cloud Talent Solution. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType] - # Required. The type of the event (see - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType JobEventType}). - # @!attribute [rw] jobs - # @return [::Array<::String>] - # Required. The [job name(s)][google.cloud.talent.v4beta1.Job.name] - # associated with this event. For example, if this is an - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::IMPRESSION impression} - # event, this field contains the identifiers of all jobs shown to the job - # seeker. If this was a - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::VIEW view} event, this - # field contains the identifier of the viewed job. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}", for - # example, "projects/foo/tenants/bar/jobs/baz". - # @!attribute [rw] profile - # @return [::String] - # The [profile name][google.cloud.talent.v4beta1.Profile.name] associated - # with this client event. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/profiles/\\{profile_id}", - # for example, "projects/foo/tenants/bar/profiles/baz". - class JobEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An enumeration of an event attributed to the behavior of the end user, - # such as a job seeker. - module JobEventType - # The event is unspecified by other provided values. - JOB_EVENT_TYPE_UNSPECIFIED = 0 - - # The job seeker or other entity interacting with the service has - # had a job rendered in their view, such as in a list of search results in - # a compressed or clipped format. This event is typically associated with - # the viewing of a jobs list on a single page by a job seeker. - IMPRESSION = 1 - - # The job seeker, or other entity interacting with the service, has - # viewed the details of a job, including the full description. This - # event doesn't apply to the viewing a snippet of a job appearing as a - # part of the job search results. Viewing a snippet is associated with an - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::IMPRESSION impression}). - VIEW = 2 - - # The job seeker or other entity interacting with the service - # performed an action to view a job and was redirected to a different - # website for job. - VIEW_REDIRECT = 3 - - # The job seeker or other entity interacting with the service - # began the process or demonstrated the intention of applying for a job. - APPLICATION_START = 4 - - # The job seeker or other entity interacting with the service - # submitted an application for a job. - APPLICATION_FINISH = 5 - - # The job seeker or other entity interacting with the service - # submitted an application for a job with a single click without - # entering information. If a job seeker performs this action, send only - # this event to the service. Do not also send - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START} - # or - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} - # events. - APPLICATION_QUICK_SUBMISSION = 6 - - # The job seeker or other entity interacting with the service - # performed an action to apply to a job and was redirected to a different - # website to complete the application. - APPLICATION_REDIRECT = 7 - - # The job seeker or other entity interacting with the service began the - # process or demonstrated the intention of applying for a job from the - # search results page without viewing the details of the job posting. - # If sending this event, JobEventType.VIEW event shouldn't be sent. - APPLICATION_START_FROM_SEARCH = 8 - - # The job seeker, or other entity interacting with the service, performs an - # action with a single click from the search results page to apply to a job - # (without viewing the details of the job posting), and is redirected - # to a different website to complete the application. If a candidate - # performs this action, send only this event to the service. Do not also - # send - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_START JobEventType.APPLICATION_START}, - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::APPLICATION_FINISH JobEventType.APPLICATION_FINISH} - # or - # {::Google::Cloud::Talent::V4beta1::JobEvent::JobEventType::VIEW JobEventType.VIEW} - # events. - APPLICATION_REDIRECT_FROM_SEARCH = 9 - - # This event should be used when a company submits an application - # on behalf of a job seeker. This event is intended for use by staffing - # agencies attempting to place candidates. - APPLICATION_COMPANY_SUBMIT = 10 - - # The job seeker or other entity interacting with the service demonstrated - # an interest in a job by bookmarking or saving it. - BOOKMARK = 11 - - # The job seeker or other entity interacting with the service was - # sent a notification, such as an email alert or device notification, - # containing one or more jobs listings generated by the service. - NOTIFICATION = 12 - - # The job seeker or other entity interacting with the service was - # employed by the hiring entity (employer). Send this event - # only if the job seeker was hired through an application that was - # initiated by a search conducted through the Cloud Talent Solution - # service. - HIRED = 13 - - # A recruiter or staffing agency submitted an application on behalf of the - # candidate after interacting with the service to identify a suitable job - # posting. - SENT_CV = 14 - - # The entity interacting with the service (for example, the job seeker), - # was granted an initial interview by the hiring entity (employer). This - # event should only be sent if the job seeker was granted an interview as - # part of an application that was initiated by a search conducted through / - # recommendation provided by the Cloud Talent Solution service. - INTERVIEW_GRANTED = 15 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb deleted file mode 100644 index 4423eac5eaf4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/event_service.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # The report event request. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the tenant under which the event is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created, for example, "projects/foo". - # @!attribute [rw] client_event - # @return [::Google::Cloud::Talent::V4beta1::ClientEvent] - # Required. Events issued when end user interacts with customer's application - # that uses Cloud Talent Solution. - class CreateClientEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb deleted file mode 100644 index 70809323a188..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/filters.rb +++ /dev/null @@ -1,404 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # The query required to perform a search query. - # @!attribute [rw] query - # @return [::String] - # The query string that matches against the job title, description, and - # location fields. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] query_language_code - # @return [::String] - # The language code of {::Google::Cloud::Talent::V4beta1::JobQuery#query query}. - # For example, "en-US". This field helps to better interpret the query. - # - # If a value isn't specified, the query language code is automatically - # detected, which may not be accurate. - # - # Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # @!attribute [rw] companies - # @return [::Array<::String>] - # This filter specifies the company entities to search against. - # - # If a value isn't specified, jobs are searched for against all - # companies. - # - # If multiple values are specified, jobs are searched against the - # companies specified. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/companies/bar". - # - # At most 20 company filters are allowed. - # @!attribute [rw] location_filters - # @return [::Array<::Google::Cloud::Talent::V4beta1::LocationFilter>] - # The location filter specifies geo-regions containing the jobs to - # search against. See - # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} for more - # information. - # - # If a location value isn't specified, jobs fitting the other search - # criteria are retrieved regardless of where they're located. - # - # If multiple values are specified, jobs are retrieved from any of the - # specified locations. If different values are specified for the - # {::Google::Cloud::Talent::V4beta1::LocationFilter#distance_in_miles LocationFilter.distance_in_miles} - # parameter, the maximum provided distance is used for all locations. - # - # At most 5 location filters are allowed. - # @!attribute [rw] job_categories - # @return [::Array<::Google::Cloud::Talent::V4beta1::JobCategory>] - # The category filter specifies the categories of jobs to search against. - # See {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory} for more - # information. - # - # If a value isn't specified, jobs from any category are searched against. - # - # If multiple values are specified, jobs from any of the specified - # categories are searched against. - # @!attribute [rw] commute_filter - # @return [::Google::Cloud::Talent::V4beta1::CommuteFilter] - # Allows filtering jobs by commute time with different travel methods (for - # example, driving or public transit). - # - # Note: This only works when you specify a - # {::Google::Cloud::Talent::V4beta1::CommuteMethod CommuteMethod}. In this case, - # {::Google::Cloud::Talent::V4beta1::JobQuery#location_filters location_filters} - # is ignored. - # - # Currently we don't support sorting by commute time. - # @!attribute [rw] company_display_names - # @return [::Array<::String>] - # This filter specifies the company - # {::Google::Cloud::Talent::V4beta1::Company#display_name Company.display_name} of - # the jobs to search against. The company name must match the value exactly. - # - # Alternatively, the value being searched for can be wrapped in different - # match operators. - # `SUBSTRING_MATCH([value])` - # The company name must contain a case insensitive substring match of the - # value. Using this function may increase latency. - # - # Sample Value: `SUBSTRING_MATCH(google)` - # - # `MULTI_WORD_TOKEN_MATCH([value])` - # The value will be treated as a multi word token and the company name must - # contain a case insensitive match of the value. Using this function may - # increase latency. - # - # Sample Value: `MULTI_WORD_TOKEN_MATCH(google)` - # - # If a value isn't specified, jobs within the search results are - # associated with any company. - # - # If multiple values are specified, jobs within the search results may be - # associated with any of the specified companies. - # - # At most 20 company display name filters are allowed. - # @!attribute [rw] compensation_filter - # @return [::Google::Cloud::Talent::V4beta1::CompensationFilter] - # This search filter is applied only to - # {::Google::Cloud::Talent::V4beta1::Job#compensation_info Job.compensation_info}. - # For example, if the filter is specified as "Hourly job with per-hour - # compensation > $15", only jobs meeting these criteria are searched. If a - # filter isn't defined, all open jobs are searched. - # @!attribute [rw] custom_attribute_filter - # @return [::String] - # This filter specifies a structured syntax to match against the - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} - # marked as `filterable`. - # - # The syntax for this expression is a subset of SQL syntax. - # - # Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the - # left of the operator is a custom field key and the right of the operator - # is a number or a quoted string. You must escape backslash (\\) and - # quote (\") characters. - # - # Supported functions are `LOWER([field_name])` to - # perform a case insensitive match and `EMPTY([field_name])` to filter on the - # existence of a key. - # - # Boolean expressions (AND/OR/NOT) are supported up to 3 levels of - # nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 - # comparisons or functions are allowed in the expression. The expression - # must be < 10000 bytes in length. - # - # Sample Query: - # `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND - # driving_years > 10` - # @!attribute [rw] disable_spell_check - # @return [::Boolean] - # This flag controls the spell-check feature. If false, the - # service attempts to correct a misspelled query, - # for example, "enginee" is corrected to "engineer". - # - # Defaults to false: a spell check is performed. - # @!attribute [rw] employment_types - # @return [::Array<::Google::Cloud::Talent::V4beta1::EmploymentType>] - # The employment type filter specifies the employment type of jobs to - # search against, such as - # {::Google::Cloud::Talent::V4beta1::EmploymentType::FULL_TIME EmploymentType.FULL_TIME}. - # - # If a value isn't specified, jobs in the search results includes any - # employment type. - # - # If multiple values are specified, jobs in the search results include - # any of the specified employment types. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # This filter specifies the locale of jobs to search against, - # for example, "en-US". - # - # If a value isn't specified, the search results can contain jobs in any - # locale. - # - # - # Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - # - # At most 10 language code filters are allowed. - # @!attribute [rw] publish_time_range - # @return [::Google::Cloud::Talent::V4beta1::TimestampRange] - # Jobs published within a range specified by this filter are searched - # against. - # @!attribute [rw] excluded_jobs - # @return [::Array<::String>] - # This filter specifies a list of job names to be excluded during search. - # - # At most 400 excluded job names are allowed. - class JobQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Geographic region of the search. - # @!attribute [rw] address - # @return [::String] - # The address name, such as "Mountain View" or "Bay Area". - # @!attribute [rw] region_code - # @return [::String] - # CLDR region code of the country/region. This field may be used in two ways: - # - # 1) If telecommute preference is not set, this field is used address - # ambiguity of the user-input address. For example, "Liverpool" may refer to - # "Liverpool, NY, US" or "Liverpool, UK". This region code biases the - # address resolution toward a specific country or territory. If this field is - # not set, address resolution is biased toward the United States by default. - # - # 2) If telecommute preference is set to TELECOMMUTE_ALLOWED, the - # telecommute location filter will be limited to the region specified in this - # field. If this field is not set, the telecommute job locations will not be - # - # See - # https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # The latitude and longitude of the geographic center to search from. This - # field is ignored if `address` is provided. - # @!attribute [rw] distance_in_miles - # @return [::Float] - # The distance_in_miles is applied when the location being searched for is - # identified as a city or smaller. This field is ignored if the location - # being searched for is a state or larger. - # @!attribute [rw] telecommute_preference - # @return [::Google::Cloud::Talent::V4beta1::LocationFilter::TelecommutePreference] - # Allows the client to return jobs without a - # set location, specifically, telecommuting jobs (telecommuting is considered - # by the service as a special location). - # {::Google::Cloud::Talent::V4beta1::Job#posting_region Job.posting_region} - # indicates if a job permits telecommuting. If this field is set to - # {::Google::Cloud::Talent::V4beta1::LocationFilter::TelecommutePreference::TELECOMMUTE_ALLOWED TelecommutePreference.TELECOMMUTE_ALLOWED}, - # telecommuting jobs are searched, and - # {::Google::Cloud::Talent::V4beta1::LocationFilter#address address} and - # {::Google::Cloud::Talent::V4beta1::LocationFilter#lat_lng lat_lng} are ignored. - # If not set or set to - # {::Google::Cloud::Talent::V4beta1::LocationFilter::TelecommutePreference::TELECOMMUTE_EXCLUDED TelecommutePreference.TELECOMMUTE_EXCLUDED}, - # the telecommute status of the jobs is ignored. Jobs that have - # {::Google::Cloud::Talent::V4beta1::PostingRegion::TELECOMMUTE PostingRegion.TELECOMMUTE} - # and have additional - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses} may still be - # matched based on other location filters using - # {::Google::Cloud::Talent::V4beta1::LocationFilter#address address} or - # [latlng][]. - # - # This filter can be used by itself to search exclusively for telecommuting - # jobs, or it can be combined with another location - # filter to search for a combination of job locations, - # such as "Mountain View" or "telecommuting" jobs. However, when used in - # combination with other location filters, telecommuting jobs can be - # treated as less relevant than other jobs in the search response. - # - # This field is only used for job search requests. - # @!attribute [rw] negated - # @return [::Boolean] - # Whether to apply negation to the filter so profiles matching the filter - # are excluded. - class LocationFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specify whether to include telecommute jobs. - module TelecommutePreference - # Default value if the telecommute preference isn't specified. - TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 - - # Deprecated: Ignore telecommute status of jobs. Use - # TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs. - TELECOMMUTE_EXCLUDED = 1 - - # Allow telecommute jobs. - TELECOMMUTE_ALLOWED = 2 - - # Exclude telecommute jobs. - TELECOMMUTE_JOBS_EXCLUDED = 3 - end - end - - # Filter on job compensation type and amount. - # @!attribute [rw] type - # @return [::Google::Cloud::Talent::V4beta1::CompensationFilter::FilterType] - # Required. Type of filter. - # @!attribute [rw] units - # @return [::Array<::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit>] - # Required. Specify desired `base compensation entry's` - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}. - # @!attribute [rw] range - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange] - # Compensation range. - # @!attribute [rw] include_jobs_with_unspecified_compensation_range - # @return [::Boolean] - # If set to true, jobs with unspecified compensation range fields are - # included. - class CompensationFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specify the type of filtering. - module FilterType - # Filter type unspecified. Position holder, INVALID, should never be used. - FILTER_TYPE_UNSPECIFIED = 0 - - # Filter by `base compensation entry's` unit. A job is a match if and - # only if the job contains a base CompensationEntry and the base - # CompensationEntry's unit matches provided - # {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. Populate - # one or more - # {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. - # - # See - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} - # for definition of base compensation entry. - UNIT_ONLY = 1 - - # Filter by `base compensation entry's` unit and amount / range. A job - # is a match if and only if the job contains a base CompensationEntry, and - # the base entry's unit matches provided - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationUnit} - # and amount or range overlaps with provided - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationRange CompensationRange}. - # - # See - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationEntry CompensationInfo.CompensationEntry} - # for definition of base compensation entry. - # - # Set exactly one - # {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units} and - # populate {::Google::Cloud::Talent::V4beta1::CompensationFilter#range range}. - UNIT_AND_AMOUNT = 2 - - # Filter by annualized base compensation amount and `base compensation - # entry's` unit. Populate - # {::Google::Cloud::Talent::V4beta1::CompensationFilter#range range} and zero or - # more {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. - ANNUALIZED_BASE_AMOUNT = 3 - - # Filter by annualized total compensation amount and `base compensation - # entry's` unit . Populate - # {::Google::Cloud::Talent::V4beta1::CompensationFilter#range range} and zero or - # more {::Google::Cloud::Talent::V4beta1::CompensationFilter#units units}. - ANNUALIZED_TOTAL_AMOUNT = 4 - end - end - - # Parameters needed for commute search. - # @!attribute [rw] commute_method - # @return [::Google::Cloud::Talent::V4beta1::CommuteMethod] - # Required. The method of transportation to calculate the commute time for. - # @!attribute [rw] start_coordinates - # @return [::Google::Type::LatLng] - # Required. The latitude and longitude of the location to calculate the - # commute time from. - # @!attribute [rw] travel_duration - # @return [::Google::Protobuf::Duration] - # Required. The maximum travel time in seconds. The maximum allowed value is - # `3600s` (one hour). Format is `123s`. - # @!attribute [rw] allow_imprecise_addresses - # @return [::Boolean] - # If `true`, jobs without street level addresses may also be returned. - # For city level addresses, the city center is used. For state and coarser - # level addresses, text matching is used. - # If this field is set to `false` or isn't specified, only jobs that include - # street level addresses will be returned by commute search. - # @!attribute [rw] road_traffic - # @return [::Google::Cloud::Talent::V4beta1::CommuteFilter::RoadTraffic] - # Specifies the traffic density to use when calculating commute time. - # - # Note: The following fields are mutually exclusive: `road_traffic`, `departure_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] departure_time - # @return [::Google::Type::TimeOfDay] - # The departure time used to calculate traffic impact, represented as - # {::Google::Type::TimeOfDay google.type.TimeOfDay} in local time zone. - # - # Currently traffic model is restricted to hour level resolution. - # - # Note: The following fields are mutually exclusive: `departure_time`, `road_traffic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class CommuteFilter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The traffic density to use when calculating commute time. - module RoadTraffic - # Road traffic situation isn't specified. - ROAD_TRAFFIC_UNSPECIFIED = 0 - - # Optimal commute time without considering any traffic impact. - TRAFFIC_FREE = 1 - - # Commute time calculation takes in account the peak traffic impact. - BUSY_HOUR = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb deleted file mode 100644 index 1762ad476d9f..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/histogram.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # The histogram request. - # @!attribute [rw] histogram_query - # @return [::String] - # An expression specifies a histogram request against matching resources - # (for example, jobs, profiles) for searches. - # - # See - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries} - # and - # [SearchProfilesRequest.histogram_queries][google.cloud.talent.v4beta1.SearchProfilesRequest.histogram_queries] - # for details about syntax. - class HistogramQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Histogram result that matches - # {::Google::Cloud::Talent::V4beta1::HistogramQuery HistogramQuery} specified in - # searches. - # @!attribute [rw] histogram_query - # @return [::String] - # Requested histogram expression. - # @!attribute [rw] histogram - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # A map from the values of the facet associated with distinct values to the - # number of matching entries with corresponding value. - # - # The key format is: - # - # * (for string histogram) string values stored in the field. - # * (for named numeric bucket) name specified in `bucket()` function, like - # for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. - # * (for anonymous numeric bucket) range formatted as `-`, for - # example, `0-1000`, `MIN-0`, and `0-MAX`. - class HistogramQueryResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class HistogramEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb deleted file mode 100644 index 9790455fe3f4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # A Job resource represents a job posting (also referred to as a "job listing" - # or "job requisition"). A job belongs to a - # {::Google::Cloud::Talent::V4beta1::Company Company}, which is the hiring entity - # responsible for the job. - # @!attribute [rw] name - # @return [::String] - # Required during job update. - # - # The resource name for the job. This is generated by the service when a - # job is created. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/jobs/bar". - # - # Use of this field in job queries and API calls is preferred over the use of - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id} since this - # value is unique. - # @!attribute [rw] company - # @return [::String] - # Required. The resource name of the company listing the job. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}". For - # example, "projects/foo/tenants/bar/companies/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/companies/bar". - # @!attribute [rw] requisition_id - # @return [::String] - # Required. The requisition ID, also referred to as the posting ID, is - # assigned by the client to identify a job. This field is intended to be used - # by clients for client identification and tracking of postings. A job isn't - # allowed to be created if there is another job with the same - # {::Google::Cloud::Talent::V4beta1::Job#name company}, - # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] title - # @return [::String] - # Required. The title of the job, such as "Software Engineer" - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] description - # @return [::String] - # Required. The description of the job, which typically includes a - # multi-paragraph description of the company and related information. - # Separate fields are provided on the job object for - # {::Google::Cloud::Talent::V4beta1::Job#responsibilities responsibilities}, - # {::Google::Cloud::Talent::V4beta1::Job#qualifications qualifications}, and other - # job characteristics. Use of these separate job fields is recommended. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 100,000. - # @!attribute [rw] addresses - # @return [::Array<::String>] - # Strongly recommended for the best service experience. - # - # Location(s) where the employer is looking to hire for this job posting. - # - # Specifying the full street address(es) of the hiring location enables - # better API results, especially job searches by commute time. - # - # At most 50 locations are allowed for best search performance. If a job has - # more locations, it is suggested to split it into multiple jobs with unique - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}s (e.g. - # 'ReqA' becomes 'ReqA-1', 'ReqA-2', and so on.) as multiple jobs with the - # same {::Google::Cloud::Talent::V4beta1::Job#company company}, - # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id} are not - # allowed. If the original - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id} must be - # preserved, a custom field should be used for storage. It is also suggested - # to group the locations that close to each other in the same job for better - # search experience. - # - # The maximum number of allowed characters is 500. - # @!attribute [rw] application_info - # @return [::Google::Cloud::Talent::V4beta1::Job::ApplicationInfo] - # Job application information. - # @!attribute [rw] job_benefits - # @return [::Array<::Google::Cloud::Talent::V4beta1::JobBenefit>] - # The benefits included with the job. - # @!attribute [rw] compensation_info - # @return [::Google::Cloud::Talent::V4beta1::CompensationInfo] - # Job compensation information (a.k.a. "pay rate") i.e., the compensation - # that will paid to the employee. - # @!attribute [rw] custom_attributes - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Talent::V4beta1::CustomAttribute}] - # A map of fields to hold both filterable and non-filterable custom job - # attributes that are not covered by the provided structured fields. - # - # The keys of the map are strings up to 64 bytes and must match the - # pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, key0LikeThis or - # KEY_1_LIKE_THIS. - # - # At most 100 filterable and at most 100 unfilterable keys are supported. - # For filterable `string_values`, across all keys at most 200 values are - # allowed, with each string no more than 255 characters. For unfilterable - # `string_values`, the maximum total size of `string_values` across all keys - # is 50KB. - # @!attribute [rw] degree_types - # @return [::Array<::Google::Cloud::Talent::V4beta1::DegreeType>] - # The desired education degrees for the job, such as Bachelors, Masters. - # @!attribute [rw] department - # @return [::String] - # The department or functional area within the company with the open - # position. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] employment_types - # @return [::Array<::Google::Cloud::Talent::V4beta1::EmploymentType>] - # The employment type(s) of a job, for example, - # {::Google::Cloud::Talent::V4beta1::EmploymentType::FULL_TIME full time} or - # {::Google::Cloud::Talent::V4beta1::EmploymentType::PART_TIME part time}. - # @!attribute [rw] incentives - # @return [::String] - # A description of bonus, commission, and other compensation - # incentives associated with the job not including salary or pay. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] language_code - # @return [::String] - # The language of the posting. This field is distinct from - # any requirements for fluency that are associated with the job. - # - # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". - # For more information, see - # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: - # class="external" target="_blank" }. - # - # If this field is unspecified and - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description} is present, - # detected language code based on - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description} is assigned, - # otherwise defaults to 'en_US'. - # @!attribute [rw] job_level - # @return [::Google::Cloud::Talent::V4beta1::JobLevel] - # The experience level associated with the job, such as "Entry Level". - # @!attribute [rw] promotion_value - # @return [::Integer] - # A promotion value of the job, as determined by the client. - # The value determines the sort order of the jobs returned when searching for - # jobs using the featured jobs search call, with higher promotional values - # being returned first and ties being resolved by relevance sort. Only the - # jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. - # - # Default value is 0, and negative values are treated as 0. - # @!attribute [rw] qualifications - # @return [::String] - # A description of the qualifications required to perform the - # job. The use of this field is recommended - # as an alternative to using the more general - # {::Google::Cloud::Talent::V4beta1::Job#description description} field. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] responsibilities - # @return [::String] - # A description of job responsibilities. The use of this field is - # recommended as an alternative to using the more general - # {::Google::Cloud::Talent::V4beta1::Job#description description} field. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 10,000. - # @!attribute [rw] posting_region - # @return [::Google::Cloud::Talent::V4beta1::PostingRegion] - # The job {::Google::Cloud::Talent::V4beta1::PostingRegion PostingRegion} (for - # example, state, country) throughout which the job is available. If this - # field is set, a - # {::Google::Cloud::Talent::V4beta1::LocationFilter LocationFilter} in a search - # query within the job region finds this job posting if an exact location - # match isn't specified. If this field is set to - # {::Google::Cloud::Talent::V4beta1::PostingRegion::NATION PostingRegion.NATION} or - # {::Google::Cloud::Talent::V4beta1::PostingRegion::ADMINISTRATIVE_AREA PostingRegion.ADMINISTRATIVE_AREA}, - # setting job {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses} to - # the same location level as this field is strongly recommended. - # @!attribute [rw] visibility - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Talent::V4beta1::Visibility] - # Deprecated. The job is only visible to the owner. - # - # The visibility of the job. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::Visibility::ACCOUNT_ONLY Visibility.ACCOUNT_ONLY} - # if not specified. - # @!attribute [rw] job_start_time - # @return [::Google::Protobuf::Timestamp] - # The start timestamp of the job in UTC time zone. Typically this field - # is used for contracting engagements. Invalid timestamps are ignored. - # @!attribute [rw] job_end_time - # @return [::Google::Protobuf::Timestamp] - # The end timestamp of the job. Typically this field is used for contracting - # engagements. Invalid timestamps are ignored. - # @!attribute [rw] posting_publish_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp this job posting was most recently published. The default - # value is the time the request arrives at the server. Invalid timestamps are - # ignored. - # @!attribute [rw] posting_expire_time - # @return [::Google::Protobuf::Timestamp] - # Strongly recommended for the best service experience. - # - # The expiration timestamp of the job. After this timestamp, the - # job is marked as expired, and it no longer appears in search results. The - # expired job can't be listed by the - # {::Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs ListJobs} API, but it can - # be retrieved with the - # {::Google::Cloud::Talent::V4beta1::JobService::Client#get_job GetJob} API or updated with - # the {::Google::Cloud::Talent::V4beta1::JobService::Client#update_job UpdateJob} API or - # deleted with the - # {::Google::Cloud::Talent::V4beta1::JobService::Client#delete_job DeleteJob} API. An - # expired job can be updated and opened again by using a future expiration - # timestamp. Updating an expired job fails if there is another existing open - # job with same {::Google::Cloud::Talent::V4beta1::Job#company company}, - # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}. - # - # The expired jobs are retained in our system for 90 days. However, the - # overall expired job count cannot exceed 3 times the maximum number of - # open jobs over previous 7 days. If this threshold is exceeded, - # expired jobs are cleaned out in order of earliest expire time. - # Expired jobs are no longer accessible after they are cleaned - # out. - # - # Invalid timestamps are ignored, and treated as expire time not provided. - # - # If the timestamp is before the instant request is made, the job - # is treated as expired immediately on creation. This kind of job can - # not be updated. And when creating a job with past timestamp, the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time posting_publish_time} - # must be set before - # {::Google::Cloud::Talent::V4beta1::Job#posting_expire_time posting_expire_time}. - # The purpose of this feature is to allow other objects, such as - # [Application][google.cloud.talent.v4beta1.Application], to refer a job that - # didn't exist in the system prior to becoming expired. If you want to modify - # a job that was expired on creation, delete it and create a new one. - # - # If this value isn't provided at the time of job creation or is invalid, - # the job posting expires after 30 days from the job's creation time. For - # example, if the job was created on 2017/01/01 13:00AM UTC with an - # unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. - # - # If this value isn't provided on job update, it depends on the field masks - # set by - # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask UpdateJobRequest.update_mask}. - # If the field masks include - # {::Google::Cloud::Talent::V4beta1::Job#job_end_time job_end_time}, or the masks - # are empty meaning that every field is updated, the job posting expires - # after 30 days from the job's last update time. Otherwise the expiration - # date isn't updated. - # @!attribute [r] posting_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this job posting was created. - # @!attribute [r] posting_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when this job posting was last updated. - # @!attribute [r] company_display_name - # @return [::String] - # Output only. Display name of the company listing the job. - # @!attribute [r] derived_info - # @return [::Google::Cloud::Talent::V4beta1::Job::DerivedInfo] - # Output only. Derived details about the job posting. - # @!attribute [rw] processing_options - # @return [::Google::Cloud::Talent::V4beta1::Job::ProcessingOptions] - # Options for job processing. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Application related details of a job posting. - # @!attribute [rw] emails - # @return [::Array<::String>] - # Use this field to specify email address(es) to which resumes or - # applications can be sent. - # - # The maximum number of allowed characters for each entry is 255. - # @!attribute [rw] instruction - # @return [::String] - # Use this field to provide instructions, such as "Mail your application - # to ...", that a candidate can follow to apply for the job. - # - # This field accepts and sanitizes HTML input, and also accepts - # bold, italic, ordered list, and unordered list markup tags. - # - # The maximum number of allowed characters is 3,000. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Use this URI field to direct an applicant to a website, for example to - # link to an online application form. - # - # The maximum number of allowed characters for each entry is 2,000. - class ApplicationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Derived details about the job posting. - # @!attribute [rw] locations - # @return [::Array<::Google::Cloud::Talent::V4beta1::Location>] - # Structured locations of the job, resolved from - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}. - # - # {::Google::Cloud::Talent::V4beta1::Job::DerivedInfo#locations locations} are - # exactly matched to - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses} in the same - # order. - # @!attribute [rw] job_categories - # @return [::Array<::Google::Cloud::Talent::V4beta1::JobCategory>] - # Job categories derived from - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title} and - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}. - class DerivedInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for job processing. - # @!attribute [rw] disable_street_address_resolution - # @return [::Boolean] - # If set to `true`, the service does not attempt to resolve a - # more precise address for the job. - # @!attribute [rw] html_sanitization - # @return [::Google::Cloud::Talent::V4beta1::HtmlSanitization] - # Option for job HTML content sanitization. Applied fields are: - # - # * description - # * applicationInfo.instruction - # * incentives - # * qualifications - # * responsibilities - # - # HTML tags in these fields may be stripped if sanitiazation isn't - # disabled. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::HtmlSanitization::SIMPLE_FORMATTING_ONLY HtmlSanitization.SIMPLE_FORMATTING_ONLY}. - class ProcessingOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Talent::V4beta1::CustomAttribute] - class CustomAttributesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb deleted file mode 100644 index 82110737d6ce..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb +++ /dev/null @@ -1,914 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # Create job request. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified a default tenant - # is created. For example, "projects/foo". - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4beta1::Job] - # Required. The Job to be created. - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Get job request. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the job to retrieve. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/jobs/bar". - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Update job request. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4beta1::Job] - # Required. The Job to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. - # Otherwise all the fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. - class UpdateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Delete job request. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the job to be deleted. - # - # The format is - # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For - # example, "projects/foo/tenants/bar/jobs/baz". - # - # If tenant id is unspecified, the default tenant is used. For - # example, "projects/foo/jobs/bar". - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Batch delete jobs request. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @!attribute [rw] filter - # @return [::String] - # Required. The filter string specifies the jobs to be deleted. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` (Required) - # * `requisitionId` (Required) - # - # Sample Query: companyName = "projects/foo/companies/bar" AND - # requisitionId = "req-1" - class BatchDeleteJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List jobs request. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @!attribute [rw] filter - # @return [::String] - # Required. The filter string specifies the jobs to be enumerated. - # - # Supported operator: =, AND - # - # The fields eligible for filtering are: - # - # * `companyName` - # * `requisitionId` - # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - # OPEN if no value is specified. - # - # At least one of `companyName` and `requisitionId` must present or an - # INVALID_ARGUMENT error is thrown. - # - # Sample Query: - # - # * companyName = "projects/foo/tenants/bar/companies/baz" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # requisitionId = "req-1" - # * companyName = "projects/foo/tenants/bar/companies/baz" AND - # status = "EXPIRED" - # * requisitionId = "req-1" - # * requisitionId = "req-1" AND status = "EXPIRED" - # @!attribute [rw] page_token - # @return [::String] - # The starting point of a query result. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of jobs to be returned per page of results. - # - # If {::Google::Cloud::Talent::V4beta1::ListJobsRequest#job_view job_view} is set - # to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY}, - # the maximum allowed page size is 1000. Otherwise, the maximum allowed page - # size is 100. - # - # Default is 100 if empty or a number < 1 is specified. - # @!attribute [rw] job_view - # @return [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the - # search response. Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} - # if no value is specified. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List jobs response. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4beta1::Job>] - # The Jobs for a given company. - # - # The maximum number of items returned is based on the limit field - # provided in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Request body of the `SearchJobs` call. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant to search within. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @!attribute [rw] search_mode - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode] - # Mode of a search. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}. - # @!attribute [rw] request_metadata - # @return [::Google::Cloud::Talent::V4beta1::RequestMetadata] - # Required. The meta information collected about the job searcher, used to - # improve the search quality of the service. The identifiers (such as - # `user_id`) are provided by users, and must be unique and consistent. - # @!attribute [rw] job_query - # @return [::Google::Cloud::Talent::V4beta1::JobQuery] - # Query used to search against jobs, such as keyword, location filters, etc. - # @!attribute [rw] enable_broadening - # @return [::Boolean] - # Controls whether to broaden the search when it produces sparse results. - # Broadened queries append results to the end of the matching results - # list. - # - # Defaults to false. - # @!attribute [rw] require_precise_result_size - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # This field is deprecated. - # @!attribute [rw] histogram_queries - # @return [::Array<::Google::Cloud::Talent::V4beta1::HistogramQuery>] - # An expression specifies a histogram request against matching jobs. - # - # Expression syntax is an aggregation function call with histogram facets and - # other options. - # - # Available aggregation function calls are: - # * `count(string_histogram_facet)`: Count the number of matching entities, - # for each distinct attribute value. - # * `count(numeric_histogram_facet, list of buckets)`: Count the number of - # matching entities within each bucket. - # - # A maximum of 200 histogram buckets are supported. - # - # Data types: - # - # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`. - # * String: string like "any string with backslash escape for quote(\")." - # * Number: whole number and floating point number like 10, -1 and -0.01. - # * List: list of elements with comma(,) separator surrounded by square - # brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - # - # Built-in constants: - # - # * MIN (minimum number similar to java Double.MIN_VALUE) - # * MAX (maximum number similar to java Double.MAX_VALUE) - # - # Built-in functions: - # - # * bucket(start, end[, label]): bucket built-in function creates a bucket - # with range of [start, end). Note that the end is exclusive, for example, - # bucket(1, MAX, "positive number") or bucket(1, 10). - # - # Job histogram facets: - # - # * company_display_name: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. - # * employment_type: histogram by - # {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, - # for example, - # "FULL_TIME", "PART_TIME". - # * company_size (DEPRECATED): histogram by - # {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, - # "SMALL", "MEDIUM", "BIG". - # * publish_time_in_day: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in days. - # Must specify list of numeric buckets in spec. - # * publish_time_in_month: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in months. - # Must specify list of numeric buckets in spec. - # * publish_time_in_year: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # in years. - # Must specify list of numeric buckets in spec. - # * degree_types: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#degree_types Job.degree_types}, for - # example, - # "Bachelors", "Masters". - # * job_level: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#job_level Job.job_level}, for example, - # "Entry - # Level". - # * country: histogram by the country code of jobs, for example, "US", "FR". - # * admin1: histogram by the admin1 code of jobs, which is a global - # placeholder referring to the state, province, or the particular term a - # country uses to define the geographic structure below the country level, - # for example, "CA", "IL". - # * city: histogram by a combination of the "city name, admin1 code". For - # example, "Mountain View, CA", "New York, NY". - # * admin1_country: histogram by a combination of the "admin1 code, country", - # for example, "CA, US", "IL, US". - # * city_coordinate: histogram by the city center's GPS coordinates (latitude - # and longitude), for example, 37.4038522,-122.0987765. Since the - # coordinates of a city center can change, customers may need to refresh - # them periodically. - # * locale: histogram by the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, for - # example, "en-US", - # "fr-FR". - # * language: histogram by the language subtag of the - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, - # for example, "en", "fr". - # * category: histogram by the - # {::Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example, - # "COMPUTER_AND_IT", "HEALTHCARE". - # * base_compensation_unit: histogram by the - # {::Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit} - # of base salary, for example, "WEEKLY", "MONTHLY". - # * base_compensation: histogram by the base salary. Must specify list of - # numeric buckets to group results by. - # * annualized_base_compensation: histogram by the base annualized salary. - # Must specify list of numeric buckets to group results by. - # * annualized_total_compensation: histogram by the total annualized salary. - # Must specify list of numeric buckets to group results by. - # * string_custom_attribute: histogram by string - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # string_custom_attribute["key1"]. - # * numeric_custom_attribute: histogram by numeric - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}. - # Values can be accessed via square bracket notations like - # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - # group results by. - # - # Example expressions: - # - # * `count(admin1)` - # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - # bucket(100000, MAX)])` - # * `count(string_custom_attribute["some-string-custom-attribute"])` - # * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])` - # @!attribute [rw] job_view - # @return [::Google::Cloud::Talent::V4beta1::JobView] - # The desired job attributes returned for jobs in the search response. - # Defaults to - # {::Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} - # if no value is specified. - # @!attribute [rw] offset - # @return [::Integer] - # An integer that specifies the current offset (that is, starting result - # location, amongst the jobs deemed by the API as relevant) in search - # results. This field is only considered if - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is - # unset. - # - # The maximum allowed value is 5000. Otherwise an error is thrown. - # - # For example, 0 means to return results starting from the first matching - # job, and 10 means to return from the 11th job. This can be used for - # pagination, (for example, pageSize = 10 and offset = 10 means to return - # from the second page). - # @!attribute [rw] page_size - # @return [::Integer] - # A limit on the number of jobs returned in the search results. - # Increasing this value above the default value of 10 can increase search - # response time. The value can be between 1 and 100. - # @!attribute [rw] page_token - # @return [::String] - # The token specifying the current offset within - # search results. See - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token} - # for an explanation of how to obtain the next set of query results. - # @!attribute [rw] order_by - # @return [::String] - # The criteria determining how search results are sorted. Default is - # `"relevance desc"`. - # - # Supported options are: - # - # * `"relevance desc"`: By relevance descending, as determined by the API - # algorithms. Relevance thresholding of query results is only available - # with this ordering. - # * `"posting_publish_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} - # descending. - # * `"posting_update_time desc"`: By - # {::Google::Cloud::Talent::V4beta1::Job#posting_update_time Job.posting_update_time} - # descending. - # * `"title"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # ascending. - # * `"title desc"`: By {::Google::Cloud::Talent::V4beta1::Job#title Job.title} - # descending. - # * `"annualized_base_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_base_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"annualized_total_compensation"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # ascending. Jobs whose annualized base compensation is unspecified are put - # at the end of search results. - # * `"annualized_total_compensation desc"`: By job's - # {::Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range} - # descending. Jobs whose annualized base compensation is unspecified are - # put at the end of search results. - # * `"custom_ranking desc"`: By the relevance score adjusted to the - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression} - # with weight factor assigned by - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level} - # in descending order. - # * Location sorting: Use the special syntax to order jobs by distance:
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - # multiple locations. See details below.
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - # multiple locations. See details below.
- # The string can have a maximum of 256 characters. When multiple distance - # centers are provided, a job that is close to any of the distance centers - # would have a high rank. When a job has multiple locations, the job - # location closest to one of the distance centers will be used. Jobs that - # don't have locations will be ranked at the bottom. Distance is calculated - # with a precision of 11.3 meters (37.4 feet). Diversification strategy is - # still applied unless explicitly disabled in - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}. - # @!attribute [rw] diversification_level - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel] - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE} - # if no value is specified. - # @!attribute [rw] custom_ranking_info - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo] - # Controls over how job documents get ranked on top of existing relevance - # score (determined by API algorithm). - # @!attribute [rw] disable_keyword_match - # @return [::Boolean] - # This field is deprecated. Please use - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # going forward. - # - # To migrate, disable_keyword_match set to false maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}, - # and disable_keyword_match set to true maps to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}. - # If - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode} - # is set, this field is ignored. - # - # Controls whether to disable exact keyword match on - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}. When - # disable keyword match is turned off, a keyword match returns jobs that do - # not match given category filters when there are matching keywords. For - # example, for the query "program manager," a result is returned even if the - # job posting has the title "software developer," which doesn't fall into - # "program manager" ontology, but does have "program manager" appearing in - # its description. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this flag's value. - # - # Use - # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - # - # Defaults to false. - # @!attribute [rw] keyword_match_mode - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode] - # Controls what keyword match options to use. - # - # Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # if no value is specified. - # @!attribute [rw] relevance_threshold - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::RelevanceThreshold] - # Optional. The relevance threshold of the search results. - # - # Default to Google defined threshold, leveraging a balance of - # precision and recall to deliver both highly accurate results and - # comprehensive coverage of relevant information. - class SearchJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Custom ranking information for - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] importance_level - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo::ImportanceLevel] - # Required. Controls over how important the score of - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression} - # gets applied to job's final ranking position. - # - # An error is thrown if not specified. - # @!attribute [rw] ranking_expression - # @return [::String] - # Required. Controls over how job documents get ranked on top of existing - # relevance score (determined by API algorithm). A combination of the - # ranking expression and relevance score is used to determine job's final - # ranking position. - # - # The syntax for this expression is a subset of Google SQL syntax. - # - # Supported operators are: +, -, *, /, where the left and right side of - # the operator is either a numeric - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} - # key, integer/double value or an expression that can be evaluated to a - # number. - # - # Parenthesis are supported to adjust calculation precedence. The - # expression must be < 200 characters in length. - # - # The expression is considered invalid for a job if the expression - # references custom attributes that are not populated on the job or if the - # expression results in a divide by zero. If an expression is invalid for a - # job, that job is demoted to the end of the results. - # - # Sample ranking expression - # (year + 25) * 0.25 - (freshness / 0.5) - class CustomRankingInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The importance level for - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression CustomRankingInfo.ranking_expression}. - module ImportanceLevel - # Default value if the importance level isn't specified. - IMPORTANCE_LEVEL_UNSPECIFIED = 0 - - # The given ranking expression is of None importance, existing relevance - # score (determined by API algorithm) dominates job's final ranking - # position. - NONE = 1 - - # The given ranking expression is of Low importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - LOW = 2 - - # The given ranking expression is of Mild importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - MILD = 3 - - # The given ranking expression is of Medium importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - MEDIUM = 4 - - # The given ranking expression is of High importance in terms of job's - # final ranking position compared to existing relevance - # score (determined by API algorithm). - HIGH = 5 - - # The given ranking expression is of Extreme importance, and dominates - # job's final ranking position with existing relevance - # score (determined by API algorithm) ignored. - EXTREME = 6 - end - end - - # A string-represented enumeration of the job search mode. The service - # operate differently for different modes of service. - module SearchMode - # The mode of the search method isn't specified. The default search - # behavior is identical to JOB_SEARCH search behavior. - SEARCH_MODE_UNSPECIFIED = 0 - - # The job search matches against all jobs, and featured jobs - # (jobs with promotionValue > 0) are not specially handled. - JOB_SEARCH = 1 - - # The job search matches only against featured jobs (jobs with a - # promotionValue > 0). This method doesn't return any jobs having a - # promotionValue <= 0. The search results order is determined by the - # promotionValue (jobs with a higher promotionValue are returned higher up - # in the search results), with relevance being used as a tiebreaker. - FEATURED_JOB_SEARCH = 2 - end - - # Controls whether highly similar jobs are returned next to each other in - # the search results. Jobs are identified as highly similar based on - # their titles, job categories, and locations. Highly similar results are - # clustered so that only one representative job of the cluster is - # displayed to the job seeker higher up in the results, with the other jobs - # being displayed lower down in the results. - module DiversificationLevel - # The diversification level isn't specified. - DIVERSIFICATION_LEVEL_UNSPECIFIED = 0 - - # Disables diversification. Jobs that would normally be pushed to the last - # page would not have their positions altered. This may result in highly - # similar jobs appearing in sequence in the search results. - DISABLED = 1 - - # Default diversifying behavior. The result list is ordered so that - # highly similar results are pushed to the end of the last page of search - # results. If you are using pageToken to page through the result set, - # latency might be lower but we can't guarantee that all results are - # returned. If you are using page offset, latency might be higher but all - # results are returned. - SIMPLE = 2 - end - - # Controls what keyword matching behavior the search has. When keyword - # matching is enabled, a keyword match returns jobs that may not match given - # category filters when there are matching keywords. For example, for the - # query "program manager" with KeywordMatchMode set to KEYWORD_MATCH_ALL, a - # job posting with the title "software developer," which doesn't fall into - # "program manager" ontology, and "program manager" appearing in its - # description will be surfaced. - # - # For queries like "cloud" that don't contain title or - # location specific ontology, jobs with "cloud" keyword matches are returned - # regardless of this enum's value. - # - # Use - # {::Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes} - # if company-specific globally matched custom field/attribute string values - # are needed. Enabling keyword match improves recall of subsequent search - # requests. - module KeywordMatchMode - # The keyword match option isn't specified. Defaults to - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL} - # behavior. - KEYWORD_MATCH_MODE_UNSPECIFIED = 0 - - # Disables keyword matching. - KEYWORD_MATCH_DISABLED = 1 - - # Enable keyword matching over - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}, - # {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}, - # {::Google::Cloud::Talent::V4beta1::Job#addresses Job.addresses}, - # {::Google::Cloud::Talent::V4beta1::Job#qualifications Job.qualifications}, and - # keyword searchable - # {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} - # fields. - KEYWORD_MATCH_ALL = 2 - - # Only enable keyword matching over - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}. - KEYWORD_MATCH_TITLE_ONLY = 3 - end - - # The relevance threshold of the search results. The higher relevance - # threshold is, the higher relevant results are shown and the less number of - # results are returned. - module RelevanceThreshold - # Default value. In this case, server behavior defaults to Google defined - # threshold. - RELEVANCE_THRESHOLD_UNSPECIFIED = 0 - - # Lowest relevance threshold. - LOWEST = 1 - - # Low relevance threshold. - LOW = 2 - - # Medium relevance threshold. - MEDIUM = 3 - - # High relevance threshold. - HIGH = 4 - end - end - - # Response for SearchJob method. - # @!attribute [rw] matching_jobs - # @return [::Array<::Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob>] - # The Job entities that match the specified - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] histogram_query_results - # @return [::Array<::Google::Cloud::Talent::V4beta1::HistogramQueryResult>] - # The histogram results that match with specified - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest#histogram_queries SearchJobsRequest.histogram_queries}. - # @!attribute [rw] next_page_token - # @return [::String] - # The token that specifies the starting position of the next page of results. - # This field is empty if there are no more results. - # @!attribute [rw] location_filters - # @return [::Array<::Google::Cloud::Talent::V4beta1::Location>] - # The location filters that the service applied to the specified query. If - # any filters are lat-lng based, the - # {::Google::Cloud::Talent::V4beta1::Location#location_type Location.location_type} - # is - # {::Google::Cloud::Talent::V4beta1::Location::LocationType::LOCATION_TYPE_UNSPECIFIED Location.LocationType.LOCATION_TYPE_UNSPECIFIED}. - # @!attribute [rw] estimated_total_size - # @return [::Integer] - # An estimation of the number of jobs that match the specified query. - # - # This number isn't guaranteed to be accurate. For accurate results, - # see - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse#total_size SearchJobsResponse.total_size}. - # @!attribute [rw] total_size - # @return [::Integer] - # The precise result count with limit 100,000. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - # @!attribute [rw] broadened_query_jobs_count - # @return [::Integer] - # If query broadening is enabled, we may append additional results from the - # broadened query. This number indicates how many of the jobs returned in the - # jobs field are from the broadened query. These results are always at the - # end of the jobs list. In particular, a value of 0, or if the field isn't - # set, all the jobs in the jobs list are from the original - # (without broadening) query. If this field is non-zero, subsequent requests - # with offset after this result set should contain all broadened results. - # @!attribute [rw] spell_correction - # @return [::Google::Cloud::Talent::V4beta1::SpellingCorrection] - # The spell checking result, and correction. - class SearchJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Job entry with metadata inside - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse SearchJobsResponse}. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4beta1::Job] - # Job resource that matches the specified - # {::Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}. - # @!attribute [rw] job_summary - # @return [::String] - # A summary of the job with core information that's displayed on the search - # results listing page. - # @!attribute [rw] job_title_snippet - # @return [::String] - # Contains snippets of text from the - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title} field most closely - # matching a search query's keywords, if available. The matching query - # keywords are enclosed in HTML bold tags. - # @!attribute [rw] search_text_snippet - # @return [::String] - # Contains snippets of text from the - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description} and - # similar fields that most closely match a search query's keywords, if - # available. All HTML tags in the original fields are stripped when - # returned in this field, and matching query keywords are enclosed in HTML - # bold tags. - # @!attribute [rw] commute_info - # @return [::Google::Cloud::Talent::V4beta1::SearchJobsResponse::CommuteInfo] - # Commute information which is generated based on specified - # {::Google::Cloud::Talent::V4beta1::CommuteFilter CommuteFilter}. - class MatchingJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Commute details related to this job. - # @!attribute [rw] job_location - # @return [::Google::Cloud::Talent::V4beta1::Location] - # Location used as the destination in the commute calculation. - # @!attribute [rw] travel_duration - # @return [::Google::Protobuf::Duration] - # The number of seconds required to travel to the job location from the - # query location. A duration of 0 seconds indicates that the job isn't - # reachable within the requested duration, but was returned as part of an - # expanded query. - class CommuteInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request to create a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4beta1::Job>] - # Required. The jobs to be created. - class BatchCreateJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to update a batch of jobs. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the tenant under which the job is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example, - # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - # is created. For example, "projects/foo". - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Talent::V4beta1::Job>] - # Required. The jobs to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. Be aware that it will - # also increase latency when checking the status of a batch operation. - # - # If - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the - # fields are updated. - # - # A field mask to restrict the fields that are updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Job Job} are supported. - # - # If - # {::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} - # is provided, The {::Google::Cloud::Talent::V4beta1::Job Job} inside - # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult JobResult} - # will only contains fields that is updated, plus the Id of the Job. - # Otherwise, {::Google::Cloud::Talent::V4beta1::Job Job} will include all fields, - # which can yield a very large response. - class BatchUpdateJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of - # {::Google::Cloud::Talent::V4beta1::JobService::Client#batch_create_jobs JobService.BatchCreateJobs} - # or - # {::Google::Cloud::Talent::V4beta1::JobService::Client#batch_update_jobs JobService.BatchUpdateJobs} - # APIs. It's used to replace - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # in case of success. - # @!attribute [rw] job_results - # @return [::Array<::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult>] - # List of job mutation results from a batch mutate operation. It can change - # until operation status is FINISHED, FAILED or CANCELLED. - class JobOperationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Mutation result of a job. - # @!attribute [rw] job - # @return [::Google::Cloud::Talent::V4beta1::Job] - # Here {::Google::Cloud::Talent::V4beta1::Job Job} only contains basic - # information including {::Google::Cloud::Talent::V4beta1::Job#name name}, - # {::Google::Cloud::Talent::V4beta1::Job#company company}, - # {::Google::Cloud::Talent::V4beta1::Job#language_code language_code} and - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id requisition_id}, use - # getJob method to retrieve detailed information of the created/updated - # job. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status of the job processed. This field is populated if the - # processing of the - # {::Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult#job job} - # fails. - class JobResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # An enum that specifies the job attributes that are returned in the - # {::Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob#job MatchingJob.job} - # or {::Google::Cloud::Talent::V4beta1::ListJobsResponse#jobs ListJobsResponse.jobs} - # fields. - module JobView - # Default value. - JOB_VIEW_UNSPECIFIED = 0 - - # A ID only view of job, with following attributes: - # {::Google::Cloud::Talent::V4beta1::Job#name Job.name}, - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}. - JOB_VIEW_ID_ONLY = 1 - - # A minimal view of the job, with the following attributes: - # {::Google::Cloud::Talent::V4beta1::Job#name Job.name}, - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#company Job.company}, - # {::Google::Cloud::Talent::V4beta1::Job::DerivedInfo#locations Job.DerivedInfo.locations}, - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}. - JOB_VIEW_MINIMAL = 2 - - # A small view of the job, with the following attributes in the search - # results: {::Google::Cloud::Talent::V4beta1::Job#name Job.name}, - # {::Google::Cloud::Talent::V4beta1::Job#requisition_id Job.requisition_id}, - # {::Google::Cloud::Talent::V4beta1::Job#title Job.title}, - # {::Google::Cloud::Talent::V4beta1::Job#company Job.company}, - # {::Google::Cloud::Talent::V4beta1::Job::DerivedInfo#locations Job.DerivedInfo.locations}, - # {::Google::Cloud::Talent::V4beta1::Job#visibility Job.visibility}, - # {::Google::Cloud::Talent::V4beta1::Job#language_code Job.language_code}, - # {::Google::Cloud::Talent::V4beta1::Job#description Job.description}. - JOB_VIEW_SMALL = 3 - - # All available attributes are included in the search results. - JOB_VIEW_FULL = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb deleted file mode 100644 index 753ca78ba193..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # A Tenant resource represents a tenant in the service. A tenant is a group or - # entity that shares common access with specific privileges for resources like - # profiles. Customer may create multiple tenants to provide data isolation for - # different groups. - # @!attribute [rw] name - # @return [::String] - # Required during tenant update. - # - # The resource name for a tenant. This is generated by the service when a - # tenant is created. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - # @!attribute [rw] external_id - # @return [::String] - # Required. Client side tenant identifier, used to uniquely identify the - # tenant. - # - # The maximum number of allowed characters is 255. - # @!attribute [rw] usage_type - # @return [::Google::Cloud::Talent::V4beta1::Tenant::DataUsageType] - # Indicates whether data owned by this tenant may be used to provide product - # improvements across other tenants. - # - # Defaults behavior is - # {::Google::Cloud::Talent::V4beta1::Tenant::DataUsageType::ISOLATED DataUsageType.ISOLATED} - # if it's unset. - # @!attribute [rw] keyword_searchable_profile_custom_attributes - # @return [::Array<::String>] - # A list of keys of filterable - # [Profile.custom_attributes][google.cloud.talent.v4beta1.Profile.custom_attributes], - # whose corresponding `string_values` are used in keyword searches. Profiles - # with `string_values` under these specified field keys are returned if any - # of the values match the search keyword. Custom field values with - # parenthesis, brackets and special symbols are not searchable as-is, - # and must be surrounded by quotes. - class Tenant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents how user data owned by the tenant is used. - module DataUsageType - # Default value. - DATA_USAGE_TYPE_UNSPECIFIED = 0 - - # Data owned by this tenant is used to improve search/recommendation - # quality across tenants. - AGGREGATED = 1 - - # Data owned by this tenant is used to improve search/recommendation - # quality for this tenant only. - ISOLATED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb deleted file mode 100644 index 25d9ffc34d5c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - module V4beta1 - # The Request of the CreateTenant method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @!attribute [rw] tenant - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # Required. The tenant to be created. - class CreateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a tenant by name. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the tenant to be retrieved. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - class GetTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for updating a specified tenant. - # @!attribute [rw] tenant - # @return [::Google::Cloud::Talent::V4beta1::Tenant] - # Required. The tenant resource to replace the current resource in the - # system. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Strongly recommended for the best service experience. - # - # If - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} - # is provided, only the specified fields in - # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are - # updated. Otherwise all the fields are updated. - # - # A field mask to specify the tenant fields to be updated. Only - # top level fields of {::Google::Cloud::Talent::V4beta1::Tenant Tenant} are - # supported. - class UpdateTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to delete a tenant. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the tenant to be deleted. - # - # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example, - # "projects/foo/tenants/bar". - class DeleteTenantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List tenants for which the client has ACL visibility. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the project under which the tenant is created. - # - # The format is "projects/\\{project_id}", for example, - # "projects/foo". - # @!attribute [rw] page_token - # @return [::String] - # The starting indicator from which to return results. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of tenants to be returned, at most 100. - # Default is 100 if a non-positive number is provided. - class ListTenantsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The List tenants response object. - # @!attribute [rw] tenants - # @return [::Array<::Google::Cloud::Talent::V4beta1::Tenant>] - # Tenants for the current client. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. - # @!attribute [rw] metadata - # @return [::Google::Cloud::Talent::V4beta1::ResponseMetadata] - # Additional information for the API invocation, such as the request - # tracking id. - class ListTenantsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-talent-v4beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 1b485b0c3456..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/latlng.rb deleted file mode 100644 index c15e78a39a56..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/latlng.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # An object that represents a latitude/longitude pair. This is expressed as a - # pair of doubles to represent degrees latitude and degrees longitude. Unless - # specified otherwise, this must conform to the - # WGS84 - # standard. Values must be within normalized ranges. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude in degrees. It must be in the range [-90.0, +90.0]. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude in degrees. It must be in the range [-180.0, +180.0]. - class LatLng - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb deleted file mode 100644 index 56a32eee300d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/money.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 an amount of money with its currency type. - # @!attribute [rw] currency_code - # @return [::String] - # The three-letter currency code defined in ISO 4217. - # @!attribute [rw] units - # @return [::Integer] - # The whole units of the amount. - # For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - # @!attribute [rw] nanos - # @return [::Integer] - # Number of nano (10^-9) units of the amount. - # The value must be between -999,999,999 and +999,999,999 inclusive. - # If `units` is positive, `nanos` must be positive or zero. - # If `units` is zero, `nanos` can be positive, zero, or negative. - # If `units` is negative, `nanos` must be negative or zero. - # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. - class Money - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb deleted file mode 100644 index 9cd0c16495dd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/postal_address.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 postal address, e.g. for postal delivery or payments addresses. - # Given a postal address, a postal service can deliver items to a premise, P.O. - # Box or similar. - # It is not intended to model geographical locations (roads, towns, - # mountains). - # - # In typical usage an address would be created via user input or from importing - # existing data, depending on the type of process. - # - # Advice on address input / editing: - # - Use an i18n-ready address widget such as - # https://github.com/google/libaddressinput) - # - Users should not be presented with UI elements for input or editing of - # fields outside countries where that field is used. - # - # For more guidance on how to use this schema, please see: - # https://support.google.com/business/answer/6397478 - # @!attribute [rw] revision - # @return [::Integer] - # The schema revision of the `PostalAddress`. This must be set to 0, which is - # the latest revision. - # - # All new revisions **must** be backward compatible with old revisions. - # @!attribute [rw] region_code - # @return [::String] - # Required. CLDR region code of the country/region of the address. This - # is never inferred and it is up to the user to ensure the value is - # correct. See http://cldr.unicode.org/ and - # http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html - # for details. Example: "CH" for Switzerland. - # @!attribute [rw] language_code - # @return [::String] - # Optional. BCP-47 language code of the contents of this address (if - # known). This is often the UI language of the input form or is expected - # to match one of the languages used in the address' country/region, or their - # transliterated equivalents. - # This can affect formatting in certain countries, but is not critical - # to the correctness of the data and will never affect any validation or - # other non-formatting related operations. - # - # If this value is not known, it should be omitted (rather than specifying a - # possibly incorrect default). - # - # Examples: "zh-Hant", "ja", "ja-Latn", "en". - # @!attribute [rw] postal_code - # @return [::String] - # Optional. Postal code of the address. Not all countries use or require - # postal codes to be present, but where they are used, they may trigger - # additional validation with other parts of the address (e.g. state/zip - # validation in the U.S.A.). - # @!attribute [rw] sorting_code - # @return [::String] - # Optional. Additional, country-specific, sorting code. This is not used - # in most regions. Where it is used, the value is either a string like - # "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number - # alone, representing the "sector code" (Jamaica), "delivery area indicator" - # (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). - # @!attribute [rw] administrative_area - # @return [::String] - # Optional. Highest administrative subdivision which is used for postal - # addresses of a country or region. - # For example, this can be a state, a province, an oblast, or a prefecture. - # Specifically, for Spain this is the province and not the autonomous - # community (e.g. "Barcelona" and not "Catalonia"). - # Many countries don't use an administrative area in postal addresses. E.g. - # in Switzerland this should be left unpopulated. - # @!attribute [rw] locality - # @return [::String] - # Optional. Generally refers to the city/town portion of the address. - # Examples: US city, IT comune, UK post town. - # In regions of the world where localities are not well defined or do not fit - # into this structure well, leave locality empty and use address_lines. - # @!attribute [rw] sublocality - # @return [::String] - # Optional. Sublocality of the address. - # For example, this can be neighborhoods, boroughs, districts. - # @!attribute [rw] address_lines - # @return [::Array<::String>] - # Unstructured address lines describing the lower levels of an address. - # - # Because values in address_lines do not have type information and may - # sometimes contain multiple values in a single field (e.g. - # "Austin, TX"), it is important that the line order is clear. The order of - # address lines should be "envelope order" for the country/region of the - # address. In places where this can vary (e.g. Japan), address_language is - # used to make it explicit (e.g. "ja" for large-to-small ordering and - # "ja-Latn" or "en" for small-to-large). This way, the most specific line of - # an address can be selected based on the language. - # - # The minimum permitted structural representation of an address consists - # of a region_code with all remaining information placed in the - # address_lines. It would be possible to format such an address very - # approximately without geocoding, but no semantic reasoning could be - # made about any of the address components until it was at least - # partially resolved. - # - # Creating an address only containing a region_code and address_lines, and - # then geocoding is the recommended way to handle completely unstructured - # addresses (as opposed to guessing which parts of the address should be - # localities or administrative areas). - # @!attribute [rw] recipients - # @return [::Array<::String>] - # Optional. The recipient at the address. - # This field may, under certain circumstances, contain multiline information. - # For example, it might contain "care of" information. - # @!attribute [rw] organization - # @return [::String] - # Optional. The name of the organization at the address. - class PostalAddress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 8372dad8beb8..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/proto_docs/google/type/timeofday.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 of day. The date and time zone are either not significant - # or are specified elsewhere. An API may choose to allow leap seconds. Related - # types are [google.type.Date][google.type.Date] and - # `google.protobuf.Timestamp`. - # @!attribute [rw] hours - # @return [::Integer] - # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - # to allow the value "24:00:00" for scenarios like business closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Seconds of minutes of the time. Must normally be from 0 to 59. An API may - # allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - class TimeOfDay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile deleted file mode 100644 index 4f040c286bc0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent-v4beta1", path: "../" -else - gem "google-cloud-talent-v4beta1" -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-talent-v4beta1/snippets/company_service/create_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb deleted file mode 100644 index 6b8b2dacf42b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_CreateCompany_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the create_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#create_company. -# -def create_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new - - # Call the create_company method. - result = client.create_company request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - p result -end -# [END jobs_v4beta1_generated_CompanyService_CreateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb deleted file mode 100644 index e48c9d498ed6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_DeleteCompany_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the delete_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#delete_company. -# -def delete_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new - - # Call the delete_company method. - result = client.delete_company request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4beta1_generated_CompanyService_DeleteCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb deleted file mode 100644 index 3e959944036d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_GetCompany_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the get_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#get_company. -# -def get_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new - - # Call the get_company method. - result = client.get_company request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - p result -end -# [END jobs_v4beta1_generated_CompanyService_GetCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb deleted file mode 100644 index b54cf08a88ea..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_ListCompanies_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the list_companies call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#list_companies. -# -def list_companies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new - - # Call the list_companies method. - result = client.list_companies 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::Talent::V4beta1::Company. - p item - end -end -# [END jobs_v4beta1_generated_CompanyService_ListCompanies_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb deleted file mode 100644 index 76f7dfb2fd71..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_CompanyService_UpdateCompany_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the update_company call in the CompanyService 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::Talent::V4beta1::CompanyService::Client#update_company. -# -def update_company - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new - - # Call the update_company method. - result = client.update_company request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Company. - p result -end -# [END jobs_v4beta1_generated_CompanyService_UpdateCompany_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb deleted file mode 100644 index 115a3726dcbb..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_Completion_CompleteQuery_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the complete_query call in the Completion 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::Talent::V4beta1::Completion::Client#complete_query. -# -def complete_query - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::Completion::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new - - # Call the complete_query method. - result = client.complete_query request - - # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. - p result -end -# [END jobs_v4beta1_generated_Completion_CompleteQuery_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb deleted file mode 100644 index 8bb1b5d44021..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_EventService_CreateClientEvent_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the create_client_event call in the EventService 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::Talent::V4beta1::EventService::Client#create_client_event. -# -def create_client_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::EventService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new - - # Call the create_client_event method. - result = client.create_client_event request - - # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. - p result -end -# [END jobs_v4beta1_generated_EventService_CreateClientEvent_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb deleted file mode 100644 index 52410b1d37e0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_BatchCreateJobs_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the batch_create_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#batch_create_jobs. -# -def batch_create_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new - - # Call the batch_create_jobs method. - result = client.batch_create_jobs 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 jobs_v4beta1_generated_JobService_BatchCreateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb deleted file mode 100644 index f3027a6f9bab..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the batch_delete_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#batch_delete_jobs. -# -def batch_delete_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new - - # Call the batch_delete_jobs method. - result = client.batch_delete_jobs request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb deleted file mode 100644 index 705897a8a222..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the batch_update_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#batch_update_jobs. -# -def batch_update_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new - - # Call the batch_update_jobs method. - result = client.batch_update_jobs 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 jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb deleted file mode 100644 index 2bc55828df04..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_CreateJob_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the create_job call in the JobService 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::Talent::V4beta1::JobService::Client#create_job. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Job. - p result -end -# [END jobs_v4beta1_generated_JobService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb deleted file mode 100644 index 3ae4c08f0537..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_DeleteJob_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the delete_job call in the JobService 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::Talent::V4beta1::JobService::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::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 jobs_v4beta1_generated_JobService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb deleted file mode 100644 index 5791d265581b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_GetJob_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the get_job call in the JobService 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::Talent::V4beta1::JobService::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Job. - p result -end -# [END jobs_v4beta1_generated_JobService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb deleted file mode 100644 index 3f3c15a1a8a3..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_ListJobs_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the list_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::Job. - p item - end -end -# [END jobs_v4beta1_generated_JobService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb deleted file mode 100644 index fa31d7955f21..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_SearchJobs_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the search_jobs call in the JobService 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::Talent::V4beta1::JobService::Client#search_jobs. -# -def search_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new - - # Call the search_jobs method. - result = client.search_jobs request - - # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. - p result -end -# [END jobs_v4beta1_generated_JobService_SearchJobs_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb deleted file mode 100644 index 1407454f27d0..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the search_jobs_for_alert call in the JobService 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::Talent::V4beta1::JobService::Client#search_jobs_for_alert. -# -def search_jobs_for_alert - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new - - # Call the search_jobs_for_alert method. - result = client.search_jobs_for_alert request - - # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. - p result -end -# [END jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb deleted file mode 100644 index 4e67dd7eb051..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_JobService_UpdateJob_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the update_job call in the JobService 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::Talent::V4beta1::JobService::Client#update_job. -# -def update_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::JobService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new - - # Call the update_job method. - result = client.update_job request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Job. - p result -end -# [END jobs_v4beta1_generated_JobService_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json deleted file mode 100644 index d2cdb2a5f735..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-talent-v4beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.talent.v4beta1", - "version": "v4beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "jobs_v4beta1_generated_CompanyService_CreateCompany_sync", - "title": "Snippet for the create_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#create_company.", - "file": "company_service/create_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_company", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#create_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::CreateCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" - }, - "method": { - "short_name": "CreateCompany", - "full_name": "google.cloud.talent.v4beta1.CompanyService.CreateCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4beta1.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_CompanyService_GetCompany_sync", - "title": "Snippet for the get_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#get_company.", - "file": "company_service/get_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_company", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#get_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::GetCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" - }, - "method": { - "short_name": "GetCompany", - "full_name": "google.cloud.talent.v4beta1.CompanyService.GetCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4beta1.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_CompanyService_UpdateCompany_sync", - "title": "Snippet for the update_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#update_company.", - "file": "company_service/update_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_company", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#update_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Company", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" - }, - "method": { - "short_name": "UpdateCompany", - "full_name": "google.cloud.talent.v4beta1.CompanyService.UpdateCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4beta1.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_CompanyService_DeleteCompany_sync", - "title": "Snippet for the delete_company call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#delete_company.", - "file": "company_service/delete_company.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_company", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#delete_company", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" - }, - "method": { - "short_name": "DeleteCompany", - "full_name": "google.cloud.talent.v4beta1.CompanyService.DeleteCompany", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4beta1.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_CompanyService_ListCompanies_sync", - "title": "Snippet for the list_companies call in the CompanyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::CompanyService::Client#list_companies.", - "file": "company_service/list_companies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_companies", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client#list_companies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::ListCompaniesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::ListCompaniesResponse", - "client": { - "short_name": "CompanyService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::CompanyService::Client" - }, - "method": { - "short_name": "ListCompanies", - "full_name": "google.cloud.talent.v4beta1.CompanyService.ListCompanies", - "service": { - "short_name": "CompanyService", - "full_name": "google.cloud.talent.v4beta1.CompanyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_Completion_CompleteQuery_sync", - "title": "Snippet for the complete_query call in the Completion service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::Completion::Client#complete_query.", - "file": "completion/complete_query.rb", - "language": "RUBY", - "client_method": { - "short_name": "complete_query", - "full_name": "::Google::Cloud::Talent::V4beta1::Completion::Client#complete_query", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::CompleteQueryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::CompleteQueryResponse", - "client": { - "short_name": "Completion::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::Completion::Client" - }, - "method": { - "short_name": "CompleteQuery", - "full_name": "google.cloud.talent.v4beta1.Completion.CompleteQuery", - "service": { - "short_name": "Completion", - "full_name": "google.cloud.talent.v4beta1.Completion" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_EventService_CreateClientEvent_sync", - "title": "Snippet for the create_client_event call in the EventService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::EventService::Client#create_client_event.", - "file": "event_service/create_client_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_client_event", - "full_name": "::Google::Cloud::Talent::V4beta1::EventService::Client#create_client_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::CreateClientEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::ClientEvent", - "client": { - "short_name": "EventService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::EventService::Client" - }, - "method": { - "short_name": "CreateClientEvent", - "full_name": "google.cloud.talent.v4beta1.EventService.CreateClientEvent", - "service": { - "short_name": "EventService", - "full_name": "google.cloud.talent.v4beta1.EventService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_CreateJob_sync", - "title": "Snippet for the create_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#create_job.", - "file": "job_service/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.talent.v4beta1.JobService.CreateJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_BatchCreateJobs_sync", - "title": "Snippet for the batch_create_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#batch_create_jobs.", - "file": "job_service/batch_create_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_jobs", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#batch_create_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "BatchCreateJobs", - "full_name": "google.cloud.talent.v4beta1.JobService.BatchCreateJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_GetJob_sync", - "title": "Snippet for the get_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#get_job.", - "file": "job_service/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.talent.v4beta1.JobService.GetJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_UpdateJob_sync", - "title": "Snippet for the update_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#update_job.", - "file": "job_service/update_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_job", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#update_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::UpdateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Job", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "UpdateJob", - "full_name": "google.cloud.talent.v4beta1.JobService.UpdateJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync", - "title": "Snippet for the batch_update_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#batch_update_jobs.", - "file": "job_service/batch_update_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_jobs", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#batch_update_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "BatchUpdateJobs", - "full_name": "google.cloud.talent.v4beta1.JobService.BatchUpdateJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_DeleteJob_sync", - "title": "Snippet for the delete_job call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#delete_job.", - "file": "job_service/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.talent.v4beta1.JobService.DeleteJob", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync", - "title": "Snippet for the batch_delete_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#batch_delete_jobs.", - "file": "job_service/batch_delete_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_jobs", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#batch_delete_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "BatchDeleteJobs", - "full_name": "google.cloud.talent.v4beta1.JobService.BatchDeleteJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_ListJobs_sync", - "title": "Snippet for the list_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs.", - "file": "job_service/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::ListJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.talent.v4beta1.JobService.ListJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_SearchJobs_sync", - "title": "Snippet for the search_jobs call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs.", - "file": "job_service/search_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_jobs", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::SearchJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::SearchJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "SearchJobs", - "full_name": "google.cloud.talent.v4beta1.JobService.SearchJobs", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync", - "title": "Snippet for the search_jobs_for_alert call in the JobService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs_for_alert.", - "file": "job_service/search_jobs_for_alert.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_jobs_for_alert", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs_for_alert", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::SearchJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::SearchJobsResponse", - "client": { - "short_name": "JobService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::JobService::Client" - }, - "method": { - "short_name": "SearchJobsForAlert", - "full_name": "google.cloud.talent.v4beta1.JobService.SearchJobsForAlert", - "service": { - "short_name": "JobService", - "full_name": "google.cloud.talent.v4beta1.JobService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_TenantService_CreateTenant_sync", - "title": "Snippet for the create_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#create_tenant.", - "file": "tenant_service/create_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tenant", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#create_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::CreateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" - }, - "method": { - "short_name": "CreateTenant", - "full_name": "google.cloud.talent.v4beta1.TenantService.CreateTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4beta1.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_TenantService_GetTenant_sync", - "title": "Snippet for the get_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#get_tenant.", - "file": "tenant_service/get_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tenant", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#get_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::GetTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" - }, - "method": { - "short_name": "GetTenant", - "full_name": "google.cloud.talent.v4beta1.TenantService.GetTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4beta1.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_TenantService_UpdateTenant_sync", - "title": "Snippet for the update_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#update_tenant.", - "file": "tenant_service/update_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tenant", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#update_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::UpdateTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::Tenant", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" - }, - "method": { - "short_name": "UpdateTenant", - "full_name": "google.cloud.talent.v4beta1.TenantService.UpdateTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4beta1.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_TenantService_DeleteTenant_sync", - "title": "Snippet for the delete_tenant call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#delete_tenant.", - "file": "tenant_service/delete_tenant.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tenant", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#delete_tenant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::DeleteTenantRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" - }, - "method": { - "short_name": "DeleteTenant", - "full_name": "google.cloud.talent.v4beta1.TenantService.DeleteTenant", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4beta1.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "jobs_v4beta1_generated_TenantService_ListTenants_sync", - "title": "Snippet for the list_tenants call in the TenantService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Talent::V4beta1::TenantService::Client#list_tenants.", - "file": "tenant_service/list_tenants.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tenants", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client#list_tenants", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Talent::V4beta1::ListTenantsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Talent::V4beta1::ListTenantsResponse", - "client": { - "short_name": "TenantService::Client", - "full_name": "::Google::Cloud::Talent::V4beta1::TenantService::Client" - }, - "method": { - "short_name": "ListTenants", - "full_name": "google.cloud.talent.v4beta1.TenantService.ListTenants", - "service": { - "short_name": "TenantService", - "full_name": "google.cloud.talent.v4beta1.TenantService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb deleted file mode 100644 index cfe7e22a91f5..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_CreateTenant_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the create_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#create_tenant. -# -def create_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new - - # Call the create_tenant method. - result = client.create_tenant request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - p result -end -# [END jobs_v4beta1_generated_TenantService_CreateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb deleted file mode 100644 index 33b7ae2f4b24..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_DeleteTenant_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the delete_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#delete_tenant. -# -def delete_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new - - # Call the delete_tenant method. - result = client.delete_tenant request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END jobs_v4beta1_generated_TenantService_DeleteTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb deleted file mode 100644 index e4b463bf9e47..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_GetTenant_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the get_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#get_tenant. -# -def get_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new - - # Call the get_tenant method. - result = client.get_tenant request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - p result -end -# [END jobs_v4beta1_generated_TenantService_GetTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb deleted file mode 100644 index c79441100dcd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_ListTenants_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the list_tenants call in the TenantService 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::Talent::V4beta1::TenantService::Client#list_tenants. -# -def list_tenants - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new - - # Call the list_tenants method. - result = client.list_tenants 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::Talent::V4beta1::Tenant. - p item - end -end -# [END jobs_v4beta1_generated_TenantService_ListTenants_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb b/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb deleted file mode 100644 index e2ec529755a4..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 jobs_v4beta1_generated_TenantService_UpdateTenant_sync] -require "google/cloud/talent/v4beta1" - -## -# Snippet for the update_tenant call in the TenantService 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::Talent::V4beta1::TenantService::Client#update_tenant. -# -def update_tenant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Talent::V4beta1::TenantService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new - - # Call the update_tenant method. - result = client.update_tenant request - - # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. - p result -end -# [END jobs_v4beta1_generated_TenantService_UpdateTenant_sync] diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb deleted file mode 100644 index df4661f2e50d..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_paths_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service" - -class ::Google::Cloud::Talent::V4beta1::CompanyService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - - path = client.company_path project: "value0", company: "value1" - assert_equal "projects/value0/companies/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb deleted file mode 100644 index ffe14d2e9497..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_rest_test.rb +++ /dev/null @@ -1,374 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" -require "google/cloud/talent/v4beta1/company_service/rest" - - -class ::Google::Cloud::Talent::V4beta1::CompanyService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - company = {} - - create_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_create_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_company({ parent: parent, company: company }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_company parent: parent, company: company do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_company ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_company({ parent: parent, company: company }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_company(::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_company_client_stub.call_count - end - end - end - - def test_get_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_get_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_company({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_company name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_company ::Google::Cloud::Talent::V4beta1::GetCompanyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_company({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_company(::Google::Cloud::Talent::V4beta1::GetCompanyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_company_client_stub.call_count - end - end - end - - def test_update_company - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Company.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - company = {} - update_mask = {} - - update_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_update_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_company({ company: company, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_company company: company, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_company ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_company({ company: company, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_company(::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_company_client_stub.call_count - end - end - end - - def test_delete_company - # 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_company_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_delete_company_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_company({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_company name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_company ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_company({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_company(::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_company_client_stub.call_count - end - end - end - - def test_list_companies - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - require_open_jobs = true - - list_companies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::CompanyService::Rest::ServiceStub.stub :transcode_list_companies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_companies_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_companies ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_companies(::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_companies_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::Talent::V4beta1::CompanyService::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::Talent::V4beta1::CompanyService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb deleted file mode 100644 index 326db3adc85c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/company_service_test.rb +++ /dev/null @@ -1,409 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/company_service_pb" -require "google/cloud/talent/v4beta1/company_service" - -class ::Google::Cloud::Talent::V4beta1::CompanyService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::Company.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" - company = {} - - create_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_company, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Company), request["company"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_company({ parent: parent, company: company }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_company parent: parent, company: company do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_company ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_company({ parent: parent, company: company }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_company(::Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new(parent: parent, company: company), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_company_client_stub.call_rpc_count - end - end - - def test_get_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::Company.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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_company, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::GetCompanyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_company({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_company name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_company ::Google::Cloud::Talent::V4beta1::GetCompanyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_company({ 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_company(::Google::Cloud::Talent::V4beta1::GetCompanyRequest.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_company_client_stub.call_rpc_count - end - end - - def test_update_company - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::Company.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. - company = {} - update_mask = {} - - update_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_company, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Company), request["company"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_company({ company: company, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_company company: company, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_company ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, 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_company({ company: company, 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_company(::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new(company: company, 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_company_client_stub.call_rpc_count - end - end - - def test_delete_company - # 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_company_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_company, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_company_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_company({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_company name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_company ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_company({ 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_company(::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.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_company_client_stub.call_rpc_count - end - end - - def test_list_companies - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::ListCompaniesResponse.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_token = "hello world" - page_size = 42 - require_open_jobs = true - - list_companies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_companies, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal true, request["require_open_jobs"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_companies_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }) 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_companies parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs 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_companies ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs) 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_companies({ parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs }, 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_companies(::Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new(parent: parent, page_token: page_token, page_size: page_size, require_open_jobs: require_open_jobs), 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_companies_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::Talent::V4beta1::CompanyService::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::Talent::V4beta1::CompanyService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4beta1::CompanyService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb deleted file mode 100644 index 79274afedf5b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_paths_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion" - -class ::Google::Cloud::Talent::V4beta1::Completion::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - - path = client.company_path project: "value0", company: "value1" - assert_equal "projects/value0/companies/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb deleted file mode 100644 index 805eb4d0755b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_rest_test.rb +++ /dev/null @@ -1,159 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" -require "google/cloud/talent/v4beta1/completion/rest" - - -class ::Google::Cloud::Talent::V4beta1::Completion::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - language_codes = ["hello world"] - page_size = 42 - company = "hello world" - scope = :COMPLETION_SCOPE_UNSPECIFIED - type = :COMPLETION_TYPE_UNSPECIFIED - - complete_query_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::Completion::Rest::ServiceStub.stub :transcode_complete_query_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::Completion::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.complete_query parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, complete_query_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::Talent::V4beta1::Completion::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::Talent::V4beta1::Completion::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb deleted file mode 100644 index 7c545fda4a14..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/completion_test.rb +++ /dev/null @@ -1,174 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/completion_service_pb" -require "google/cloud/talent/v4beta1/completion" - -class ::Google::Cloud::Talent::V4beta1::Completion::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_complete_query - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::CompleteQueryResponse.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" - query = "hello world" - language_codes = ["hello world"] - page_size = 42 - company = "hello world" - scope = :COMPLETION_SCOPE_UNSPECIFIED - type = :COMPLETION_TYPE_UNSPECIFIED - - complete_query_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :complete_query, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["query"] - assert_equal ["hello world"], request["language_codes"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["company"] - assert_equal :COMPLETION_SCOPE_UNSPECIFIED, request["scope"] - assert_equal :COMPLETION_TYPE_UNSPECIFIED, request["type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, complete_query_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.complete_query parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.complete_query ::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.complete_query({ parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.complete_query(::Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new(parent: parent, query: query, language_codes: language_codes, page_size: page_size, company: company, scope: scope, type: type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, complete_query_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::Talent::V4beta1::Completion::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::Talent::V4beta1::Completion::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4beta1::Completion::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4beta1::Completion::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb deleted file mode 100644 index 62494d741f26..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service" - -class ::Google::Cloud::Talent::V4beta1::EventService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb deleted file mode 100644 index 367e17cac38c..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_rest_test.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" -require "google/cloud/talent/v4beta1/event_service/rest" - - -class ::Google::Cloud::Talent::V4beta1::EventService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_client_event - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::ClientEvent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - client_event = {} - - create_client_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::EventService::Rest::ServiceStub.stub :transcode_create_client_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_client_event_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::EventService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_client_event({ parent: parent, client_event: client_event }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_client_event parent: parent, client_event: client_event do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_client_event ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_client_event({ parent: parent, client_event: client_event }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_client_event(::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_client_event_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::Talent::V4beta1::EventService::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::Talent::V4beta1::EventService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb deleted file mode 100644 index 3c1fe220a445..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/event_service_test.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/event_service_pb" -require "google/cloud/talent/v4beta1/event_service" - -class ::Google::Cloud::Talent::V4beta1::EventService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_client_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::ClientEvent.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" - client_event = {} - - create_client_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_client_event, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::ClientEvent), request["client_event"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_client_event_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_client_event({ parent: parent, client_event: client_event }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_client_event parent: parent, client_event: client_event do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_client_event ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_client_event({ parent: parent, client_event: client_event }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_client_event(::Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new(parent: parent, client_event: client_event), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_client_event_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::Talent::V4beta1::EventService::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::Talent::V4beta1::EventService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4beta1::EventService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4beta1::EventService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb deleted file mode 100644 index c9ea942034fd..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" -require "google/cloud/talent/v4beta1/job_service_services_pb" -require "google/cloud/talent/v4beta1/job_service" - -class ::Google::Cloud::Talent::V4beta1::JobService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb deleted file mode 100644 index 6905c8128013..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_paths_test.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service" - -class ::Google::Cloud::Talent::V4beta1::JobService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_company_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.company_path project: "value0", tenant: "value1", company: "value2" - assert_equal "projects/value0/tenants/value1/companies/value2", path - - path = client.company_path project: "value0", company: "value1" - assert_equal "projects/value0/companies/value1", path - end - end - - def test_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", tenant: "value1", job: "value2" - assert_equal "projects/value0/tenants/value1/jobs/value2", path - - path = client.job_path project: "value0", job: "value1" - assert_equal "projects/value0/jobs/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb deleted file mode 100644 index b5233fe24bbf..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_rest_test.rb +++ /dev/null @@ -1,681 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" -require "google/cloud/talent/v4beta1/job_service/rest" - - -class ::Google::Cloud::Talent::V4beta1::JobService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job: job do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_batch_create_jobs - # 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" - jobs = [{}] - - batch_create_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_batch_create_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_jobs({ parent: parent, jobs: jobs }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_jobs parent: parent, jobs: jobs do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_jobs ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_jobs({ parent: parent, jobs: jobs }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_jobs(::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_jobs_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Talent::V4beta1::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Talent::V4beta1::GetJobRequest.new(name: name), 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_update_job - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_job({ job: job, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_job 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::Talent::V4beta1::UpdateJobRequest.new(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({ 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::Talent::V4beta1::UpdateJobRequest.new(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_batch_update_jobs - # 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" - jobs = [{}] - update_mask = {} - - batch_update_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_batch_update_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_update_jobs ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_update_jobs(::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_jobs_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. - name = "hello world" - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Talent::V4beta1::DeleteJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Talent::V4beta1::DeleteJobRequest.new(name: name), 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_batch_delete_jobs - # 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. - parent = "hello world" - filter = "hello world" - - batch_delete_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_batch_delete_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_delete_jobs({ parent: parent, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_delete_jobs parent: parent, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_delete_jobs ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_delete_jobs({ parent: parent, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_delete_jobs(::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_jobs_client_stub.call_count - end - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - job_view = :JOB_VIEW_UNSPECIFIED - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - require_precise_result_size = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_search_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_jobs ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_jobs(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_jobs_client_stub.call_count - end - end - end - - def test_search_jobs_for_alert - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - require_precise_result_size = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_for_alert_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::JobService::Rest::ServiceStub.stub :transcode_search_jobs_for_alert_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_jobs_for_alert_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_jobs_for_alert ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_jobs_for_alert(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_jobs_for_alert_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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb deleted file mode 100644 index 1ad88b2a3848..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/job_service_test.rb +++ /dev/null @@ -1,797 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/job_service_pb" -require "google/cloud/talent/v4beta1/job_service" - -class ::Google::Cloud::Talent::V4beta1::JobService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::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. - parent = "hello world" - job = {} - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Job), request["job"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job: job }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_job parent: parent, job: job do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_job ::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_job({ parent: parent, job: job }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Talent::V4beta1::CreateJobRequest.new(parent: parent, job: job), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_rpc_count - end - end - - def test_batch_create_jobs - # 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" - jobs = [{}] - - batch_create_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Talent::V4beta1::Job, request["jobs"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_jobs({ parent: parent, jobs: jobs }) 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.batch_create_jobs parent: parent, jobs: jobs 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.batch_create_jobs ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs) 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.batch_create_jobs({ parent: parent, jobs: jobs }, 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.batch_create_jobs(::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new(parent: parent, jobs: jobs), 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, batch_create_jobs_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::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. - name = "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::Talent::V4beta1::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Talent::V4beta1::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ 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_job(::Google::Cloud::Talent::V4beta1::GetJobRequest.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_job_client_stub.call_rpc_count - end - end - - def test_update_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::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. - 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::Talent::V4beta1::UpdateJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::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::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_job({ 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 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::Talent::V4beta1::UpdateJobRequest.new(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({ 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::Talent::V4beta1::UpdateJobRequest.new(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_batch_update_jobs - # 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" - jobs = [{}] - update_mask = {} - - batch_update_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Talent::V4beta1::Job, request["jobs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }) 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.batch_update_jobs parent: parent, jobs: jobs, update_mask: update_mask 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.batch_update_jobs ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask) 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.batch_update_jobs({ parent: parent, jobs: jobs, update_mask: update_mask }, 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.batch_update_jobs(::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new(parent: parent, jobs: jobs, update_mask: update_mask), 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, batch_update_jobs_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. - name = "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::Talent::V4beta1::DeleteJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Talent::V4beta1::DeleteJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ 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_job(::Google::Cloud::Talent::V4beta1::DeleteJobRequest.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_job_client_stub.call_rpc_count - end - end - - def test_batch_delete_jobs - # 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. - parent = "hello world" - filter = "hello world" - - batch_delete_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_delete_jobs({ parent: parent, filter: filter }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_delete_jobs parent: parent, filter: filter do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_delete_jobs ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_delete_jobs({ parent: parent, filter: filter }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_delete_jobs(::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new(parent: parent, filter: filter), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_delete_jobs_client_stub.call_rpc_count - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::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. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - job_view = :JOB_VIEW_UNSPECIFIED - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::ListJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }) 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 parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view 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::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view) 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({ parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view }, 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::Talent::V4beta1::ListJobsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size, job_view: job_view), 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_search_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.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" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - require_precise_result_size = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_jobs, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::RequestMetadata), request["request_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::JobQuery), request["job_query"] - assert_equal true, request["enable_broadening"] - assert_equal true, request["require_precise_result_size"] - assert_kind_of ::Google::Cloud::Talent::V4beta1::HistogramQuery, request["histogram_queries"].first - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - assert_equal 42, request["offset"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] - assert_equal true, request["disable_keyword_match"] - assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_jobs_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_jobs parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_jobs ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_jobs({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_jobs(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_jobs_client_stub.call_rpc_count - end - end - - def test_search_jobs_for_alert - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::SearchJobsResponse.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" - search_mode = :SEARCH_MODE_UNSPECIFIED - request_metadata = {} - job_query = {} - enable_broadening = true - require_precise_result_size = true - histogram_queries = [{}] - job_view = :JOB_VIEW_UNSPECIFIED - offset = 42 - page_size = 42 - page_token = "hello world" - order_by = "hello world" - diversification_level = :DIVERSIFICATION_LEVEL_UNSPECIFIED - custom_ranking_info = {} - disable_keyword_match = true - keyword_match_mode = :KEYWORD_MATCH_MODE_UNSPECIFIED - relevance_threshold = :RELEVANCE_THRESHOLD_UNSPECIFIED - - search_jobs_for_alert_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_jobs_for_alert, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :SEARCH_MODE_UNSPECIFIED, request["search_mode"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::RequestMetadata), request["request_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::JobQuery), request["job_query"] - assert_equal true, request["enable_broadening"] - assert_equal true, request["require_precise_result_size"] - assert_kind_of ::Google::Cloud::Talent::V4beta1::HistogramQuery, request["histogram_queries"].first - assert_equal :JOB_VIEW_UNSPECIFIED, request["job_view"] - assert_equal 42, request["offset"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["order_by"] - assert_equal :DIVERSIFICATION_LEVEL_UNSPECIFIED, request["diversification_level"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo), request["custom_ranking_info"] - assert_equal true, request["disable_keyword_match"] - assert_equal :KEYWORD_MATCH_MODE_UNSPECIFIED, request["keyword_match_mode"] - assert_equal :RELEVANCE_THRESHOLD_UNSPECIFIED, request["relevance_threshold"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_jobs_for_alert_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_jobs_for_alert parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_jobs_for_alert ::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_jobs_for_alert({ parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_jobs_for_alert(::Google::Cloud::Talent::V4beta1::SearchJobsRequest.new(parent: parent, search_mode: search_mode, request_metadata: request_metadata, job_query: job_query, enable_broadening: enable_broadening, require_precise_result_size: require_precise_result_size, histogram_queries: histogram_queries, job_view: job_view, offset: offset, page_size: page_size, page_token: page_token, order_by: order_by, diversification_level: diversification_level, custom_ranking_info: custom_ranking_info, disable_keyword_match: disable_keyword_match, keyword_match_mode: keyword_match_mode, relevance_threshold: relevance_threshold), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_jobs_for_alert_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::Talent::V4beta1::JobService::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::Talent::V4beta1::JobService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4beta1::JobService::Client, client - assert_equal creds, client.configure.credentials - end - 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::Talent::V4beta1::JobService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Talent::V4beta1::JobService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb deleted file mode 100644 index ca6ff0d05b1b..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service" - -class ::Google::Cloud::Talent::V4beta1::TenantService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tenant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tenant_path project: "value0", tenant: "value1" - assert_equal "projects/value0/tenants/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb deleted file mode 100644 index e84949a6e6c6..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_rest_test.rb +++ /dev/null @@ -1,373 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" -require "google/cloud/talent/v4beta1/tenant_service/rest" - - -class ::Google::Cloud::Talent::V4beta1::TenantService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - tenant = {} - - create_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_create_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_tenant({ parent: parent, tenant: tenant }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_tenant parent: parent, tenant: tenant do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant: tenant }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_count - end - end - end - - def test_get_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_get_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_tenant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_tenant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::Talent::V4beta1::GetTenantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_tenant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_tenant(::Google::Cloud::Talent::V4beta1::GetTenantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_tenant_client_stub.call_count - end - end - end - - def test_update_tenant - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::Tenant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - tenant = {} - update_mask = {} - - update_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_update_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_tenant tenant: tenant, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_tenant({ tenant: tenant, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_tenant(::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_tenant_client_stub.call_count - end - end - end - - def test_delete_tenant - # 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_tenant_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_delete_tenant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_tenant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_tenant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_tenant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_tenant(::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tenant_client_stub.call_count - end - end - end - - def test_list_tenants - # Create test objects. - client_result = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_tenants_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Talent::V4beta1::TenantService::Rest::ServiceStub.stub :transcode_list_tenants_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tenants parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tenants ::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_tenants(::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_tenants_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::Talent::V4beta1::TenantService::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::Talent::V4beta1::TenantService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb deleted file mode 100644 index a90e6bf14b95..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/google/cloud/talent/v4beta1/tenant_service_test.rb +++ /dev/null @@ -1,407 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent/v4beta1/tenant_service_pb" -require "google/cloud/talent/v4beta1/tenant_service" - -class ::Google::Cloud::Talent::V4beta1::TenantService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::Tenant.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" - tenant = {} - - create_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::CreateTenantRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Tenant), request["tenant"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_tenant({ parent: parent, tenant: tenant }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_tenant parent: parent, tenant: tenant do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_tenant ::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_tenant({ parent: parent, tenant: tenant }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_tenant(::Google::Cloud::Talent::V4beta1::CreateTenantRequest.new(parent: parent, tenant: tenant), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_tenant_client_stub.call_rpc_count - end - end - - def test_get_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::Tenant.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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::GetTenantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_tenant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_tenant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_tenant ::Google::Cloud::Talent::V4beta1::GetTenantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_tenant({ 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_tenant(::Google::Cloud::Talent::V4beta1::GetTenantRequest.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_tenant_client_stub.call_rpc_count - end - end - - def test_update_tenant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::Tenant.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. - tenant = {} - update_mask = {} - - update_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Talent::V4beta1::Tenant), request["tenant"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_tenant({ tenant: tenant, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_tenant tenant: tenant, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_tenant ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, 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_tenant({ tenant: tenant, 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_tenant(::Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new(tenant: tenant, 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_tenant_client_stub.call_rpc_count - end - end - - def test_delete_tenant - # 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_tenant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tenant, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tenant_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_tenant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_tenant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_tenant ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_tenant({ 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_tenant(::Google::Cloud::Talent::V4beta1::DeleteTenantRequest.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_tenant_client_stub.call_rpc_count - end - end - - def test_list_tenants - # Create GRPC objects. - grpc_response = ::Google::Cloud::Talent::V4beta1::ListTenantsResponse.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_token = "hello world" - page_size = 42 - - list_tenants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tenants, name - assert_kind_of ::Google::Cloud::Talent::V4beta1::ListTenantsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tenants_client_stub do - # Create client - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tenants({ parent: parent, page_token: page_token, page_size: page_size }) 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_tenants parent: parent, page_token: page_token, page_size: page_size 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_tenants ::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_tenants({ parent: parent, page_token: page_token, page_size: page_size }, 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_tenants(::Google::Cloud::Talent::V4beta1::ListTenantsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_tenants_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::Talent::V4beta1::TenantService::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::Talent::V4beta1::TenantService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Talent::V4beta1::TenantService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb b/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-talent-v4beta1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-talent/.gitignore b/owl-bot-staging/google-cloud-talent/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-talent/.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-talent/.repo-metadata.json b/owl-bot-staging/google-cloud-talent/.repo-metadata.json deleted file mode 100644 index f0d7c473423f..000000000000 --- a/owl-bot-staging/google-cloud-talent/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "jobs.googleapis.com", - "api_shortname": "jobs", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-talent/latest", - "distribution_name": "google-cloud-talent", - "is_cloud": true, - "language": "ruby", - "name": "jobs", - "name_pretty": "Cloud Talent Solution API", - "product_documentation": "https://cloud.google.com/solutions/talent-solution", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience.", - "ruby-cloud-env-prefix": "TALENT", - "ruby-cloud-product-url": "https://cloud.google.com/solutions/talent-solution", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-talent/.rubocop.yml b/owl-bot-staging/google-cloud-talent/.rubocop.yml deleted file mode 100644 index 19fadb34d889..000000000000 --- a/owl-bot-staging/google-cloud-talent/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-talent.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-talent.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-talent/.toys.rb b/owl-bot-staging/google-cloud-talent/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-talent/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-talent/.yardopts b/owl-bot-staging/google-cloud-talent/.yardopts deleted file mode 100644 index 04a48da418a5..000000000000 --- a/owl-bot-staging/google-cloud-talent/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Cloud Talent Solution API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-talent/AUTHENTICATION.md b/owl-bot-staging/google-cloud-talent/AUTHENTICATION.md deleted file mode 100644 index 57210480794b..000000000000 --- a/owl-bot-staging/google-cloud-talent/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-talent 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-talent 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/talent" - -client = Google::Cloud::Talent.company_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/talent" - -Google::Cloud::Talent.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Talent.company_service -``` - -### 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-talent -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/talent" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Talent.company_service -``` - -### 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-talent/CHANGELOG.md b/owl-bot-staging/google-cloud-talent/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-talent/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-talent/Gemfile b/owl-bot-staging/google-cloud-talent/Gemfile deleted file mode 100644 index 1ace718df551..000000000000 --- a/owl-bot-staging/google-cloud-talent/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-talent-v4"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-talent.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.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-talent/LICENSE.md b/owl-bot-staging/google-cloud-talent/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-talent/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-talent/README.md b/owl-bot-staging/google-cloud-talent/README.md deleted file mode 100644 index 03dca74b6700..000000000000 --- a/owl-bot-staging/google-cloud-talent/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Cloud Talent Solution API - -API Client library for the Cloud Talent Solution API - -Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-talent-v*`. -The gem `google-cloud-talent` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-talent/latest) -for this library, google-cloud-talent, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-talent-v4](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest). - -See also the [Product Documentation](https://cloud.google.com/solutions/talent-solution) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-talent -``` - -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/jobs.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/talent" - -client = Google::Cloud::Talent.company_service -request = ::Google::Cloud::Talent::V4::CreateCompanyRequest.new # (request fields as keyword arguments...) -response = client.create_company request -``` - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-talent-v4](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -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-talent`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-talent-v4`. -_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-talent`. -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-talent-v4`. - -### 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-talent/Rakefile b/owl-bot-staging/google-cloud-talent/Rakefile deleted file mode 100644 index a13788c6a6d4..000000000000 --- a/owl-bot-staging/google-cloud-talent/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true -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-talent acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TALENT_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TALENT_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TALENT_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 TALENT_TEST_PROJECT=test123 TALENT_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/talent/v4/company_service/credentials" - ::Google::Cloud::Talent::V4::CompanyService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TALENT_PROJECT"] = project - ENV["TALENT_TEST_PROJECT"] = project - ENV["TALENT_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-talent 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-talent 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-talent 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-talent gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-talent" - header "google-cloud-talent rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-talent yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-talent 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-talent 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-talent 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-talent/google-cloud-talent.gemspec b/owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec deleted file mode 100644 index 8abc7cde86f8..000000000000 --- a/owl-bot-staging/google-cloud-talent/google-cloud-talent.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/talent/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-talent" - gem.version = Google::Cloud::Talent::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Transform your job search and candidate matching capabilities with Cloud Talent Solution, designed to support enterprise talent acquisition technology and evolve with your growing needs. This AI solution includes features such as Job Search and Profile Search (Beta) to provide candidates and employers with an enhanced talent acquisition experience." - gem.summary = "API Client library for the Cloud Talent Solution API" - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-talent-v4", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb b/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb deleted file mode 100644 index aad607d12a14..000000000000 --- a/owl-bot-staging/google-cloud-talent/lib/google-cloud-talent.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/talent" unless defined? Google::Cloud::Talent::VERSION diff --git a/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb deleted file mode 100644 index 939ff2472705..000000000000 --- a/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent.rb +++ /dev/null @@ -1,436 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/talent/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :talent do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Talent - ## - # Create a new client object for CompanyService. - # - # By default, this returns an instance of - # [Google::Cloud::Talent::V4::CompanyService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-CompanyService-Client) - # for a gRPC client for version V4 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CompanyService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the CompanyService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Talent.company_service_available?}. - # - # ## About CompanyService - # - # A service that handles company management, including CRUD and enumeration. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.company_service version: :v4, transport: :grpc, &block - require "google/cloud/talent/#{version.to_s.downcase}" - - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Talent.const_get(package_name).const_get(:CompanyService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CompanyService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Talent.company_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CompanyService service, - # or if the versioned client gem needs an update to support the CompanyService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.company_service_available? version: :v4, transport: :grpc - require "google/cloud/talent/#{version.to_s.downcase}" - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Talent.const_get package_name - return false unless service_module.const_defined? :CompanyService - service_module = service_module.const_get :CompanyService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for Completion. - # - # By default, this returns an instance of - # [Google::Cloud::Talent::V4::Completion::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-Completion-Client) - # for a gRPC client for version V4 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Completion service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the Completion service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Talent.completion_available?}. - # - # ## About Completion - # - # A service handles auto completion. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.completion version: :v4, transport: :grpc, &block - require "google/cloud/talent/#{version.to_s.downcase}" - - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Talent.const_get(package_name).const_get(:Completion) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Completion service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Talent.completion}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Completion service, - # or if the versioned client gem needs an update to support the Completion service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.completion_available? version: :v4, transport: :grpc - require "google/cloud/talent/#{version.to_s.downcase}" - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Talent.const_get package_name - return false unless service_module.const_defined? :Completion - service_module = service_module.const_get :Completion - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for EventService. - # - # By default, this returns an instance of - # [Google::Cloud::Talent::V4::EventService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-EventService-Client) - # for a gRPC client for version V4 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the EventService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the EventService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Talent.event_service_available?}. - # - # ## About EventService - # - # A service handles client event report. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.event_service version: :v4, transport: :grpc, &block - require "google/cloud/talent/#{version.to_s.downcase}" - - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Talent.const_get(package_name).const_get(:EventService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the EventService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Talent.event_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the EventService service, - # or if the versioned client gem needs an update to support the EventService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.event_service_available? version: :v4, transport: :grpc - require "google/cloud/talent/#{version.to_s.downcase}" - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Talent.const_get package_name - return false unless service_module.const_defined? :EventService - service_module = service_module.const_get :EventService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for JobService. - # - # By default, this returns an instance of - # [Google::Cloud::Talent::V4::JobService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-JobService-Client) - # for a gRPC client for version V4 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the JobService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the JobService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Talent.job_service_available?}. - # - # ## About JobService - # - # A service handles job management, including job CRUD, enumeration and search. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.job_service version: :v4, transport: :grpc, &block - require "google/cloud/talent/#{version.to_s.downcase}" - - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Talent.const_get(package_name).const_get(:JobService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the JobService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Talent.job_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the JobService service, - # or if the versioned client gem needs an update to support the JobService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.job_service_available? version: :v4, transport: :grpc - require "google/cloud/talent/#{version.to_s.downcase}" - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Talent.const_get package_name - return false unless service_module.const_defined? :JobService - service_module = service_module.const_get :JobService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TenantService. - # - # By default, this returns an instance of - # [Google::Cloud::Talent::V4::TenantService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-talent-v4/latest/Google-Cloud-Talent-V4-TenantService-Client) - # for a gRPC client for version V4 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TenantService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TenantService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Talent.tenant_service_available?}. - # - # ## About TenantService - # - # A service that handles tenant management, including CRUD and enumeration. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.tenant_service version: :v4, transport: :grpc, &block - require "google/cloud/talent/#{version.to_s.downcase}" - - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Talent.const_get(package_name).const_get(:TenantService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TenantService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Talent.tenant_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TenantService service, - # or if the versioned client gem needs an update to support the TenantService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v4`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.tenant_service_available? version: :v4, transport: :grpc - require "google/cloud/talent/#{version.to_s.downcase}" - package_name = Google::Cloud::Talent - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Talent.const_get package_name - return false unless service_module.const_defined? :TenantService - service_module = service_module.const_get :TenantService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-talent library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.talent if block_given? - - ::Google::Cloud.configure.talent - end - end - end -end - -helper_path = ::File.join __dir__, "talent", "helpers.rb" -require "google/cloud/talent/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb b/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb deleted file mode 100644 index a30eaea332ba..000000000000 --- a/owl-bot-staging/google-cloud-talent/lib/google/cloud/talent/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Talent - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb b/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb deleted file mode 100644 index fb322e55d9ba..000000000000 --- a/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/client_test.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/talent" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Talent::ClientConstructionMinitest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_company_service_grpc - skip unless Google::Cloud::Talent.company_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Talent.company_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Talent::V4::CompanyService::Client, client - end - end - - def test_company_service_rest - skip unless Google::Cloud::Talent.company_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Talent.company_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Talent::V4::CompanyService::Rest::Client, client - end - end - - def test_completion_grpc - skip unless Google::Cloud::Talent.completion_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Talent.completion transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Talent::V4::Completion::Client, client - end - end - - def test_completion_rest - skip unless Google::Cloud::Talent.completion_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Talent.completion transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Talent::V4::Completion::Rest::Client, client - end - end - - def test_event_service_grpc - skip unless Google::Cloud::Talent.event_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Talent.event_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Talent::V4::EventService::Client, client - end - end - - def test_event_service_rest - skip unless Google::Cloud::Talent.event_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Talent.event_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Talent::V4::EventService::Rest::Client, client - end - end - - def test_job_service_grpc - skip unless Google::Cloud::Talent.job_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Talent.job_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Talent::V4::JobService::Client, client - end - end - - def test_job_service_rest - skip unless Google::Cloud::Talent.job_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Talent.job_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Talent::V4::JobService::Rest::Client, client - end - end - - def test_tenant_service_grpc - skip unless Google::Cloud::Talent.tenant_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Talent.tenant_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Talent::V4::TenantService::Client, client - end - end - - def test_tenant_service_rest - skip unless Google::Cloud::Talent.tenant_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Talent.tenant_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Talent::V4::TenantService::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb b/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb deleted file mode 100644 index 98c5a92372fb..000000000000 --- a/owl-bot-staging/google-cloud-talent/test/google/cloud/talent/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/talent/version" - -class Google::Cloud::Talent::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Talent::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-talent/test/helper.rb b/owl-bot-staging/google-cloud-talent/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-talent/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks-v2/.gitignore b/owl-bot-staging/google-cloud-tasks-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/.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-tasks-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks-v2/.repo-metadata.json deleted file mode 100644 index 9f20ac72dea4..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudtasks.googleapis.com", - "api_shortname": "cloudtasks", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest", - "distribution_name": "google-cloud-tasks-v2", - "is_cloud": true, - "language": "ruby", - "name": "cloudtasks", - "name_pretty": "Cloud Tasks V2 API", - "product_documentation": "https://cloud.google.com/tasks", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TASKS", - "ruby-cloud-product-url": "https://cloud.google.com/tasks", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml b/owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml deleted file mode 100644 index c73aa9c3a62f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-tasks-v2.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-tasks-v2.rb" diff --git a/owl-bot-staging/google-cloud-tasks-v2/.toys.rb b/owl-bot-staging/google-cloud-tasks-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/.yardopts b/owl-bot-staging/google-cloud-tasks-v2/.yardopts deleted file mode 100644 index 61acd5d300ad..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Tasks V2 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-tasks-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks-v2/AUTHENTICATION.md deleted file mode 100644 index 17282377935b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-tasks-v2 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-tasks-v2 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/tasks/v2" - -client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/tasks/v2" - -::Google::Cloud::Tasks::V2::CloudTasks::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Tasks::V2::CloudTasks::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-tasks-v2 -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/tasks/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Tasks::V2::CloudTasks::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-tasks-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-tasks-v2/Gemfile b/owl-bot-staging/google-cloud-tasks-v2/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-tasks-v2/LICENSE.md b/owl-bot-staging/google-cloud-tasks-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/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-tasks-v2/README.md b/owl-bot-staging/google-cloud-tasks-v2/README.md deleted file mode 100644 index 3acb58b85bcb..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Tasks V2 API - -Manages the execution of large numbers of distributed requests. - -Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. - -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 Tasks V2 API. Most users should consider using -the main client gem, -[google-cloud-tasks](https://rubygems.org/gems/google-cloud-tasks). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-tasks-v2 -``` - -## 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/cloudtasks.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/tasks/v2" - -client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new -request = ::Google::Cloud::Tasks::V2::ListQueuesRequest.new # (request fields as keyword arguments...) -response = client.list_queues request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/tasks) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/tasks/v2" -require "logger" - -client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-tasks`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-tasks-v2`. -_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-tasks`. -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-tasks-v2`. - -### 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-tasks-v2/Rakefile b/owl-bot-staging/google-cloud-tasks-v2/Rakefile deleted file mode 100644 index 2339c75f47d5..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TASKS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TASKS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/tasks/v2/cloud_tasks/credentials" - ::Google::Cloud::Tasks::V2::CloudTasks::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TASKS_PROJECT"] = project - ENV["TASKS_TEST_PROJECT"] = project - ENV["TASKS_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-tasks-v2 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-tasks-v2 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-tasks-v2 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-tasks-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-tasks-v2" - header "google-cloud-tasks-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-tasks-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-tasks-v2 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-tasks-v2 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-tasks-v2 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-tasks-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-tasks-v2/gapic_metadata.json deleted file mode 100644 index 2f95f7bab9cd..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/gapic_metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.tasks.v2", - "libraryPackage": "::Google::Cloud::Tasks::V2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Tasks::V2::CloudTasks::Client", - "rpcs": { - "ListQueues": { - "methods": [ - "list_queues" - ] - }, - "GetQueue": { - "methods": [ - "get_queue" - ] - }, - "CreateQueue": { - "methods": [ - "create_queue" - ] - }, - "UpdateQueue": { - "methods": [ - "update_queue" - ] - }, - "DeleteQueue": { - "methods": [ - "delete_queue" - ] - }, - "PurgeQueue": { - "methods": [ - "purge_queue" - ] - }, - "PauseQueue": { - "methods": [ - "pause_queue" - ] - }, - "ResumeQueue": { - "methods": [ - "resume_queue" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "ListTasks": { - "methods": [ - "list_tasks" - ] - }, - "GetTask": { - "methods": [ - "get_task" - ] - }, - "CreateTask": { - "methods": [ - "create_task" - ] - }, - "DeleteTask": { - "methods": [ - "delete_task" - ] - }, - "RunTask": { - "methods": [ - "run_task" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec b/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec deleted file mode 100644 index 63333163fa53..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/google-cloud-tasks-v2.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/tasks/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-tasks-v2" - gem.version = Google::Cloud::Tasks::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details." - gem.summary = "Manages the execution of large numbers of distributed requests." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb deleted file mode 100644 index c0bfa1f74ccc..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google-cloud-tasks-v2.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2" diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb deleted file mode 100644 index 28eb8e8f1dd1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloud_tasks" -require "google/cloud/tasks/v2/version" - -module Google - module Cloud - module Tasks - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/tasks/v2" - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/tasks/v2" - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/tasks/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb deleted file mode 100644 index 0d1044729505..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" - -module Google - module Cloud - module Tasks - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/tasks/v2/rest" - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - module V2 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Tasks"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb deleted file mode 100644 index 8cec3f1cb14f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/version" - -require "google/cloud/tasks/v2/cloud_tasks/credentials" -require "google/cloud/tasks/v2/cloud_tasks/paths" -require "google/cloud/tasks/v2/cloud_tasks/client" -require "google/cloud/tasks/v2/cloud_tasks/rest" - -module Google - module Cloud - module Tasks - module V2 - ## - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/tasks/v2/cloud_tasks" - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/tasks/v2/cloud_tasks/rest" - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - module CloudTasks - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_tasks", "helpers.rb" -require "google/cloud/tasks/v2/cloud_tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb deleted file mode 100644 index ec1c5ab6a70a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/client.rb +++ /dev/null @@ -1,2259 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" -require "google/cloud/location" - -module Google - module Cloud - module Tasks - module V2 - module CloudTasks - ## - # Client for the CloudTasks service. - # - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_tasks_stub - - ## - # Configure the CloudTasks Client class. - # - # See {::Google::Cloud::Tasks::V2::CloudTasks::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudTasks clients - # ::Google::Cloud::Tasks::V2::CloudTasks::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", "Tasks", "V2"] - 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.list_queues.timeout = 20.0 - default_config.rpcs.list_queues.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_queue.timeout = 20.0 - default_config.rpcs.get_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_queue.timeout = 20.0 - - default_config.rpcs.update_queue.timeout = 20.0 - - default_config.rpcs.delete_queue.timeout = 20.0 - default_config.rpcs.delete_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.purge_queue.timeout = 20.0 - - default_config.rpcs.pause_queue.timeout = 20.0 - - default_config.rpcs.resume_queue.timeout = 20.0 - - default_config.rpcs.get_iam_policy.timeout = 20.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.set_iam_policy.timeout = 20.0 - - default_config.rpcs.test_iam_permissions.timeout = 20.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tasks.timeout = 20.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_task.timeout = 20.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_task.timeout = 20.0 - - default_config.rpcs.delete_task.timeout = 20.0 - default_config.rpcs.delete_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_task.timeout = 20.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudTasks 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::Tasks::V2::CloudTasks::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 - @cloud_tasks_stub.universe_domain - end - - ## - # Create a new CloudTasks client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudTasks 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/tasks/v2/cloudtasks_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 - - @cloud_tasks_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Tasks::V2::CloudTasks::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, - logger: @config.logger - ) - - @cloud_tasks_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_tasks_stub.endpoint - config.universe_domain = @cloud_tasks_stub.universe_domain - config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_tasks_stub.logger - end - - # Service calls - - ## - # Lists queues. - # - # Queues are returned in lexicographical order. - # - # @overload list_queues(request, options = nil) - # Pass arguments to `list_queues` via a request object, either of type - # {::Google::Cloud::Tasks::V2::ListQueuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::ListQueuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_queues` via keyword arguments. Note that at - # least one keyword argument is 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 location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @param filter [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "state: PAUSED". - # - # Note that using filters might cause fewer queues than the - # requested page_size to be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues} method. It is an - # error to switch the value of the - # {::Google::Cloud::Tasks::V2::ListQueuesRequest#filter filter} while iterating - # through pages. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::ListQueuesRequest.new - # - # # Call the list_queues method. - # result = client.list_queues 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::Tasks::V2::Queue. - # p item - # end - # - def list_queues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListQueuesRequest - - # Converts hash 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_queues.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::Tasks::V2::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_queues.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_queues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a queue. - # - # @overload get_queue(request, options = nil) - # Pass arguments to `get_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::GetQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::GetQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `get_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::GetQueueRequest.new - # - # # Call the get_queue method. - # result = client.get_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def get_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload create_queue(request, options = nil) - # Pass arguments to `create_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::CreateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::CreateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) - # Pass arguments to `create_queue` via keyword arguments. Note that at - # least one keyword argument is 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 location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - # existing queue. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::CreateQueueRequest.new - # - # # Call the create_queue method. - # result = client.create_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def create_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload update_queue(request, options = nil) - # Pass arguments to `update_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::UpdateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::UpdateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) - # Pass arguments to `update_queue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} must be specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} cannot be changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new - # - # # Call the update_queue method. - # result = client.update_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def update_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::UpdateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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.queue&.name - header_params["queue.name"] = request.queue.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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload delete_queue(request, options = nil) - # Pass arguments to `delete_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::DeleteQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::DeleteQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `delete_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new - # - # # Call the delete_queue method. - # result = client.delete_queue request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - # - # @overload purge_queue(request, options = nil) - # Pass arguments to `purge_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::PurgeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::PurgeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_queue(name: nil) - # Pass arguments to `purge_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new - # - # # Call the purge_queue method. - # result = client.purge_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def purge_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PurgeQueueRequest - - # Converts hash 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.purge_queue.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::Tasks::V2::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.purge_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can - # still be added when the queue is paused. A queue is paused if its - # {::Google::Cloud::Tasks::V2::Queue#state state} is - # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. - # - # @overload pause_queue(request, options = nil) - # Pass arguments to `pause_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::PauseQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::PauseQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_queue(name: nil) - # Pass arguments to `pause_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::PauseQueueRequest.new - # - # # Call the pause_queue method. - # result = client.pause_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def pause_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PauseQueueRequest - - # Converts hash 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.pause_queue.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::Tasks::V2::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.pause_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a queue. - # - # This method resumes a queue after it has been - # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED} or - # {::Google::Cloud::Tasks::V2::Queue::State::DISABLED DISABLED}. The state of a - # queue is stored in the queue's {::Google::Cloud::Tasks::V2::Queue#state state}; - # after calling this method it will be set to - # {::Google::Cloud::Tasks::V2::Queue::State::RUNNING RUNNING}. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - # - # @overload resume_queue(request, options = nil) - # Pass arguments to `resume_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::ResumeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::ResumeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_queue(name: nil) - # Pass arguments to `resume_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new - # - # # Call the resume_queue method. - # result = client.resume_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def resume_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ResumeQueueRequest - - # Converts hash 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.resume_queue.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::Tasks::V2::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.resume_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_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::Tasks::V2::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.resource - header_params["resource"] = request.resource - 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_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. - # Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_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::Tasks::V2::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.resource - header_params["resource"] = request.resource - 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.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on a - # {::Google::Cloud::Tasks::V2::Queue Queue}. If the resource does not exist, this - # will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Tasks::V2::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.resource - header_params["resource"] = request.resource - 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.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the tasks in a queue. - # - # By default, only the {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC} view is - # retrieved due to performance considerations; - # {::Google::Cloud::Tasks::V2::ListTasksRequest#response_view response_view} - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # @param page_size [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks 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::Tasks::V2::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListTasksRequest - - # Converts hash 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_tasks.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::Tasks::V2::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_tasks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetTaskRequest - - # Converts hash 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_task.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::Tasks::V2::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * The maximum task size is 100KB. - # - # @overload create_task(request, options = nil) - # Pass arguments to `create_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::CreateTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::CreateTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) - # Pass arguments to `create_task` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task [::Google::Cloud::Tasks::V2::Task, ::Hash] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2::Task#name name}. If a name is not specified then - # the system will generate a random unique task id, which will be set in the - # task returned in the {::Google::Cloud::Tasks::V2::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} is not set or - # is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or executed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1hour after the original task was - # deleted or executed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9days after the original task was deleted or executed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::CreateTaskRequest.new - # - # # Call the create_task method. - # result = client.create_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Task. - # p result - # - def create_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateTaskRequest - - # Converts hash 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_task.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::Tasks::V2::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has executed successfully or permanently - # failed. - # - # @overload delete_task(request, options = nil) - # Pass arguments to `delete_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::DeleteTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::DeleteTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil) - # Pass arguments to `delete_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new - # - # # Call the delete_task method. - # result = client.delete_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteTaskRequest - - # Converts hash 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_task.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::Tasks::V2::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # {::Google::Cloud::Tasks::V2::RateLimits RateLimits} or is - # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. - # - # This command is meant to be used for manual debugging. For - # example, {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask} can be used to - # retry a failed task after a fix has been made or to manually force a task - # to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the [status][Task.status] after the task is dispatched but - # before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} will be reset to - # the time that {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask} was - # called plus the retry delay specified in the queue's - # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig}. - # - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask} returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - # - # @overload run_task(request, options = nil) - # Pass arguments to `run_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::RunTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::RunTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_task(name: nil, response_view: nil) - # Pass arguments to `run_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::RunTaskRequest.new - # - # # Call the run_task method. - # result = client.run_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Task. - # p result - # - def run_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::RunTaskRequest - - # Converts hash 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.run_task.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::Tasks::V2::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.run_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudTasks API. - # - # This class represents the configuration for CloudTasks, - # 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::Tasks::V2::CloudTasks::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_queues to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Tasks::V2::CloudTasks::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CloudTasks 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_queues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_queues - ## - # RPC-specific configuration for `get_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_queue - ## - # RPC-specific configuration for `create_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_queue - ## - # RPC-specific configuration for `update_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_queue - ## - # RPC-specific configuration for `delete_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_queue - ## - # RPC-specific configuration for `purge_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_queue - ## - # RPC-specific configuration for `pause_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_queue - ## - # RPC-specific configuration for `resume_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_queue - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `create_task` - # @return [::Gapic::Config::Method] - # - attr_reader :create_task - ## - # RPC-specific configuration for `delete_task` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_task - ## - # RPC-specific configuration for `run_task` - # @return [::Gapic::Config::Method] - # - attr_reader :run_task - - # @private - def initialize parent_rpcs = nil - list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues - @list_queues = ::Gapic::Config::Method.new list_queues_config - get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue - @get_queue = ::Gapic::Config::Method.new get_queue_config - create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue - @create_queue = ::Gapic::Config::Method.new create_queue_config - update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue - @update_queue = ::Gapic::Config::Method.new update_queue_config - delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue - @delete_queue = ::Gapic::Config::Method.new delete_queue_config - purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue - @purge_queue = ::Gapic::Config::Method.new purge_queue_config - pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue - @pause_queue = ::Gapic::Config::Method.new pause_queue_config - resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue - @resume_queue = ::Gapic::Config::Method.new resume_queue_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task - @create_task = ::Gapic::Config::Method.new create_task_config - delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task - @delete_task = ::Gapic::Config::Method.new delete_task_config - run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task - @run_task = ::Gapic::Config::Method.new run_task_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb deleted file mode 100644 index f34da6642695..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2 - module CloudTasks - # Credentials for the CloudTasks API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "TASKS_CREDENTIALS", - "TASKS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TASKS_CREDENTIALS_JSON", - "TASKS_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-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb deleted file mode 100644 index 06a5c7d8a9b3..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/paths.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2 - module CloudTasks - # Path helper methods for the CloudTasks 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 Queue resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/queues/{queue}` - # - # @param project [String] - # @param location [String] - # @param queue [String] - # - # @return [::String] - def queue_path project:, location:, queue: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/queues/#{queue}" - end - - ## - # Create a fully-qualified Task resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/queues/{queue}/tasks/{task}` - # - # @param project [String] - # @param location [String] - # @param queue [String] - # @param task [String] - # - # @return [::String] - def task_path project:, location:, queue:, task: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "queue cannot contain /" if queue.to_s.include? "/" - - "projects/#{project}/locations/#{location}/queues/#{queue}/tasks/#{task}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb deleted file mode 100644 index a78a827e9ee6..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/version" -require "google/cloud/tasks/v2/bindings_override" - -require "google/cloud/tasks/v2/cloud_tasks/credentials" -require "google/cloud/tasks/v2/cloud_tasks/paths" -require "google/cloud/tasks/v2/cloud_tasks/rest/client" - -module Google - module Cloud - module Tasks - module V2 - ## - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/tasks/v2/cloud_tasks/rest" - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - module CloudTasks - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/tasks/v2/cloud_tasks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb deleted file mode 100644 index 3075391070f5..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/client.rb +++ /dev/null @@ -1,2112 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" -require "google/cloud/tasks/v2/cloud_tasks/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Tasks - module V2 - module CloudTasks - module Rest - ## - # REST client for the CloudTasks service. - # - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_tasks_stub - - ## - # Configure the CloudTasks Client class. - # - # See {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudTasks clients - # ::Google::Cloud::Tasks::V2::CloudTasks::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", "Tasks", "V2"] - 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.list_queues.timeout = 20.0 - default_config.rpcs.list_queues.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_queue.timeout = 20.0 - default_config.rpcs.get_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_queue.timeout = 20.0 - - default_config.rpcs.update_queue.timeout = 20.0 - - default_config.rpcs.delete_queue.timeout = 20.0 - default_config.rpcs.delete_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.purge_queue.timeout = 20.0 - - default_config.rpcs.pause_queue.timeout = 20.0 - - default_config.rpcs.resume_queue.timeout = 20.0 - - default_config.rpcs.get_iam_policy.timeout = 20.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.set_iam_policy.timeout = 20.0 - - default_config.rpcs.test_iam_permissions.timeout = 20.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tasks.timeout = 20.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_task.timeout = 20.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_task.timeout = 20.0 - - default_config.rpcs.delete_task.timeout = 20.0 - default_config.rpcs.delete_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_task.timeout = 20.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudTasks 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::Tasks::V2::CloudTasks::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 - @cloud_tasks_stub.universe_domain - end - - ## - # Create a new CloudTasks REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudTasks 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 - - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_tasks_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_tasks_stub.endpoint - config.universe_domain = @cloud_tasks_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_tasks_stub.logger - end - - # Service calls - - ## - # Lists queues. - # - # Queues are returned in lexicographical order. - # - # @overload list_queues(request, options = nil) - # Pass arguments to `list_queues` via a request object, either of type - # {::Google::Cloud::Tasks::V2::ListQueuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::ListQueuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_queues` via keyword arguments. Note that at - # least one keyword argument is 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 location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @param filter [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "state: PAUSED". - # - # Note that using filters might cause fewer queues than the - # requested page_size to be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#list_queues ListQueues} method. It is an - # error to switch the value of the - # {::Google::Cloud::Tasks::V2::ListQueuesRequest#filter filter} while iterating - # through pages. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Queue>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::ListQueuesRequest.new - # - # # Call the list_queues method. - # result = client.list_queues 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::Tasks::V2::Queue. - # p item - # end - # - def list_queues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListQueuesRequest - - # Converts hash 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_queues.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::Tasks::V2::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_queues.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_queues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.list_queues request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a queue. - # - # @overload get_queue(request, options = nil) - # Pass arguments to `get_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::GetQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::GetQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `get_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::GetQueueRequest.new - # - # # Call the get_queue method. - # result = client.get_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def get_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload create_queue(request, options = nil) - # Pass arguments to `create_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::CreateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::CreateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) - # Pass arguments to `create_queue` via keyword arguments. Note that at - # least one keyword argument is 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 location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - # existing queue. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::CreateQueueRequest.new - # - # # Call the create_queue method. - # result = client.create_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def create_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.create_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload update_queue(request, options = nil) - # Pass arguments to `update_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::UpdateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::UpdateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) - # Pass arguments to `update_queue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param queue [::Google::Cloud::Tasks::V2::Queue, ::Hash] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} must be specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} cannot be changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new - # - # # Call the update_queue method. - # result = client.update_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def update_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::UpdateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.update_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload delete_queue(request, options = nil) - # Pass arguments to `delete_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::DeleteQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::DeleteQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `delete_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new - # - # # Call the delete_queue method. - # result = client.delete_queue request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteQueueRequest - - # Converts hash 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_queue.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::Tasks::V2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.delete_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - # - # @overload purge_queue(request, options = nil) - # Pass arguments to `purge_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::PurgeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::PurgeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_queue(name: nil) - # Pass arguments to `purge_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new - # - # # Call the purge_queue method. - # result = client.purge_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def purge_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PurgeQueueRequest - - # Converts hash 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.purge_queue.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::Tasks::V2::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.purge_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.purge_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can - # still be added when the queue is paused. A queue is paused if its - # {::Google::Cloud::Tasks::V2::Queue#state state} is - # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. - # - # @overload pause_queue(request, options = nil) - # Pass arguments to `pause_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::PauseQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::PauseQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_queue(name: nil) - # Pass arguments to `pause_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::PauseQueueRequest.new - # - # # Call the pause_queue method. - # result = client.pause_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def pause_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::PauseQueueRequest - - # Converts hash 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.pause_queue.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::Tasks::V2::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.pause_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.pause_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a queue. - # - # This method resumes a queue after it has been - # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED} or - # {::Google::Cloud::Tasks::V2::Queue::State::DISABLED DISABLED}. The state of a - # queue is stored in the queue's {::Google::Cloud::Tasks::V2::Queue#state state}; - # after calling this method it will be set to - # {::Google::Cloud::Tasks::V2::Queue::State::RUNNING RUNNING}. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - # - # @overload resume_queue(request, options = nil) - # Pass arguments to `resume_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2::ResumeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::ResumeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_queue(name: nil) - # Pass arguments to `resume_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new - # - # # Call the resume_queue method. - # result = client.resume_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Queue. - # p result - # - def resume_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ResumeQueueRequest - - # Converts hash 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.resume_queue.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::Tasks::V2::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.resume_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.resume_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_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::Tasks::V2::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_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy for a {::Google::Cloud::Tasks::V2::Queue Queue}. - # Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_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::Tasks::V2::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.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on a - # {::Google::Cloud::Tasks::V2::Queue Queue}. If the resource does not exist, this - # will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Tasks::V2::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.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the tasks in a queue. - # - # By default, only the {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC} view is - # retrieved due to performance considerations; - # {::Google::Cloud::Tasks::V2::ListTasksRequest#response_view response_view} - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # @param page_size [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2::Task>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks 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::Tasks::V2::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::ListTasksRequest - - # Converts hash 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_tasks.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::Tasks::V2::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_tasks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.list_tasks request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::GetTaskRequest - - # Converts hash 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_task.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::Tasks::V2::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * The maximum task size is 100KB. - # - # @overload create_task(request, options = nil) - # Pass arguments to `create_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::CreateTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::CreateTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) - # Pass arguments to `create_task` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task [::Google::Cloud::Tasks::V2::Task, ::Hash] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2::Task#name name}. If a name is not specified then - # the system will generate a random unique task id, which will be set in the - # task returned in the {::Google::Cloud::Tasks::V2::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} is not set or - # is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or executed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1hour after the original task was - # deleted or executed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9days after the original task was deleted or executed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::CreateTaskRequest.new - # - # # Call the create_task method. - # result = client.create_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Task. - # p result - # - def create_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::CreateTaskRequest - - # Converts hash 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_task.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::Tasks::V2::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.create_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has executed successfully or permanently - # failed. - # - # @overload delete_task(request, options = nil) - # Pass arguments to `delete_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::DeleteTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::DeleteTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil) - # Pass arguments to `delete_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new - # - # # Call the delete_task method. - # result = client.delete_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::DeleteTaskRequest - - # Converts hash 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_task.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::Tasks::V2::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.delete_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # {::Google::Cloud::Tasks::V2::RateLimits RateLimits} or is - # {::Google::Cloud::Tasks::V2::Queue::State::PAUSED PAUSED}. - # - # This command is meant to be used for manual debugging. For - # example, {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#run_task RunTask} can be used to - # retry a failed task after a fix has been made or to manually force a task - # to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the [status][Task.status] after the task is dispatched but - # before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} will be reset to - # the time that {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#run_task RunTask} was - # called plus the retry delay specified in the queue's - # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig}. - # - # {::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client#run_task RunTask} returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - # - # @overload run_task(request, options = nil) - # Pass arguments to `run_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2::RunTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2::RunTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_task(name: nil, response_view: nil) - # Pass arguments to `run_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2::RunTaskRequest.new - # - # # Call the run_task method. - # result = client.run_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2::Task. - # p result - # - def run_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2::RunTaskRequest - - # Converts hash 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.run_task.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::Tasks::V2::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.run_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.run_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudTasks REST API. - # - # This class represents the configuration for CloudTasks 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::Tasks::V2::CloudTasks::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_queues to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CloudTasks 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_queues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_queues - ## - # RPC-specific configuration for `get_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_queue - ## - # RPC-specific configuration for `create_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_queue - ## - # RPC-specific configuration for `update_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_queue - ## - # RPC-specific configuration for `delete_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_queue - ## - # RPC-specific configuration for `purge_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_queue - ## - # RPC-specific configuration for `pause_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_queue - ## - # RPC-specific configuration for `resume_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_queue - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `create_task` - # @return [::Gapic::Config::Method] - # - attr_reader :create_task - ## - # RPC-specific configuration for `delete_task` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_task - ## - # RPC-specific configuration for `run_task` - # @return [::Gapic::Config::Method] - # - attr_reader :run_task - - # @private - def initialize parent_rpcs = nil - list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues - @list_queues = ::Gapic::Config::Method.new list_queues_config - get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue - @get_queue = ::Gapic::Config::Method.new get_queue_config - create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue - @create_queue = ::Gapic::Config::Method.new create_queue_config - update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue - @update_queue = ::Gapic::Config::Method.new update_queue_config - delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue - @delete_queue = ::Gapic::Config::Method.new delete_queue_config - purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue - @purge_queue = ::Gapic::Config::Method.new purge_queue_config - pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue - @pause_queue = ::Gapic::Config::Method.new pause_queue_config - resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue - @resume_queue = ::Gapic::Config::Method.new resume_queue_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task - @create_task = ::Gapic::Config::Method.new create_task_config - delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task - @delete_task = ::Gapic::Config::Method.new delete_task_config - run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task - @run_task = ::Gapic::Config::Method.new run_task_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb deleted file mode 100644 index 1ca3b143b8ed..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloud_tasks/rest/service_stub.rb +++ /dev/null @@ -1,1067 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" - -module Google - module Cloud - module Tasks - module V2 - module CloudTasks - module Rest - ## - # REST service stub for the CloudTasks service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_queues REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::ListQueuesRequest] - # 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::Tasks::V2::ListQueuesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::ListQueuesResponse] - # A result object deserialized from the server's reply - def list_queues request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_queues_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, - method_name: "list_queues", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::GetQueueRequest] - # 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::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # A result object deserialized from the server's reply - def get_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_queue_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, - method_name: "get_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::CreateQueueRequest] - # 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::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # A result object deserialized from the server's reply - def create_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_queue_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, - method_name: "create_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::UpdateQueueRequest] - # 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::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # A result object deserialized from the server's reply - def update_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_queue_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, - method_name: "update_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::DeleteQueueRequest] - # 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_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_queue_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, - method_name: "delete_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::PurgeQueueRequest] - # 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::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # A result object deserialized from the server's reply - def purge_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_queue_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, - method_name: "purge_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the pause_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::PauseQueueRequest] - # 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::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # A result object deserialized from the server's reply - def pause_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_queue_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, - method_name: "pause_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the resume_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::ResumeQueueRequest] - # 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::Tasks::V2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Queue] - # A result object deserialized from the server's reply - def resume_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_queue_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, - method_name: "resume_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_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, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_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, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # 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::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::ListTasksRequest] - # 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::Tasks::V2::ListTasksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::ListTasksResponse] - # A result object deserialized from the server's reply - def list_tasks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_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, - method_name: "list_tasks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::GetTaskRequest] - # 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::Tasks::V2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # A result object deserialized from the server's reply - def get_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_task_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, - method_name: "get_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::CreateTaskRequest] - # 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::Tasks::V2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # A result object deserialized from the server's reply - def create_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_task_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, - method_name: "create_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::DeleteTaskRequest] - # 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_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_task_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, - method_name: "delete_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::RunTaskRequest] - # 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::Tasks::V2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2::Task] - # A result object deserialized from the server's reply - def run_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_task_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, - method_name: "run_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_queues REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::ListQueuesRequest] - # 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_queues_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/queues", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::GetQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::CreateQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/queues", - body: "queue", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::UpdateQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{queue.name}", - body: "queue", - matches: [ - ["queue.name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::DeleteQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::PurgeQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:purge", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::PauseQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::ResumeQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::ListTasksRequest] - # 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_tasks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/tasks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::GetTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::CreateTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/tasks", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::DeleteTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2::RunTaskRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb deleted file mode 100644 index 61dbbe06528e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_pb.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2/cloudtasks.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/tasks/v2/queue_pb' -require 'google/cloud/tasks/v2/task_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n&google/cloud/tasks/v2/cloudtasks.proto\x12\x15google.cloud.tasks.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a!google/cloud/tasks/v2/queue.proto\x1a google/cloud/tasks/v2/task.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x83\x01\n\x11ListQueuesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"[\n\x12ListQueuesResponse\x12,\n\x06queues\x18\x01 \x03(\x0b\x32\x1c.google.cloud.tasks.v2.Queue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0fGetQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"\x7f\n\x12\x43reateQueueRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x30\n\x05queue\x18\x02 \x01(\x0b\x32\x1c.google.cloud.tasks.v2.QueueB\x03\xe0\x41\x02\"w\n\x12UpdateQueueRequest\x12\x30\n\x05queue\x18\x01 \x01(\x0b\x32\x1c.google.cloud.tasks.v2.QueueB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PurgeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PauseQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"K\n\x12ResumeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"\xaa\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x37\n\rresponse_view\x18\x02 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"X\n\x11ListTasksResponse\x12*\n\x05tasks\x18\x01 \x03(\x0b\x32\x1b.google.cloud.tasks.v2.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x7f\n\x0eGetTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x37\n\rresponse_view\x18\x02 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\"\xb4\x01\n\x11\x43reateTaskRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12.\n\x04task\x18\x02 \x01(\x0b\x32\x1b.google.cloud.tasks.v2.TaskB\x03\xe0\x41\x02\x12\x37\n\rresponse_view\x18\x03 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\"I\n\x11\x44\x65leteTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\"\x7f\n\x0eRunTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x37\n\rresponse_view\x18\x02 \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View2\xdd\x14\n\nCloudTasks\x12\x9e\x01\n\nListQueues\x12(.google.cloud.tasks.v2.ListQueuesRequest\x1a).google.cloud.tasks.v2.ListQueuesResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v2/{parent=projects/*/locations/*}/queues\x12\x8b\x01\n\x08GetQueue\x12&.google.cloud.tasks.v2.GetQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v2/{name=projects/*/locations/*/queues/*}\x12\xa0\x01\n\x0b\x43reateQueue\x12).google.cloud.tasks.v2.CreateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"H\xda\x41\x0cparent,queue\x82\xd3\xe4\x93\x02\x33\"*/v2/{parent=projects/*/locations/*}/queues:\x05queue\x12\xab\x01\n\x0bUpdateQueue\x12).google.cloud.tasks.v2.UpdateQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"S\xda\x41\x11queue,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\x12\x8b\x01\n\x0b\x44\x65leteQueue\x12).google.cloud.tasks.v2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v2/{name=projects/*/locations/*/queues/*}\x12\x98\x01\n\nPurgeQueue\x12(.google.cloud.tasks.v2.PurgeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:purge:\x01*\x12\x98\x01\n\nPauseQueue\x12(.google.cloud.tasks.v2.PauseQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\"0/v2/{name=projects/*/locations/*/queues/*}:pause:\x01*\x12\x9b\x01\n\x0bResumeQueue\x12).google.cloud.tasks.v2.ResumeQueueRequest\x1a\x1c.google.cloud.tasks.v2.Queue\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v2/{name=projects/*/locations/*/queues/*}:resume:\x01*\x12\x9c\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"Q\xda\x41\x08resource\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\x12\xa3\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02@\";/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\x12\xce\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"c\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02\x46\"A/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\x12\xa3\x01\n\tListTasks\x12\'.google.cloud.tasks.v2.ListTasksRequest\x1a(.google.cloud.tasks.v2.ListTasksResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{parent=projects/*/locations/*/queues/*}/tasks\x12\x90\x01\n\x07GetTask\x12%.google.cloud.tasks.v2.GetTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xa0\x01\n\nCreateTask\x12(.google.cloud.tasks.v2.CreateTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"K\xda\x41\x0bparent,task\x82\xd3\xe4\x93\x02\x37\"2/v2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\x12\x91\x01\n\nDeleteTask\x12(.google.cloud.tasks.v2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\x97\x01\n\x07RunTask\x12%.google.cloud.tasks.v2.RunTaskRequest\x1a\x1b.google.cloud.tasks.v2.Task\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\x1aM\xca\x41\x19\x63loudtasks.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBv\n\x19\x63om.google.cloud.tasks.v2B\x0f\x43loudTasksProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspb\xa2\x02\x05TASKSb\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.tasks.v2.Queue", "google/cloud/tasks/v2/queue.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.tasks.v2.Task", "google/cloud/tasks/v2/task.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 Tasks - module V2 - ListQueuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListQueuesRequest").msgclass - ListQueuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListQueuesResponse").msgclass - GetQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.GetQueueRequest").msgclass - CreateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.CreateQueueRequest").msgclass - UpdateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.UpdateQueueRequest").msgclass - DeleteQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.DeleteQueueRequest").msgclass - PurgeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.PurgeQueueRequest").msgclass - PauseQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.PauseQueueRequest").msgclass - ResumeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ResumeQueueRequest").msgclass - ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListTasksRequest").msgclass - ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.ListTasksResponse").msgclass - GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.GetTaskRequest").msgclass - CreateTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.CreateTaskRequest").msgclass - DeleteTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.DeleteTaskRequest").msgclass - RunTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.RunTaskRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb deleted file mode 100644 index cb4e06b079fc..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb +++ /dev/null @@ -1,206 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/tasks/v2/cloudtasks.proto for package 'google.cloud.tasks.v2' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/tasks/v2/cloudtasks_pb' - -module Google - module Cloud - module Tasks - module V2 - module CloudTasks - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.tasks.v2.CloudTasks' - - # Lists queues. - # - # Queues are returned in lexicographical order. - rpc :ListQueues, ::Google::Cloud::Tasks::V2::ListQueuesRequest, ::Google::Cloud::Tasks::V2::ListQueuesResponse - # Gets a queue. - rpc :GetQueue, ::Google::Cloud::Tasks::V2::GetQueueRequest, ::Google::Cloud::Tasks::V2::Queue - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :CreateQueue, ::Google::Cloud::Tasks::V2::CreateQueueRequest, ::Google::Cloud::Tasks::V2::Queue - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :UpdateQueue, ::Google::Cloud::Tasks::V2::UpdateQueueRequest, ::Google::Cloud::Tasks::V2::Queue - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :DeleteQueue, ::Google::Cloud::Tasks::V2::DeleteQueueRequest, ::Google::Protobuf::Empty - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - rpc :PurgeQueue, ::Google::Cloud::Tasks::V2::PurgeQueueRequest, ::Google::Cloud::Tasks::V2::Queue - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can - # still be added when the queue is paused. A queue is paused if its - # [state][google.cloud.tasks.v2.Queue.state] is - # [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - rpc :PauseQueue, ::Google::Cloud::Tasks::V2::PauseQueueRequest, ::Google::Cloud::Tasks::V2::Queue - # Resume a queue. - # - # This method resumes a queue after it has been - # [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or - # [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a - # queue is stored in the queue's [state][google.cloud.tasks.v2.Queue.state]; - # after calling this method it will be set to - # [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - rpc :ResumeQueue, ::Google::Cloud::Tasks::V2::ResumeQueueRequest, ::Google::Cloud::Tasks::V2::Queue - # Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. - # Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on a - # [Queue][google.cloud.tasks.v2.Queue]. If the resource does not exist, this - # will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Lists the tasks in a queue. - # - # By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is - # retrieved due to performance considerations; - # [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - rpc :ListTasks, ::Google::Cloud::Tasks::V2::ListTasksRequest, ::Google::Cloud::Tasks::V2::ListTasksResponse - # Gets a task. - rpc :GetTask, ::Google::Cloud::Tasks::V2::GetTaskRequest, ::Google::Cloud::Tasks::V2::Task - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * The maximum task size is 100KB. - rpc :CreateTask, ::Google::Cloud::Tasks::V2::CreateTaskRequest, ::Google::Cloud::Tasks::V2::Task - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has executed successfully or permanently - # failed. - rpc :DeleteTask, ::Google::Cloud::Tasks::V2::DeleteTaskRequest, ::Google::Protobuf::Empty - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # [RateLimits][google.cloud.tasks.v2.RateLimits] or is - # [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - # - # This command is meant to be used for manual debugging. For - # example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to - # retry a failed task after a fix has been made or to manually force a task - # to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the [status][Task.status] after the task is dispatched but - # before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to - # the time that [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was - # called plus the retry delay specified in the queue's - # [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - # - # [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - rpc :RunTask, ::Google::Cloud::Tasks::V2::RunTaskRequest, ::Google::Cloud::Tasks::V2::Task - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb deleted file mode 100644 index 32c7710eaeac..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/queue_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2/queue.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/tasks/v2/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n!google/cloud/tasks/v2/queue.proto\x12\x15google.cloud.tasks.v2\x1a\x19google/api/resource.proto\x1a\"google/cloud/tasks/v2/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb2\x04\n\x05Queue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12L\n\x1b\x61pp_engine_routing_override\x18\x02 \x01(\x0b\x32\'.google.cloud.tasks.v2.AppEngineRouting\x12\x36\n\x0brate_limits\x18\x03 \x01(\x0b\x32!.google.cloud.tasks.v2.RateLimits\x12\x38\n\x0cretry_config\x18\x04 \x01(\x0b\x32\".google.cloud.tasks.v2.RetryConfig\x12\x31\n\x05state\x18\x05 \x01(\x0e\x32\".google.cloud.tasks.v2.Queue.State\x12.\n\npurge_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12S\n\x1astackdriver_logging_config\x18\t \x01(\x0b\x32/.google.cloud.tasks.v2.StackdriverLoggingConfig\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03:\\\xea\x41Y\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x36projects/{project}/locations/{location}/queues/{queue}\"j\n\nRateLimits\x12!\n\x19max_dispatches_per_second\x18\x01 \x01(\x01\x12\x16\n\x0emax_burst_size\x18\x02 \x01(\x05\x12!\n\x19max_concurrent_dispatches\x18\x03 \x01(\x05\"\xd1\x01\n\x0bRetryConfig\x12\x14\n\x0cmax_attempts\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmin_backoff\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmax_backoff\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\"2\n\x18StackdriverLoggingConfig\x12\x16\n\x0esampling_ratio\x18\x01 \x01(\x01\x42i\n\x19\x63om.google.cloud.tasks.v2B\nQueueProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspbb\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.tasks.v2.AppEngineRouting", "google/cloud/tasks/v2/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.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 Tasks - module V2 - Queue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Queue").msgclass - Queue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Queue.State").enummodule - RateLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.RateLimits").msgclass - RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.RetryConfig").msgclass - StackdriverLoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.StackdriverLoggingConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb deleted file mode 100644 index 4c702f14da87..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloud_tasks/rest" -require "google/cloud/tasks/v2/bindings_override" -require "google/cloud/tasks/v2/version" - -module Google - module Cloud - module Tasks - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/tasks/v2/rest" - # client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb deleted file mode 100644 index d5652cbc79ee..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/target_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2/target.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n\"google/cloud/tasks/v2/target.proto\x12\x15google.cloud.tasks.v2\x1a\x1fgoogle/api/field_behavior.proto\"\xe1\x02\n\x0bHttpRequest\x12\x10\n\x03url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x0bhttp_method\x18\x02 \x01(\x0e\x32!.google.cloud.tasks.v2.HttpMethod\x12@\n\x07headers\x18\x03 \x03(\x0b\x32/.google.cloud.tasks.v2.HttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12\x38\n\x0boauth_token\x18\x05 \x01(\x0b\x32!.google.cloud.tasks.v2.OAuthTokenH\x00\x12\x36\n\noidc_token\x18\x06 \x01(\x0b\x32 .google.cloud.tasks.v2.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\xb2\x02\n\x14\x41ppEngineHttpRequest\x12\x36\n\x0bhttp_method\x18\x01 \x01(\x0e\x32!.google.cloud.tasks.v2.HttpMethod\x12\x43\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32\'.google.cloud.tasks.v2.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12I\n\x07headers\x18\x04 \x03(\x0b\x32\x38.google.cloud.tasks.v2.AppEngineHttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42j\n\x19\x63om.google.cloud.tasks.v2B\x0bTargetProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspbb\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 = [ - ] - 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 Tasks - module V2 - HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.HttpRequest").msgclass - AppEngineHttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.AppEngineHttpRequest").msgclass - AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.AppEngineRouting").msgclass - OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.OAuthToken").msgclass - OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.OidcToken").msgclass - HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.HttpMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb deleted file mode 100644 index de632c9ad771..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/task_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2/task.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/tasks/v2/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n google/cloud/tasks/v2/task.proto\x12\x15google.cloud.tasks.v2\x1a\x19google/api/resource.proto\x1a\"google/cloud/tasks/v2/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb4\x05\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12N\n\x17\x61pp_engine_http_request\x18\x02 \x01(\x0b\x32+.google.cloud.tasks.v2.AppEngineHttpRequestH\x00\x12:\n\x0chttp_request\x18\x03 \x01(\x0b\x32\".google.cloud.tasks.v2.HttpRequestH\x00\x12\x31\n\rschedule_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x11\x64ispatch_deadline\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x16\n\x0e\x64ispatch_count\x18\x07 \x01(\x05\x12\x16\n\x0eresponse_count\x18\x08 \x01(\x05\x12\x35\n\rfirst_attempt\x18\t \x01(\x0b\x32\x1e.google.cloud.tasks.v2.Attempt\x12\x34\n\x0clast_attempt\x18\n \x01(\x0b\x32\x1e.google.cloud.tasks.v2.Attempt\x12.\n\x04view\x18\x0b \x01(\x0e\x32 .google.cloud.tasks.v2.Task.View\"1\n\x04View\x12\x14\n\x10VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02:h\xea\x41\x65\n\x1e\x63loudtasks.googleapis.com/Task\x12\x43projects/{project}/locations/{location}/queues/{queue}/tasks/{task}B\x0e\n\x0cmessage_type\"\xcf\x01\n\x07\x41ttempt\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rdispatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rresponse_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x0fresponse_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusBh\n\x19\x63om.google.cloud.tasks.v2B\tTaskProtoP\x01Z>cloud.google.com/go/cloudtasks/apiv2/cloudtaskspb;cloudtaskspbb\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.tasks.v2.AppEngineHttpRequest", "google/cloud/tasks/v2/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.rpc.Status", "google/rpc/status.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 Tasks - module V2 - Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Task").msgclass - Task::View = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Task.View").enummodule - Attempt = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.Attempt").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb b/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb deleted file mode 100644 index f4f62b513076..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/lib/google/cloud/tasks/v2/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md deleted file mode 100644 index 4412e67816f1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Tasks V2 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-tasks-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb deleted file mode 100644 index d756876962c9..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/cloudtasks.rb +++ /dev/null @@ -1,375 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2 - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @!attribute [rw] filter - # @return [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "state: PAUSED". - # - # Note that using filters might cause fewer queues than the - # requested page_size to be returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues} method. It is an - # error to switch the value of the - # {::Google::Cloud::Tasks::V2::ListQueuesRequest#filter filter} while iterating - # through pages. - class ListQueuesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues}. - # @!attribute [rw] queues - # @return [::Array<::Google::Cloud::Tasks::V2::Queue>] - # The list of queues. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # - # To return the next page of results, call - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues ListQueues} with this value - # as the {::Google::Cloud::Tasks::V2::ListQueuesRequest#page_token page_token}. - # - # If the next_page_token is empty, there are no more results. - # - # The page token is valid for only 2 hours. - class ListQueuesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for {::Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue GetQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - class GetQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue CreateQueue}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @!attribute [rw] queue - # @return [::Google::Cloud::Tasks::V2::Queue] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an - # existing queue. - class CreateQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue UpdateQueue}. - # @!attribute [rw] queue - # @return [::Google::Cloud::Tasks::V2::Queue] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} must be specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2::Queue#name name} cannot be changed. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - class UpdateQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue DeleteQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - class DeleteQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue PurgeQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class PurgeQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue PauseQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class PauseQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue ResumeQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class ResumeQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing tasks using - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks}. - # @!attribute [rw] parent - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - class ListTasksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing tasks using - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks}. - # @!attribute [rw] tasks - # @return [::Array<::Google::Cloud::Tasks::V2::Task>] - # The list of tasks. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # - # To return the next page of results, call - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks ListTasks} with this value as - # the {::Google::Cloud::Tasks::V2::ListTasksRequest#page_token page_token}. - # - # If the next_page_token is empty, there are no more results. - class ListTasksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a task using - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#get_task GetTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - class GetTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask}. - # @!attribute [rw] parent - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @!attribute [rw] task - # @return [::Google::Cloud::Tasks::V2::Task] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2::Task#name name}. If a name is not specified then - # the system will generate a random unique task id, which will be set in the - # task returned in the {::Google::Cloud::Tasks::V2::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} is not set or - # is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or executed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1hour after the original task was - # deleted or executed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9days after the original task was deleted or executed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - class CreateTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a task using - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task DeleteTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - class DeleteTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for forcing a task to run now using - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} will be returned. - # - # By default response_view is {::Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; - # not all information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Task Task} resource. - class RunTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb deleted file mode 100644 index 48b30becd0e3..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/queue.rb +++ /dev/null @@ -1,376 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2 - # A queue is a container of related tasks. Queues are configured to manage - # how those tasks are dispatched. Configurable properties include rate limits, - # retry options, queue types, and others. - # @!attribute [rw] name - # @return [::String] - # Caller-specified and required in - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue CreateQueue}, after which it - # becomes output only. - # - # The queue name. - # - # The queue name must have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the queue's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - # hyphens (-). The maximum length is 100 characters. - # @!attribute [rw] app_engine_routing_override - # @return [::Google::Cloud::Tasks::V2::AppEngineRouting] - # Overrides for - # [task-level - # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - # These settings apply only to - # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in this - # queue. {::Google::Cloud::Tasks::V2::HttpRequest Http tasks} are not affected. - # - # If set, `app_engine_routing_override` is used for all - # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in the - # queue, no matter what the setting is for the [task-level - # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - # @!attribute [rw] rate_limits - # @return [::Google::Cloud::Tasks::V2::RateLimits] - # Rate limits for task dispatches. - # - # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits} and - # {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config} are related - # because they both control task attempts. However they control task attempts - # in different ways: - # - # * {::Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits} controls the total - # rate of - # dispatches from a queue (i.e. all traffic dispatched from the - # queue, regardless of whether the dispatch is from a first - # attempt or a retry). - # * {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config} controls what - # happens to - # particular a task after its first attempt fails. That is, - # {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config} controls task - # retries (the second attempt, third attempt, etc). - # - # The queue's actual dispatch rate is the result of: - # - # * Number of tasks in the queue - # * User-specified throttling: - # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits}, - # {::Google::Cloud::Tasks::V2::Queue#retry_config retry_config}, and the - # [queue's state][google.cloud.tasks.v2.Queue.state]. - # * System throttling due to `429` (Too Many Requests) or `503` (Service - # Unavailable) responses from the worker, high error rates, or to smooth - # sudden large traffic spikes. - # @!attribute [rw] retry_config - # @return [::Google::Cloud::Tasks::V2::RetryConfig] - # Settings that determine the retry behavior. - # - # * For tasks created using Cloud Tasks: the queue-level retry settings - # apply to all tasks in the queue that were created using Cloud Tasks. - # Retry settings cannot be set on individual tasks. - # * For tasks created using the App Engine SDK: the queue-level retry - # settings apply to all tasks in the queue which do not have retry settings - # explicitly set on the task and were created by the App Engine SDK. See - # [App Engine - # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - # @!attribute [rw] state - # @return [::Google::Cloud::Tasks::V2::Queue::State] - # Output only. The state of the queue. - # - # `state` can only be changed by calling - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue PauseQueue}, - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue ResumeQueue}, or uploading - # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue UpdateQueue} cannot be used - # to change `state`. - # @!attribute [rw] purge_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time this queue was purged. - # - # All tasks that were {::Google::Cloud::Tasks::V2::Task#create_time created} - # before this time were purged. - # - # A queue can be purged using - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue PurgeQueue}, the [App Engine - # Task Queue SDK, or the Cloud - # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - # - # Purge time will be truncated to the nearest microsecond. Purge - # time will be unset if the queue has never been purged. - # @!attribute [rw] stackdriver_logging_config - # @return [::Google::Cloud::Tasks::V2::StackdriverLoggingConfig] - # Configuration options for writing logs to - # [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - # field is unset, then no logs are written. - class Queue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the queue. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The queue is running. Tasks can be dispatched. - # - # If the queue was created using Cloud Tasks and the queue has - # had no activity (method calls or task dispatches) for 30 days, - # the queue may take a few minutes to re-activate. Some method - # calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - # tasks may not be dispatched for a few minutes until the queue - # has been re-activated. - RUNNING = 1 - - # Tasks are paused by the user. If the queue is paused then Cloud - # Tasks will stop delivering tasks from it, but more tasks can - # still be added to it by the user. - PAUSED = 2 - - # The queue is disabled. - # - # A queue becomes `DISABLED` when - # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - # or - # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - # is uploaded which does not contain the queue. You cannot directly disable - # a queue. - # - # When a queue is disabled, tasks can still be added to a queue - # but the tasks are not dispatched. - # - # To permanently delete this queue and all of its tasks, call - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue DeleteQueue}. - DISABLED = 3 - end - end - - # Rate limits. - # - # This message determines the maximum rate that tasks can be dispatched by a - # queue, regardless of whether the dispatch is a first task attempt or a retry. - # - # Note: The debugging command, - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task RunTask}, will run a task even if - # the queue has reached its {::Google::Cloud::Tasks::V2::RateLimits RateLimits}. - # @!attribute [rw] max_dispatches_per_second - # @return [::Float] - # The maximum rate at which tasks are dispatched from this queue. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # * The maximum allowed value is 500. - # - # - # This field has the same meaning as - # [rate in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - # @!attribute [rw] max_burst_size - # @return [::Integer] - # Output only. The max burst size. - # - # Max burst size limits how fast tasks in queue are processed when - # many tasks are in the queue and the rate is high. This field - # allows the queue to have a high rate so processing starts shortly - # after a task is enqueued, but still limits resource usage when - # many tasks are enqueued in a short period of time. - # - # The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - # algorithm is used to control the rate of task dispatches. Each - # queue has a token bucket that holds tokens, up to the maximum - # specified by `max_burst_size`. Each time a task is dispatched, a - # token is removed from the bucket. Tasks will be dispatched until - # the queue's bucket runs out of tokens. The bucket will be - # continuously refilled with new tokens based on - # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}. - # - # Cloud Tasks will pick the value of `max_burst_size` based on the - # value of - # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}. - # - # For queues that were created or updated using - # `queue.yaml/xml`, `max_burst_size` is equal to - # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - # Since `max_burst_size` is output only, if - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue UpdateQueue} is called on a - # queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on - # the value of - # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}, - # regardless of whether - # {::Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second} - # is updated. - # @!attribute [rw] max_concurrent_dispatches - # @return [::Integer] - # The maximum number of concurrent tasks that Cloud Tasks allows - # to be dispatched for this queue. After this threshold has been - # reached, Cloud Tasks stops dispatching tasks until the number of - # concurrent requests decreases. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # The maximum allowed value is 5,000. - # - # - # This field has the same meaning as - # [max_concurrent_requests in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - class RateLimits - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retry config. - # - # These settings determine when a failed task attempt is retried. - # @!attribute [rw] max_attempts - # @return [::Integer] - # Number of attempts per task. - # - # Cloud Tasks will attempt the task `max_attempts` times (that is, if the - # first attempt fails, then there will be `max_attempts - 1` retries). Must - # be >= -1. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # -1 indicates unlimited attempts. - # - # This field has the same meaning as - # [task_retry_limit in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_retry_duration - # @return [::Google::Protobuf::Duration] - # If positive, `max_retry_duration` specifies the time limit for - # retrying a failed task, measured from when the task was first - # attempted. Once `max_retry_duration` time has passed *and* the - # task has been attempted - # {::Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts} times, no - # further attempts will be made and the task will be deleted. - # - # If zero, then the task age is unlimited. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # `max_retry_duration` will be truncated to the nearest second. - # - # This field has the same meaning as - # [task_age_limit in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] min_backoff - # @return [::Google::Protobuf::Duration] - # A task will be {::Google::Cloud::Tasks::V2::Task#schedule_time scheduled} for - # retry between {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} - # and {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} duration - # after it fails, if the queue's - # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig} specifies that the task - # should be retried. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # `min_backoff` will be truncated to the nearest second. - # - # This field has the same meaning as - # [min_backoff_seconds in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_backoff - # @return [::Google::Protobuf::Duration] - # A task will be {::Google::Cloud::Tasks::V2::Task#schedule_time scheduled} for - # retry between {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} - # and {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} duration - # after it fails, if the queue's - # {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig} specifies that the task - # should be retried. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # `max_backoff` will be truncated to the nearest second. - # - # This field has the same meaning as - # [max_backoff_seconds in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_doublings - # @return [::Integer] - # The time between retries will double `max_doublings` times. - # - # A task's retry interval starts at - # {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff}, then doubles - # `max_doublings` times, then increases linearly, and finally - # retries at intervals of - # {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} up to - # {::Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts} times. - # - # For example, if - # {::Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} is 10s, - # {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} is 300s, and - # `max_doublings` is 3, then the a task will first be retried in - # 10s. The retry interval will double three times, and then - # increase linearly by 2^3 * 10s. Finally, the task will retry at - # intervals of {::Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} - # until the task has been attempted - # {::Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts} times. Thus, - # the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # This field has the same meaning as - # [max_doublings in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - class RetryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration options for writing logs to - # [Stackdriver Logging](https://cloud.google.com/logging/docs/). - # @!attribute [rw] sampling_ratio - # @return [::Float] - # Specifies the fraction of operations to write to - # [Stackdriver Logging](https://cloud.google.com/logging/docs/). - # This field may contain any value between 0.0 and 1.0, inclusive. - # 0.0 is the default and means that no operations are logged. - class StackdriverLoggingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb deleted file mode 100644 index fdee342780f8..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/target.rb +++ /dev/null @@ -1,466 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2 - # HTTP request. - # - # The task will be pushed to the worker as an HTTP request. If the worker - # or the redirected worker acknowledges the task by returning a successful HTTP - # response code ([`200` - `299`]), the task will be removed from the queue. If - # any other HTTP response code is returned or no response is received, the - # task will be retried according to the following: - # - # * User-specified throttling: [retry - # configuration][google.cloud.tasks.v2.Queue.retry_config], - # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate limits}, and the [queue's - # state][google.cloud.tasks.v2.Queue.state]. - # - # * System throttling: To prevent the worker from overloading, Cloud Tasks may - # temporarily reduce the queue's effective rate. User-specified settings - # will not be changed. - # - # System throttling happens because: - # - # * Cloud Tasks backs off on all errors. Normally the backoff specified in - # {::Google::Cloud::Tasks::V2::Queue#rate_limits rate limits} will be used. But - # if the worker returns `429` (Too Many Requests), `503` (Service - # Unavailable), or the rate of errors is high, Cloud Tasks will use a - # higher backoff rate. The retry specified in the `Retry-After` HTTP - # response header is considered. - # - # * To prevent traffic spikes and to smooth sudden increases in traffic, - # dispatches ramp up slowly when the queue is newly created or idle and - # if large numbers of tasks suddenly become available to dispatch (due to - # spikes in create task rates, the queue being unpaused, or many tasks - # that are scheduled at the same time). - # @!attribute [rw] url - # @return [::String] - # Required. The full url path that the request will be sent to. - # - # This string must begin with either "http://" or "https://". Some examples - # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - # encode some characters for safety and compatibility. The maximum allowed - # URL length is 2083 characters after encoding. - # - # The `Location` header response from a redirect response [`300` - `399`] - # may be followed. The redirect is not counted as a separate attempt. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2::HttpMethod] - # The HTTP method to use for the request. The default is POST. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. - # Headers can be set when the - # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - # - # These headers represent a subset of the headers that will accompany the - # task's HTTP request. Some HTTP request headers will be ignored or replaced. - # - # A partial list of headers that will be ignored or replaced is: - # - # * Host: This will be computed by Cloud Tasks and derived from - # {::Google::Cloud::Tasks::V2::HttpRequest#url HttpRequest.url}. - # * Content-Length: This will be computed by Cloud Tasks. - # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - # * `X-Google-*`: Google use only. - # * `X-AppEngine-*`: Google use only. - # - # `Content-Type` won't be set by Cloud Tasks. You can explicitly set - # `Content-Type` to a media type when the - # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - # For example, `Content-Type` can be set to `"application/octet-stream"` or - # `"application/json"`. - # - # Headers which can have multiple values (according to RFC2616) can be - # specified using comma-separated values. - # - # The size of the headers must be less than 80KB. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. - # - # A request body is allowed only if the - # {::Google::Cloud::Tasks::V2::HttpRequest#http_method HTTP method} is POST, PUT, - # or PATCH. It is an error to set body on a task with an incompatible - # {::Google::Cloud::Tasks::V2::HttpMethod HttpMethod}. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Tasks::V2::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as an `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # - # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Tasks::V2::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # - # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HttpRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine HTTP request. - # - # The message defines the HTTP request that is sent to an App Engine app when - # the task is dispatched. - # - # Using {::Google::Cloud::Tasks::V2::AppEngineHttpRequest AppEngineHttpRequest} - # requires - # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) - # Google IAM permission for the project - # and the following scope: - # - # `https://www.googleapis.com/auth/cloud-platform` - # - # The task will be delivered to the App Engine app which belongs to the same - # project as the queue. For more information, see - # [How Requests are - # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and how routing is affected by - # [dispatch - # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). - # Traffic is encrypted during transport and never leaves Google datacenters. - # Because this traffic is carried over a communication mechanism internal to - # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). - # The request to the handler, however, will appear to have used the HTTP - # protocol. - # - # The {::Google::Cloud::Tasks::V2::AppEngineRouting AppEngineRouting} used to - # construct the URL that the task is delivered to can be set at the queue-level - # or task-level: - # - # * If [app_engine_routing_override is set on the - # queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this value - # is used for all tasks in the queue, no matter what the setting is for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - # - # - # The `url` that the task will be sent to is: - # - # * `url =` {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} `+` - # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest#relative_uri relative_uri} - # - # Tasks can be dispatched to secure app handlers, unsecure app handlers, and - # URIs restricted with - # [`login: - # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). - # Because tasks are not run as any user, they cannot be dispatched to URIs - # restricted with - # [`login: - # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) - # Task dispatches also do not follow redirects. - # - # The task attempt has succeeded if the app's request handler returns an HTTP - # response code in the range [`200` - `299`]. The task attempt has failed if - # the app's handler returns a non-2xx response code or Cloud Tasks does - # not receive response before the - # {::Google::Cloud::Tasks::V2::Task#dispatch_deadline deadline}. Failed tasks will - # be retried according to the [retry - # configuration][google.cloud.tasks.v2.Queue.retry_config]. `503` (Service - # Unavailable) is considered an App Engine system error instead of an - # application error and will cause Cloud Tasks' traffic congestion control to - # temporarily throttle the queue's dispatches. Unlike other types of task - # targets, a `429` (Too Many Requests) response from an app handler does not - # cause traffic congestion control to throttle the queue. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2::HttpMethod] - # The HTTP method to use for the request. The default is POST. - # - # The app's request handler for the task's target URL must be able to handle - # HTTP requests with this http_method, otherwise the task attempt fails with - # error code 405 (Method Not Allowed). See [Writing a push task request - # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - # and the App Engine documentation for your runtime on [How Requests are - # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - # @!attribute [rw] app_engine_routing - # @return [::Google::Cloud::Tasks::V2::AppEngineRouting] - # Task-level setting for App Engine routing. - # - # * If [app_engine_routing_override is set on the - # queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this - # value is used for all tasks in the queue, no matter what the setting is - # for the [task-level - # app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - # @!attribute [rw] relative_uri - # @return [::String] - # The relative URI. - # - # The relative URI must begin with "/" and must be a valid HTTP relative URI. - # It can contain a path and query string arguments. - # If the relative URI is empty, then the root path "/" will be used. - # No spaces are allowed, and the maximum length allowed is 2083 characters. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. - # Headers can be set when the - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task task is created}. - # Repeated headers are not supported but a header value can contain commas. - # - # Cloud Tasks sets some headers to default values: - # - # * `User-Agent`: By default, this header is - # `"AppEngine-Google; (+http://code.google.com/appengine)"`. - # This header can be modified, but Cloud Tasks will append - # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - # modified `User-Agent`. - # - # If the task has a {::Google::Cloud::Tasks::V2::AppEngineHttpRequest#body body}, - # Cloud Tasks sets the following headers: - # - # * `Content-Type`: By default, the `Content-Type` header is set to - # `"application/octet-stream"`. The default can be overridden by explicitly - # setting `Content-Type` to a particular media type when the - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task task is created}. - # For example, `Content-Type` can be set to `"application/json"`. - # * `Content-Length`: This is computed by Cloud Tasks. This value is - # output only. It cannot be changed. - # - # The headers below cannot be set or overridden: - # - # * `Host` - # * `X-Google-*` - # * `X-AppEngine-*` - # - # In addition, Cloud Tasks sets some headers when the task is dispatched, - # such as headers containing information about the task; see - # [request - # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - # These headers are set only when the task is dispatched, so they are not - # visible when the task is returned in a Cloud Tasks response. - # - # Although there is no specific limit for the maximum number of headers or - # the size, there is a limit on the maximum size of the - # {::Google::Cloud::Tasks::V2::Task Task}. For more information, see the - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask} documentation. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. - # - # A request body is allowed only if the HTTP method is POST or PUT. It is - # an error to set a body on a task with an incompatible - # {::Google::Cloud::Tasks::V2::HttpMethod HttpMethod}. - class AppEngineHttpRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine Routing. - # - # Defines routing characteristics specific to App Engine - service, version, - # and instance. - # - # For more information about services, versions, and instances see - # [An Overview of App - # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), - # [Microservices Architecture on Google App - # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # - # Using {::Google::Cloud::Tasks::V2::AppEngineRouting AppEngineRouting} requires - # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) - # Google IAM permission for the project - # and the following scope: - # - # `https://www.googleapis.com/auth/cloud-platform` - # @!attribute [rw] service - # @return [::String] - # App service. - # - # By default, the task is sent to the service which is the default - # service when the task is attempted. - # - # For some queues or tasks which were created using the App Engine - # Task Queue API, {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not - # parsable into {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. For example, - # some tasks which were created using the App Engine SDK use a custom domain - # name; custom domains are not parsed by Cloud Tasks. If - # {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable, then - # {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance} are the empty - # string. - # @!attribute [rw] version - # @return [::String] - # App version. - # - # By default, the task is sent to the version which is the default - # version when the task is attempted. - # - # For some queues or tasks which were created using the App Engine - # Task Queue API, {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not - # parsable into {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. For example, - # some tasks which were created using the App Engine SDK use a custom domain - # name; custom domains are not parsed by Cloud Tasks. If - # {::Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable, then - # {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance} are the empty - # string. - # @!attribute [rw] instance - # @return [::String] - # App instance. - # - # By default, the task is sent to an instance which is available when - # the task is attempted. - # - # Requests can only be sent to a specific instance if - # [manual scaling is used in App Engine - # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - # App Engine Flex does not support instances. For more information, see - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] host - # @return [::String] - # Output only. The host that the task is sent to. - # - # The host is constructed from the domain name of the app associated with - # the queue's project ID (for example .appspot.com), and the - # {::Google::Cloud::Tasks::V2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. Tasks which - # were created using the App Engine SDK might have a custom domain name. - # - # For more information, see - # [How Requests are - # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - class AppEngineRouting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). - # This type of authorization should generally only be used when calling Google - # APIs hosted on *.googleapis.com. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OAuth token. - # The service account must be within the same project as the queue. The - # caller must have iam.serviceAccounts.actAs permission for the service - # account. - # @!attribute [rw] scope - # @return [::String] - # OAuth scope to be used for generating OAuth access token. - # If not specified, "https://www.googleapis.com/auth/cloud-platform" - # will be used. - class OAuthToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OpenID Connect - # token](https://developers.google.com/identity/protocols/OpenIDConnect). - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OIDC token. - # The service account must be within the same project as the queue. The - # caller must have iam.serviceAccounts.actAs permission for the service - # account. - # @!attribute [rw] audience - # @return [::String] - # Audience to be used when generating OIDC token. If not specified, the URI - # specified in target will be used. - class OidcToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The HTTP method used to deliver the task. - module HttpMethod - # HTTP method unspecified - HTTP_METHOD_UNSPECIFIED = 0 - - # HTTP POST - POST = 1 - - # HTTP GET - GET = 2 - - # HTTP HEAD - HEAD = 3 - - # HTTP PUT - PUT = 4 - - # HTTP DELETE - DELETE = 5 - - # HTTP PATCH - PATCH = 6 - - # HTTP OPTIONS - OPTIONS = 7 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb deleted file mode 100644 index 9a48ee97aae1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/cloud/tasks/v2/task.rb +++ /dev/null @@ -1,196 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2 - # A unit of scheduled work. - # @!attribute [rw] name - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task CreateTask}. - # - # The task name. - # - # The task name must have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the task's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - # hyphens (-). The maximum length is 100 characters. - # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), or underscores (_). The maximum length is 500 characters. - # @!attribute [rw] app_engine_http_request - # @return [::Google::Cloud::Tasks::V2::AppEngineHttpRequest] - # HTTP request that is sent to the App Engine app handler. - # - # An App Engine task is a task that has - # {::Google::Cloud::Tasks::V2::AppEngineHttpRequest AppEngineHttpRequest} set. - # - # Note: The following fields are mutually exclusive: `app_engine_http_request`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] http_request - # @return [::Google::Cloud::Tasks::V2::HttpRequest] - # HTTP request that is sent to the worker. - # - # An HTTP task is a task that has - # {::Google::Cloud::Tasks::V2::HttpRequest HttpRequest} set. - # - # Note: The following fields are mutually exclusive: `http_request`, `app_engine_http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # The time when the task is scheduled to be attempted or retried. - # - # `schedule_time` will be truncated to the nearest microsecond. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the task was created. - # - # `create_time` will be truncated to the nearest second. - # @!attribute [rw] dispatch_deadline - # @return [::Google::Protobuf::Duration] - # The deadline for requests sent to the worker. If the worker does not - # respond by this deadline then the request is cancelled and the attempt - # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - # task according to the {::Google::Cloud::Tasks::V2::RetryConfig RetryConfig}. - # - # Note that when the request is cancelled, Cloud Tasks will stop listening - # for the response, but whether the worker stops processing depends on the - # worker. For example, if the worker is stuck, it may not react to cancelled - # requests. - # - # The default and maximum values depend on the type of request: - # - # * For {::Google::Cloud::Tasks::V2::HttpRequest HTTP tasks}, the default is 10 - # minutes. The deadline - # must be in the interval [15 seconds, 30 minutes]. - # - # * For {::Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks}, 0 - # indicates that the - # request has the default deadline. The default deadline depends on the - # [scaling - # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - # of the service: 10 minutes for standard apps with automatic scaling, 24 - # hours for standard apps with manual and basic scaling, and 60 minutes for - # flex apps. If the request deadline is set, it must be in the interval [15 - # seconds, 24 hours 15 seconds]. Regardless of the task's - # `dispatch_deadline`, the app handler will not run for longer than than - # the service's timeout. We recommend setting the `dispatch_deadline` to - # at most a few seconds more than the app handler's timeout. For more - # information see - # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - # - # `dispatch_deadline` will be truncated to the nearest millisecond. The - # deadline is an approximate deadline. - # @!attribute [rw] dispatch_count - # @return [::Integer] - # Output only. The number of attempts dispatched. - # - # This count includes attempts which have been dispatched but haven't - # received a response. - # @!attribute [rw] response_count - # @return [::Integer] - # Output only. The number of attempts which have received a response. - # @!attribute [rw] first_attempt - # @return [::Google::Cloud::Tasks::V2::Attempt] - # Output only. The status of the task's first attempt. - # - # Only {::Google::Cloud::Tasks::V2::Attempt#dispatch_time dispatch_time} will be - # set. The other {::Google::Cloud::Tasks::V2::Attempt Attempt} information is not - # retained by Cloud Tasks. - # @!attribute [rw] last_attempt - # @return [::Google::Cloud::Tasks::V2::Attempt] - # Output only. The status of the task's last attempt. - # @!attribute [rw] view - # @return [::Google::Cloud::Tasks::V2::Task::View] - # Output only. The view specifies which subset of the - # {::Google::Cloud::Tasks::V2::Task Task} has been returned. - class Task - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The view specifies a subset of {::Google::Cloud::Tasks::V2::Task Task} data. - # - # When a task is returned in a response, not all - # information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - module View - # Unspecified. Defaults to BASIC. - VIEW_UNSPECIFIED = 0 - - # The basic view omits fields which can be large or can contain - # sensitive data. - # - # This view does not include the - # [body in - # AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body]. - # Bodies are desirable to return only when needed, because they - # can be large and because of the sensitivity of the data that you - # choose to store in it. - BASIC = 1 - - # All information is returned. - # - # Authorization for {::Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires - # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - # permission on the {::Google::Cloud::Tasks::V2::Queue Queue} resource. - FULL = 2 - end - end - - # The status of a task attempt. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt was scheduled. - # - # `schedule_time` will be truncated to the nearest microsecond. - # @!attribute [rw] dispatch_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt was dispatched. - # - # `dispatch_time` will be truncated to the nearest microsecond. - # @!attribute [rw] response_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt response was received. - # - # `response_time` will be truncated to the nearest microsecond. - # @!attribute [rw] response_status - # @return [::Google::Rpc::Status] - # Output only. The response from the worker for this attempt. - # - # If `response_time` is unset, then the task has not been attempted or is - # currently running and the `response_status` field is meaningless. - class Attempt - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile deleted file mode 100644 index 8480a57dc7a5..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2", path: "../" -else - gem "google-cloud-tasks-v2" -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-tasks-v2/snippets/cloud_tasks/create_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb deleted file mode 100644 index 89081d8d2d84..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the create_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#create_queue. -# -def create_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::CreateQueueRequest.new - - # Call the create_queue method. - result = client.create_queue request - - # The returned object is of type Google::Cloud::Tasks::V2::Queue. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb deleted file mode 100644 index a12a2894529a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_CreateTask_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the create_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#create_task. -# -def create_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::CreateTaskRequest.new - - # Call the create_task method. - result = client.create_task request - - # The returned object is of type Google::Cloud::Tasks::V2::Task. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb deleted file mode 100644 index 8b80b0958c9b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the delete_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#delete_queue. -# -def delete_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new - - # Call the delete_queue method. - result = client.delete_queue request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb deleted file mode 100644 index c1e9f301f9ab..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the delete_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#delete_task. -# -def delete_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new - - # Call the delete_task method. - result = client.delete_task request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb deleted file mode 100644 index 8fdd3c8d2cef..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the get_iam_policy call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb deleted file mode 100644 index c62917b1cb5e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_GetQueue_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the get_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#get_queue. -# -def get_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::GetQueueRequest.new - - # Call the get_queue method. - result = client.get_queue request - - # The returned object is of type Google::Cloud::Tasks::V2::Queue. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb deleted file mode 100644 index 64d71ad03392..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_GetTask_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the get_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#get_task. -# -def get_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::GetTaskRequest.new - - # Call the get_task method. - result = client.get_task request - - # The returned object is of type Google::Cloud::Tasks::V2::Task. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb deleted file mode 100644 index 833568cefc39..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_ListQueues_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the list_queues call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#list_queues. -# -def list_queues - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::ListQueuesRequest.new - - # Call the list_queues method. - result = client.list_queues 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::Tasks::V2::Queue. - p item - end -end -# [END cloudtasks_v2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb deleted file mode 100644 index be8504a93b6b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_ListTasks_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the list_tasks call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#list_tasks. -# -def list_tasks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::ListTasksRequest.new - - # Call the list_tasks method. - result = client.list_tasks 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::Tasks::V2::Task. - p item - end -end -# [END cloudtasks_v2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb deleted file mode 100644 index 1f82a9e28be0..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the pause_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#pause_queue. -# -def pause_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::PauseQueueRequest.new - - # Call the pause_queue method. - result = client.pause_queue request - - # The returned object is of type Google::Cloud::Tasks::V2::Queue. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb deleted file mode 100644 index cb87bbc3f976..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the purge_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#purge_queue. -# -def purge_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new - - # Call the purge_queue method. - result = client.purge_queue request - - # The returned object is of type Google::Cloud::Tasks::V2::Queue. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb deleted file mode 100644 index 7f8d6bd94477..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the resume_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#resume_queue. -# -def resume_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new - - # Call the resume_queue method. - result = client.resume_queue request - - # The returned object is of type Google::Cloud::Tasks::V2::Queue. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb deleted file mode 100644 index 08df0ddafb7e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_RunTask_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the run_task call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#run_task. -# -def run_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::RunTaskRequest.new - - # Call the run_task method. - result = client.run_task request - - # The returned object is of type Google::Cloud::Tasks::V2::Task. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb deleted file mode 100644 index 10fdebb1dcdc..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the set_iam_policy call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb deleted file mode 100644 index abd84456c6c8..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the test_iam_permissions call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb b/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb deleted file mode 100644 index 05400cd443bf..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] -require "google/cloud/tasks/v2" - -## -# Snippet for the update_queue call in the CloudTasks 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::Tasks::V2::CloudTasks::Client#update_queue. -# -def update_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new - - # Call the update_queue method. - result = client.update_queue request - - # The returned object is of type Google::Cloud::Tasks::V2::Queue. - p result -end -# [END cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json b/owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json deleted file mode 100644 index 30392ec1961e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json +++ /dev/null @@ -1,655 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-tasks-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.tasks.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_ListQueues_sync", - "title": "Snippet for the list_queues call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues.", - "file": "cloud_tasks/list_queues.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_queues", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::ListQueuesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::ListQueuesResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "ListQueues", - "full_name": "google.cloud.tasks.v2.CloudTasks.ListQueues", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_GetQueue_sync", - "title": "Snippet for the get_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue.", - "file": "cloud_tasks/get_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_queue", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::GetQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "GetQueue", - "full_name": "google.cloud.tasks.v2.CloudTasks.GetQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_CreateQueue_sync", - "title": "Snippet for the create_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue.", - "file": "cloud_tasks/create_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_queue", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::CreateQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "CreateQueue", - "full_name": "google.cloud.tasks.v2.CloudTasks.CreateQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync", - "title": "Snippet for the update_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue.", - "file": "cloud_tasks/update_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_queue", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::UpdateQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "UpdateQueue", - "full_name": "google.cloud.tasks.v2.CloudTasks.UpdateQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync", - "title": "Snippet for the delete_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue.", - "file": "cloud_tasks/delete_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_queue", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::DeleteQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "DeleteQueue", - "full_name": "google.cloud.tasks.v2.CloudTasks.DeleteQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync", - "title": "Snippet for the purge_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue.", - "file": "cloud_tasks/purge_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_queue", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::PurgeQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "PurgeQueue", - "full_name": "google.cloud.tasks.v2.CloudTasks.PurgeQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_PauseQueue_sync", - "title": "Snippet for the pause_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue.", - "file": "cloud_tasks/pause_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_queue", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::PauseQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "PauseQueue", - "full_name": "google.cloud.tasks.v2.CloudTasks.PauseQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync", - "title": "Snippet for the resume_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue.", - "file": "cloud_tasks/resume_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_queue", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::ResumeQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "ResumeQueue", - "full_name": "google.cloud.tasks.v2.CloudTasks.ResumeQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#get_iam_policy.", - "file": "cloud_tasks/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.tasks.v2.CloudTasks.GetIamPolicy", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#set_iam_policy.", - "file": "cloud_tasks/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.tasks.v2.CloudTasks.SetIamPolicy", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#test_iam_permissions.", - "file": "cloud_tasks/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.tasks.v2.CloudTasks.TestIamPermissions", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_ListTasks_sync", - "title": "Snippet for the list_tasks call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks.", - "file": "cloud_tasks/list_tasks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tasks", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::ListTasksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::ListTasksResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "ListTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks.ListTasks", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_GetTask_sync", - "title": "Snippet for the get_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#get_task.", - "file": "cloud_tasks/get_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_task", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#get_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::GetTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "GetTask", - "full_name": "google.cloud.tasks.v2.CloudTasks.GetTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_CreateTask_sync", - "title": "Snippet for the create_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#create_task.", - "file": "cloud_tasks/create_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_task", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#create_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::CreateTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "CreateTask", - "full_name": "google.cloud.tasks.v2.CloudTasks.CreateTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_DeleteTask_sync", - "title": "Snippet for the delete_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task.", - "file": "cloud_tasks/delete_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_task", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::DeleteTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "DeleteTask", - "full_name": "google.cloud.tasks.v2.CloudTasks.DeleteTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2_generated_CloudTasks_RunTask_sync", - "title": "Snippet for the run_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2::CloudTasks::Client#run_task.", - "file": "cloud_tasks/run_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_task", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client#run_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2::RunTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2::CloudTasks::Client" - }, - "method": { - "short_name": "RunTask", - "full_name": "google.cloud.tasks.v2.CloudTasks.RunTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2.CloudTasks" - } - } - }, - "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-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb deleted file mode 100644 index 345d9adc75f2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloud_tasks" - -class ::Google::Cloud::Tasks::V2::CloudTasks::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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::Tasks::V2::CloudTasks::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_queue_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.queue_path project: "value0", location: "value1", queue: "value2" - assert_equal "projects/value0/locations/value1/queues/value2", path - end - end - - def test_task_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.task_path project: "value0", location: "value1", queue: "value2", task: "value3" - assert_equal "projects/value0/locations/value1/queues/value2/tasks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb deleted file mode 100644 index 5f59bf5f6de1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_rest_test.rb +++ /dev/null @@ -1,979 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" -require "google/cloud/tasks/v2/cloud_tasks/rest" - - -class ::Google::Cloud::Tasks::V2::CloudTasks::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_queues - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::ListQueuesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_queues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_list_queues_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_queues_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_queues({ parent: parent, 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_queues parent: parent, 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_queues ::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues({ parent: parent, 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_queues(::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues_client_stub.call_count - end - end - end - - def test_get_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_get_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_queue ::Google::Cloud::Tasks::V2::GetQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_queue(::Google::Cloud::Tasks::V2::GetQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_queue_client_stub.call_count - end - end - end - - def test_create_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - queue = {} - - create_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_create_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_queue({ parent: parent, queue: queue }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_queue parent: parent, queue: queue do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_queue ::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_queue({ parent: parent, queue: queue }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_queue(::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_queue_client_stub.call_count - end - end - end - - def test_update_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - queue = {} - update_mask = {} - - update_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_update_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_queue({ queue: queue, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_queue queue: queue, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_queue ::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_queue({ queue: queue, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_queue(::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_queue_client_stub.call_count - end - end - end - - def test_delete_queue - # 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_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_queue ::Google::Cloud::Tasks::V2::DeleteQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_queue(::Google::Cloud::Tasks::V2::DeleteQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_queue_client_stub.call_count - end - end - end - - def test_purge_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - purge_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_purge_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_queue ::Google::Cloud::Tasks::V2::PurgeQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_queue(::Google::Cloud::Tasks::V2::PurgeQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_queue_client_stub.call_count - end - end - end - - def test_pause_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_pause_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_queue ::Google::Cloud::Tasks::V2::PauseQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_queue(::Google::Cloud::Tasks::V2::PauseQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_queue_client_stub.call_count - end - end - end - - def test_resume_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_resume_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_queue ::Google::Cloud::Tasks::V2::ResumeQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_queue(::Google::Cloud::Tasks::V2::ResumeQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_queue_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_list_tasks - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::ListTasksResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - response_view = :VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tasks({ parent: parent, response_view: response_view, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tasks parent: parent, response_view: response_view, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tasks ::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_count - end - end - end - - def test_get_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - response_view = :VIEW_UNSPECIFIED - - get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_task({ name: name, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_task name: name, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_task ::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_task({ name: name, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_count - end - end - end - - def test_create_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - task = {} - response_view = :VIEW_UNSPECIFIED - - create_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_create_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_task({ parent: parent, task: task, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_task parent: parent, task: task, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_task ::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_task({ parent: parent, task: task, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_task(::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_task_client_stub.call_count - end - end - end - - def test_delete_task - # 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_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_task({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_task name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_task ::Google::Cloud::Tasks::V2::DeleteTaskRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_task({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_task(::Google::Cloud::Tasks::V2::DeleteTaskRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_task_client_stub.call_count - end - end - end - - def test_run_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - response_view = :VIEW_UNSPECIFIED - - run_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2::CloudTasks::Rest::ServiceStub.stub :transcode_run_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_task({ name: name, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_task name: name, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_task ::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_task({ name: name, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_task(::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_task_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::Tasks::V2::CloudTasks::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::Tasks::V2::CloudTasks::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb b/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb deleted file mode 100644 index 7f5678b2ed04..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/google/cloud/tasks/v2/cloud_tasks_test.rb +++ /dev/null @@ -1,1074 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2/cloudtasks_pb" -require "google/cloud/tasks/v2/cloud_tasks" - -class ::Google::Cloud::Tasks::V2::CloudTasks::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_queues - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::ListQueuesResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_queues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_queues, name - assert_kind_of ::Google::Cloud::Tasks::V2::ListQueuesRequest, request - assert_equal "hello world", request["parent"] - 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_queues_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_queues({ parent: parent, 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_queues parent: parent, 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_queues ::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues({ parent: parent, 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_queues(::Google::Cloud::Tasks::V2::ListQueuesRequest.new(parent: parent, 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_queues_client_stub.call_rpc_count - end - end - - def test_get_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Queue.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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2::GetQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_queue ::Google::Cloud::Tasks::V2::GetQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_queue({ 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_queue(::Google::Cloud::Tasks::V2::GetQueueRequest.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_queue_client_stub.call_rpc_count - end - end - - def test_create_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" - queue = {} - - create_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2::CreateQueueRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2::Queue), request["queue"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_queue({ parent: parent, queue: queue }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_queue parent: parent, queue: queue do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_queue ::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_queue({ parent: parent, queue: queue }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_queue(::Google::Cloud::Tasks::V2::CreateQueueRequest.new(parent: parent, queue: queue), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_queue_client_stub.call_rpc_count - end - end - - def test_update_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Queue.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. - queue = {} - update_mask = {} - - update_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2::UpdateQueueRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2::Queue), request["queue"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_queue({ queue: queue, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_queue queue: queue, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_queue ::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, 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_queue({ queue: queue, 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_queue(::Google::Cloud::Tasks::V2::UpdateQueueRequest.new(queue: queue, 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_queue_client_stub.call_rpc_count - end - end - - def test_delete_queue - # 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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2::DeleteQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_queue ::Google::Cloud::Tasks::V2::DeleteQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_queue({ 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_queue(::Google::Cloud::Tasks::V2::DeleteQueueRequest.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_queue_client_stub.call_rpc_count - end - end - - def test_purge_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" - - purge_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2::PurgeQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_queue ::Google::Cloud::Tasks::V2::PurgeQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_queue(::Google::Cloud::Tasks::V2::PurgeQueueRequest.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, purge_queue_client_stub.call_rpc_count - end - end - - def test_pause_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" - - pause_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2::PauseQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_queue ::Google::Cloud::Tasks::V2::PauseQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pause_queue(::Google::Cloud::Tasks::V2::PauseQueueRequest.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, pause_queue_client_stub.call_rpc_count - end - end - - def test_resume_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Queue.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" - - resume_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2::ResumeQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_queue ::Google::Cloud::Tasks::V2::ResumeQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resume_queue(::Google::Cloud::Tasks::V2::ResumeQueueRequest.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, resume_queue_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_list_tasks - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::ListTasksResponse.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" - response_view = :VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tasks, name - assert_kind_of ::Google::Cloud::Tasks::V2::ListTasksRequest, request - assert_equal "hello world", request["parent"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tasks({ parent: parent, response_view: response_view, 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_tasks parent: parent, response_view: response_view, 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_tasks ::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_rpc_count - end - end - - def test_get_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Task.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" - response_view = :VIEW_UNSPECIFIED - - get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_task, name - assert_kind_of ::Google::Cloud::Tasks::V2::GetTaskRequest, request - assert_equal "hello world", request["name"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_task({ name: name, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_task name: name, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_task ::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Tasks::V2::GetTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_rpc_count - end - end - - def test_create_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Task.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" - task = {} - response_view = :VIEW_UNSPECIFIED - - create_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_task, name - assert_kind_of ::Google::Cloud::Tasks::V2::CreateTaskRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2::Task), request["task"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_task({ parent: parent, task: task, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_task parent: parent, task: task, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_task ::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_task({ parent: parent, task: task, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_task(::Google::Cloud::Tasks::V2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_task_client_stub.call_rpc_count - end - end - - def test_delete_task - # 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_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_task, name - assert_kind_of ::Google::Cloud::Tasks::V2::DeleteTaskRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_task({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_task name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_task ::Google::Cloud::Tasks::V2::DeleteTaskRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_task({ 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_task(::Google::Cloud::Tasks::V2::DeleteTaskRequest.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_task_client_stub.call_rpc_count - end - end - - def test_run_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2::Task.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" - response_view = :VIEW_UNSPECIFIED - - run_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_task, name - assert_kind_of ::Google::Cloud::Tasks::V2::RunTaskRequest, request - assert_equal "hello world", request["name"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_task({ name: name, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_task name: name, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_task ::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_task(::Google::Cloud::Tasks::V2::RunTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_task_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::Tasks::V2::CloudTasks::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::Tasks::V2::CloudTasks::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Tasks::V2::CloudTasks::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Tasks::V2::CloudTasks::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb b/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/.gitignore b/owl-bot-staging/google-cloud-tasks-v2beta2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/.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-tasks-v2beta2/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta2/.repo-metadata.json deleted file mode 100644 index 7f0b625d0a63..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudtasks.googleapis.com", - "api_shortname": "cloudtasks", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta2/latest", - "distribution_name": "google-cloud-tasks-v2beta2", - "is_cloud": true, - "language": "ruby", - "name": "cloudtasks", - "name_pretty": "Cloud Tasks V2beta2 API", - "product_documentation": "https://cloud.google.com/tasks", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TASKS", - "ruby-cloud-product-url": "https://cloud.google.com/tasks", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml b/owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml deleted file mode 100644 index 21bca46e5821..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-tasks-v2beta2.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-tasks-v2beta2.rb" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/.yardopts b/owl-bot-staging/google-cloud-tasks-v2beta2/.yardopts deleted file mode 100644 index 2480630b8f94..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Tasks V2beta2 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-tasks-v2beta2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks-v2beta2/AUTHENTICATION.md deleted file mode 100644 index 458865effa49..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-tasks-v2beta2 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-tasks-v2beta2 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/tasks/v2beta2" - -client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/tasks/v2beta2" - -::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::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-tasks-v2beta2 -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/tasks/v2beta2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::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-tasks-v2beta2/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks-v2beta2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-tasks-v2beta2/LICENSE.md b/owl-bot-staging/google-cloud-tasks-v2beta2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/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-tasks-v2beta2/README.md b/owl-bot-staging/google-cloud-tasks-v2beta2/README.md deleted file mode 100644 index 7161ac774944..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Tasks V2beta2 API - -Manages the execution of large numbers of distributed requests. - -Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. - -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 Tasks V2beta2 API. Most users should consider using -the main client gem, -[google-cloud-tasks](https://rubygems.org/gems/google-cloud-tasks). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-tasks-v2beta2 -``` - -## 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/cloudtasks.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/tasks/v2beta2" - -client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -request = ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new # (request fields as keyword arguments...) -response = client.list_queues request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/tasks) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/tasks/v2beta2" -require "logger" - -client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-tasks`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-tasks-v2beta2`. -_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-tasks`. -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-tasks-v2beta2`. - -### 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-tasks-v2beta2/Rakefile b/owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile deleted file mode 100644 index 29d824a23b8e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TASKS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TASKS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/tasks/v2beta2/cloud_tasks/credentials" - ::Google::Cloud::Tasks::V2beta2::CloudTasks::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TASKS_PROJECT"] = project - ENV["TASKS_TEST_PROJECT"] = project - ENV["TASKS_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-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-tasks-v2beta2" - header "google-cloud-tasks-v2beta2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-tasks-v2beta2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2 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-tasks-v2beta2/gapic_metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json deleted file mode 100644 index 61fb01febb7c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/gapic_metadata.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.tasks.v2beta2", - "libraryPackage": "::Google::Cloud::Tasks::V2beta2", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client", - "rpcs": { - "ListQueues": { - "methods": [ - "list_queues" - ] - }, - "GetQueue": { - "methods": [ - "get_queue" - ] - }, - "CreateQueue": { - "methods": [ - "create_queue" - ] - }, - "UpdateQueue": { - "methods": [ - "update_queue" - ] - }, - "DeleteQueue": { - "methods": [ - "delete_queue" - ] - }, - "PurgeQueue": { - "methods": [ - "purge_queue" - ] - }, - "PauseQueue": { - "methods": [ - "pause_queue" - ] - }, - "ResumeQueue": { - "methods": [ - "resume_queue" - ] - }, - "UploadQueueYaml": { - "methods": [ - "upload_queue_yaml" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "ListTasks": { - "methods": [ - "list_tasks" - ] - }, - "GetTask": { - "methods": [ - "get_task" - ] - }, - "CreateTask": { - "methods": [ - "create_task" - ] - }, - "DeleteTask": { - "methods": [ - "delete_task" - ] - }, - "LeaseTasks": { - "methods": [ - "lease_tasks" - ] - }, - "AcknowledgeTask": { - "methods": [ - "acknowledge_task" - ] - }, - "RenewLease": { - "methods": [ - "renew_lease" - ] - }, - "CancelLease": { - "methods": [ - "cancel_lease" - ] - }, - "RunTask": { - "methods": [ - "run_task" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec b/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec deleted file mode 100644 index 2cebbab90a64..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/google-cloud-tasks-v2beta2.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/tasks/v2beta2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-tasks-v2beta2" - gem.version = Google::Cloud::Tasks::V2beta2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details." - gem.summary = "Manages the execution of large numbers of distributed requests." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb deleted file mode 100644 index 3679450055ab..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google-cloud-tasks-v2beta2.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb deleted file mode 100644 index 154f4c62635d..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloud_tasks" -require "google/cloud/tasks/v2beta2/version" - -module Google - module Cloud - module Tasks - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/tasks/v2beta2" - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/tasks/v2beta2" - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - module V2beta2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2beta2", "_helpers.rb" -require "google/cloud/tasks/v2beta2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb deleted file mode 100644 index 2bf75edd4e89..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" - -module Google - module Cloud - module Tasks - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/tasks/v2beta2/rest" - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - module V2beta2 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Tasks"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2beta2/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb deleted file mode 100644 index fb7fda664c77..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/version" - -require "google/cloud/tasks/v2beta2/cloud_tasks/credentials" -require "google/cloud/tasks/v2beta2/cloud_tasks/paths" -require "google/cloud/tasks/v2beta2/cloud_tasks/client" -require "google/cloud/tasks/v2beta2/cloud_tasks/rest" - -module Google - module Cloud - module Tasks - module V2beta2 - ## - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/tasks/v2beta2/cloud_tasks" - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/tasks/v2beta2/cloud_tasks/rest" - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - module CloudTasks - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_tasks", "helpers.rb" -require "google/cloud/tasks/v2beta2/cloud_tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb deleted file mode 100644 index f69060cfe2e7..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/client.rb +++ /dev/null @@ -1,2936 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" -require "google/cloud/location" - -module Google - module Cloud - module Tasks - module V2beta2 - module CloudTasks - ## - # Client for the CloudTasks service. - # - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_tasks_stub - - ## - # Configure the CloudTasks Client class. - # - # See {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudTasks clients - # ::Google::Cloud::Tasks::V2beta2::CloudTasks::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", "Tasks", "V2beta2"] - 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.list_queues.timeout = 20.0 - default_config.rpcs.list_queues.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_queue.timeout = 20.0 - default_config.rpcs.get_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_queue.timeout = 20.0 - - default_config.rpcs.update_queue.timeout = 20.0 - - default_config.rpcs.delete_queue.timeout = 20.0 - default_config.rpcs.delete_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.purge_queue.timeout = 20.0 - - default_config.rpcs.pause_queue.timeout = 20.0 - - default_config.rpcs.resume_queue.timeout = 20.0 - - default_config.rpcs.upload_queue_yaml.timeout = 20.0 - - default_config.rpcs.get_iam_policy.timeout = 20.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 20.0 - - default_config.rpcs.test_iam_permissions.timeout = 20.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_tasks.timeout = 20.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_task.timeout = 20.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_task.timeout = 20.0 - - default_config.rpcs.delete_task.timeout = 20.0 - default_config.rpcs.delete_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.lease_tasks.timeout = 20.0 - - default_config.rpcs.acknowledge_task.timeout = 20.0 - - default_config.rpcs.renew_lease.timeout = 20.0 - - default_config.rpcs.cancel_lease.timeout = 20.0 - - default_config.rpcs.run_task.timeout = 20.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudTasks 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::Tasks::V2beta2::CloudTasks::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 - @cloud_tasks_stub.universe_domain - end - - ## - # Create a new CloudTasks client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudTasks 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/tasks/v2beta2/cloudtasks_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 - - @cloud_tasks_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Tasks::V2beta2::CloudTasks::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, - logger: @config.logger - ) - - @cloud_tasks_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_tasks_stub.endpoint - config.universe_domain = @cloud_tasks_stub.universe_domain - config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_tasks_stub.logger - end - - # Service calls - - ## - # Lists queues. - # - # Queues are returned in lexicographical order. - # - # @overload list_queues(request, options = nil) - # Pass arguments to `list_queues` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) - # Pass arguments to `list_queues` via keyword arguments. Note that at - # least one keyword argument is 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 location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @param filter [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2beta2::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "app_engine_http_target: *". - # - # Note that using filters might cause fewer queues than the - # requested_page size to be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues} method. It - # is an error to switch the value of the - # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#filter filter} while - # iterating through pages. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new - # - # # Call the list_queues method. - # result = client.list_queues 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::Tasks::V2beta2::Queue. - # p item - # end - # - def list_queues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest - - # Converts hash 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_queues.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::Tasks::V2beta2::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_queues.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_queues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a queue. - # - # @overload get_queue(request, options = nil) - # Pass arguments to `get_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::GetQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::GetQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) - # Pass arguments to `get_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new - # - # # Call the get_queue method. - # result = client.get_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def get_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload create_queue(request, options = nil) - # Pass arguments to `create_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::CreateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) - # Pass arguments to `create_queue` via keyword arguments. Note that at - # least one keyword argument is 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 location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - # an existing queue. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new - # - # # Call the create_queue method. - # result = client.create_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def create_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload update_queue(request, options = nil) - # Pass arguments to `update_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) - # Pass arguments to `update_queue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} must be - # specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} cannot be - # changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new - # - # # Call the update_queue method. - # result = client.update_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def update_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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.queue&.name - header_params["queue.name"] = request.queue.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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload delete_queue(request, options = nil) - # Pass arguments to `delete_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `delete_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new - # - # # Call the delete_queue method. - # result = client.delete_queue request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - # - # @overload purge_queue(request, options = nil) - # Pass arguments to `purge_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_queue(name: nil) - # Pass arguments to `purge_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new - # - # # Call the purge_queue method. - # result = client.purge_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def purge_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest - - # Converts hash 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.purge_queue.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::Tasks::V2beta2::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.purge_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can - # still be added when the queue is paused. A queue is paused if its - # {::Google::Cloud::Tasks::V2beta2::Queue#state state} is - # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. - # - # @overload pause_queue(request, options = nil) - # Pass arguments to `pause_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::PauseQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_queue(name: nil) - # Pass arguments to `pause_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new - # - # # Call the pause_queue method. - # result = client.pause_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def pause_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest - - # Converts hash 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.pause_queue.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::Tasks::V2beta2::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.pause_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a queue. - # - # This method resumes a queue after it has been - # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED} or - # {::Google::Cloud::Tasks::V2beta2::Queue::State::DISABLED DISABLED}. The state of a - # queue is stored in the queue's - # {::Google::Cloud::Tasks::V2beta2::Queue#state state}; after calling this method - # it will be set to - # {::Google::Cloud::Tasks::V2beta2::Queue::State::RUNNING RUNNING}. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - # - # @overload resume_queue(request, options = nil) - # Pass arguments to `resume_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_queue(name: nil) - # Pass arguments to `resume_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new - # - # # Call the resume_queue method. - # result = client.resume_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def resume_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest - - # Converts hash 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.resume_queue.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::Tasks::V2beta2::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.resume_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Update queue list by uploading a queue.yaml file. - # - # The queue.yaml file is supplied in the request body as a YAML encoded - # string. This method was added to support gcloud clients versions before - # 322.0.0. New clients should use CreateQueue instead of this method. - # - # @overload upload_queue_yaml(request, options = nil) - # Pass arguments to `upload_queue_yaml` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload upload_queue_yaml(app_id: nil, http_body: nil) - # Pass arguments to `upload_queue_yaml` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param app_id [::String] - # Required. The App ID is supplied as an HTTP parameter. Unlike internal - # usage of App ID, it does not include a region prefix. Rather, the App ID - # represents the Project ID against which to make the request. - # @param http_body [::Google::Api::HttpBody, ::Hash] - # The http body contains the queue.yaml file which used to update queue lists - # - # @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/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new - # - # # Call the upload_queue_yaml method. - # result = client.upload_queue_yaml request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def upload_queue_yaml request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest - - # Converts hash 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.upload_queue_yaml.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::Tasks::V2beta2::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.upload_queue_yaml.timeout, - metadata: metadata, - retry_policy: @config.rpcs.upload_queue_yaml.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :upload_queue_yaml, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a - # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Returns an empty policy if the - # resource exists and does not have a policy set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_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::Tasks::V2beta2::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.resource - header_params["resource"] = request.resource - 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_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy for a - # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_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::Tasks::V2beta2::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.resource - header_params["resource"] = request.resource - 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.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on a - # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. If the resource does not exist, - # this will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Tasks::V2beta2::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.resource - header_params["resource"] = request.resource - 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.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the tasks in a queue. - # - # By default, only the {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC} - # view is retrieved due to performance considerations; - # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest#response_view response_view} - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @param page_size [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks 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::Tasks::V2beta2::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListTasksRequest - - # Converts hash 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_tasks.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::Tasks::V2beta2::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_tasks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * For {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, - # the maximum task size is - # 100KB. - # * For {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}, the maximum - # task size is 1MB. - # - # @overload create_task(request, options = nil) - # Pass arguments to `create_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::CreateTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) - # Pass arguments to `create_task` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task [::Google::Cloud::Tasks::V2beta2::Task, ::Hash] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2beta2::Task#name name}. If a name is not specified - # then the system will generate a random unique task id, which will be set in - # the task returned in the {::Google::Cloud::Tasks::V2beta2::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} is not - # set or is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or completed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1 hour after the original task was - # deleted or completed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9 days after the original task was deleted or completed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new - # - # # Call the create_task method. - # result = client.create_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def create_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has completed successfully or permanently - # failed. - # - # @overload delete_task(request, options = nil) - # Pass arguments to `delete_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil) - # Pass arguments to `delete_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new - # - # # Call the delete_task method. - # result = client.delete_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Leases tasks from a pull queue for - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration}. - # - # This method is invoked by the worker to obtain a lease. The - # worker must acknowledge the task via - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask} - # after they have performed the work associated with the task. - # - # The {::Google::Cloud::Tasks::V2beta2::PullMessage#payload payload} is intended - # to store data that the worker needs to perform the work associated with the - # task. To return the payloads in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response}, set - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#response_view response_view} - # to {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL}. - # - # A maximum of 10 qps of - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} requests are - # allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - # is returned when this limit is - # exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - # is also returned when - # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second} - # is exceeded. - # - # @overload lease_tasks(request, options = nil) - # Pass arguments to `lease_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload lease_tasks(parent: nil, max_tasks: nil, lease_duration: nil, response_view: nil, filter: nil) - # Pass arguments to `lease_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param max_tasks [::Integer] - # The maximum number of tasks to lease. - # - # The system will make a best effort to return as close to as - # `max_tasks` as possible. - # - # The largest that `max_tasks` can be is 1000. - # - # The maximum total size of a [lease tasks - # response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - # sum of all task sizes requested reaches this limit, fewer tasks than - # requested are returned. - # @param lease_duration [::Google::Protobuf::Duration, ::Hash] - # Required. The duration of the lease. - # - # Each task returned in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will have its - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} set to the - # current time plus the `lease_duration`. The task is leased until its - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}; thus, the - # task will not be returned to another - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call before - # its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # - # - # After the worker has successfully finished the work associated - # with the task, the worker must call via - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask} - # before the {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # Otherwise the task will be returned to a later - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call so that - # another worker can retry it. - # - # The maximum lease duration is 1 week. - # `lease_duration` will be truncated to the nearest second. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @param filter [::String] - # `filter` can be used to specify a subset of tasks to lease. - # - # When `filter` is set to `tag=` then the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will contain only - # tasks whose {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} is equal to - # ``. `` must be less than 500 characters. - # - # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - # the same tag as the task with the oldest - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be - # returned. - # - # Grammar Syntax: - # - # * `filter = "tag=" tag | "tag_function=" function` - # - # * `tag = string` - # - # * `function = "oldest_tag()"` - # - # The `oldest_tag()` function returns tasks which have the same tag as the - # oldest task (ordered by schedule time). - # - # SDK compatibility: Although the SDK allows tags to be either - # string or - # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - # aren't UTF-8 encoded can't be used in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter} and the - # task's {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} will be displayed - # as empty in Cloud Tasks. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new - # - # # Call the lease_tasks method. - # result = client.lease_tasks request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. - # p result - # - def lease_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest - - # Converts hash 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.lease_tasks.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::Tasks::V2beta2::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.lease_tasks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.lease_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :lease_tasks, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Acknowledges a pull task. - # - # The worker, that is, the entity that - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks leased} this task must - # call this method to indicate that the work associated with the task has - # finished. - # - # The worker must acknowledge a task within the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration} - # or the lease will expire and the task will become available to be leased - # again. After the task is acknowledged, it will not be returned - # by a later {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}, - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task GetTask}, or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks}. - # - # @overload acknowledge_task(request, options = nil) - # Pass arguments to `acknowledge_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload acknowledge_task(name: nil, schedule_time: nil) - # Pass arguments to `acknowledge_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # - # @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/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new - # - # # Call the acknowledge_task method. - # result = client.acknowledge_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def acknowledge_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest - - # Converts hash 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.acknowledge_task.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::Tasks::V2beta2::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.acknowledge_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.acknowledge_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :acknowledge_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Renew the current lease of a pull task. - # - # The worker can use this method to extend the lease by a new - # duration, starting from now. The new task lease will be - # returned in the task's - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # - # @overload renew_lease(request, options = nil) - # Pass arguments to `renew_lease` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload renew_lease(name: nil, schedule_time: nil, lease_duration: nil, response_view: nil) - # Pass arguments to `renew_lease` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # @param lease_duration [::Google::Protobuf::Duration, ::Hash] - # Required. The desired new lease duration, starting from now. - # - # - # The maximum lease duration is 1 week. - # `lease_duration` will be truncated to the nearest second. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new - # - # # Call the renew_lease method. - # result = client.renew_lease request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def renew_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest - - # Converts hash 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.renew_lease.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::Tasks::V2beta2::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.renew_lease.timeout, - metadata: metadata, - retry_policy: @config.rpcs.renew_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :renew_lease, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Cancel a pull task's lease. - # - # The worker can use this method to cancel a task's lease by - # setting its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} - # to now. This will make the task available to be leased to the next caller - # of {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}. - # - # @overload cancel_lease(request, options = nil) - # Pass arguments to `cancel_lease` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_lease(name: nil, schedule_time: nil, response_view: nil) - # Pass arguments to `cancel_lease` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new - # - # # Call the cancel_lease method. - # result = client.cancel_lease request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def cancel_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest - - # Converts hash 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_lease.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::Tasks::V2beta2::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_lease.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :cancel_lease, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # {::Google::Cloud::Tasks::V2beta2::RateLimits RateLimits} or is - # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. - # - # This command is meant to be used for manual debugging. For - # example, {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} can be - # used to retry a failed task after a fix has been made or to manually force - # a task to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the {::Google::Cloud::Tasks::V2beta2::Task#status status} after the - # task is dispatched but before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be - # reset to the time that - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} was called plus - # the retry delay specified in the queue's - # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig}. - # - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - # - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask} cannot be called - # on a {::Google::Cloud::Tasks::V2beta2::PullMessage pull task}. - # - # @overload run_task(request, options = nil) - # Pass arguments to `run_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::RunTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::RunTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_task(name: nil, response_view: nil) - # Pass arguments to `run_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new - # - # # Call the run_task method. - # result = client.run_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def run_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RunTaskRequest - - # Converts hash 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.run_task.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::Tasks::V2beta2::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.run_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudTasks API. - # - # This class represents the configuration for CloudTasks, - # 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::Tasks::V2beta2::CloudTasks::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_queues to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CloudTasks 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_queues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_queues - ## - # RPC-specific configuration for `get_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_queue - ## - # RPC-specific configuration for `create_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_queue - ## - # RPC-specific configuration for `update_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_queue - ## - # RPC-specific configuration for `delete_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_queue - ## - # RPC-specific configuration for `purge_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_queue - ## - # RPC-specific configuration for `pause_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_queue - ## - # RPC-specific configuration for `resume_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_queue - ## - # RPC-specific configuration for `upload_queue_yaml` - # @return [::Gapic::Config::Method] - # - attr_reader :upload_queue_yaml - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `create_task` - # @return [::Gapic::Config::Method] - # - attr_reader :create_task - ## - # RPC-specific configuration for `delete_task` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_task - ## - # RPC-specific configuration for `lease_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :lease_tasks - ## - # RPC-specific configuration for `acknowledge_task` - # @return [::Gapic::Config::Method] - # - attr_reader :acknowledge_task - ## - # RPC-specific configuration for `renew_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :renew_lease - ## - # RPC-specific configuration for `cancel_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_lease - ## - # RPC-specific configuration for `run_task` - # @return [::Gapic::Config::Method] - # - attr_reader :run_task - - # @private - def initialize parent_rpcs = nil - list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues - @list_queues = ::Gapic::Config::Method.new list_queues_config - get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue - @get_queue = ::Gapic::Config::Method.new get_queue_config - create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue - @create_queue = ::Gapic::Config::Method.new create_queue_config - update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue - @update_queue = ::Gapic::Config::Method.new update_queue_config - delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue - @delete_queue = ::Gapic::Config::Method.new delete_queue_config - purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue - @purge_queue = ::Gapic::Config::Method.new purge_queue_config - pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue - @pause_queue = ::Gapic::Config::Method.new pause_queue_config - resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue - @resume_queue = ::Gapic::Config::Method.new resume_queue_config - upload_queue_yaml_config = parent_rpcs.upload_queue_yaml if parent_rpcs.respond_to? :upload_queue_yaml - @upload_queue_yaml = ::Gapic::Config::Method.new upload_queue_yaml_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task - @create_task = ::Gapic::Config::Method.new create_task_config - delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task - @delete_task = ::Gapic::Config::Method.new delete_task_config - lease_tasks_config = parent_rpcs.lease_tasks if parent_rpcs.respond_to? :lease_tasks - @lease_tasks = ::Gapic::Config::Method.new lease_tasks_config - acknowledge_task_config = parent_rpcs.acknowledge_task if parent_rpcs.respond_to? :acknowledge_task - @acknowledge_task = ::Gapic::Config::Method.new acknowledge_task_config - renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease - @renew_lease = ::Gapic::Config::Method.new renew_lease_config - cancel_lease_config = parent_rpcs.cancel_lease if parent_rpcs.respond_to? :cancel_lease - @cancel_lease = ::Gapic::Config::Method.new cancel_lease_config - run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task - @run_task = ::Gapic::Config::Method.new run_task_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb deleted file mode 100644 index 6851ba771f0a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta2 - module CloudTasks - # Credentials for the CloudTasks API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "TASKS_CREDENTIALS", - "TASKS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TASKS_CREDENTIALS_JSON", - "TASKS_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-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb deleted file mode 100644 index aa8084ac1821..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/paths.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta2 - module CloudTasks - # Path helper methods for the CloudTasks 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 Queue resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/queues/{queue}` - # - # @param project [String] - # @param location [String] - # @param queue [String] - # - # @return [::String] - def queue_path project:, location:, queue: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/queues/#{queue}" - end - - ## - # Create a fully-qualified Task resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/queues/{queue}/tasks/{task}` - # - # @param project [String] - # @param location [String] - # @param queue [String] - # @param task [String] - # - # @return [::String] - def task_path project:, location:, queue:, task: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "queue cannot contain /" if queue.to_s.include? "/" - - "projects/#{project}/locations/#{location}/queues/#{queue}/tasks/#{task}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb deleted file mode 100644 index 0813806ca563..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/version" -require "google/cloud/tasks/v2beta2/bindings_override" - -require "google/cloud/tasks/v2beta2/cloud_tasks/credentials" -require "google/cloud/tasks/v2beta2/cloud_tasks/paths" -require "google/cloud/tasks/v2beta2/cloud_tasks/rest/client" - -module Google - module Cloud - module Tasks - module V2beta2 - ## - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/tasks/v2beta2/cloud_tasks/rest" - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - module CloudTasks - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/tasks/v2beta2/cloud_tasks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb deleted file mode 100644 index 559c626e3aed..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/client.rb +++ /dev/null @@ -1,2667 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" -require "google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Tasks - module V2beta2 - module CloudTasks - module Rest - ## - # REST client for the CloudTasks service. - # - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_tasks_stub - - ## - # Configure the CloudTasks Client class. - # - # See {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudTasks clients - # ::Google::Cloud::Tasks::V2beta2::CloudTasks::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", "Tasks", "V2beta2"] - 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.list_queues.timeout = 20.0 - default_config.rpcs.list_queues.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_queue.timeout = 20.0 - default_config.rpcs.get_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_queue.timeout = 20.0 - - default_config.rpcs.update_queue.timeout = 20.0 - - default_config.rpcs.delete_queue.timeout = 20.0 - default_config.rpcs.delete_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.purge_queue.timeout = 20.0 - - default_config.rpcs.pause_queue.timeout = 20.0 - - default_config.rpcs.resume_queue.timeout = 20.0 - - default_config.rpcs.get_iam_policy.timeout = 20.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.set_iam_policy.timeout = 20.0 - - default_config.rpcs.test_iam_permissions.timeout = 20.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_tasks.timeout = 20.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_task.timeout = 20.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_task.timeout = 20.0 - - default_config.rpcs.delete_task.timeout = 20.0 - default_config.rpcs.delete_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.lease_tasks.timeout = 20.0 - - default_config.rpcs.acknowledge_task.timeout = 20.0 - - default_config.rpcs.renew_lease.timeout = 20.0 - - default_config.rpcs.cancel_lease.timeout = 20.0 - - default_config.rpcs.run_task.timeout = 20.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudTasks 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::Tasks::V2beta2::CloudTasks::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 - @cloud_tasks_stub.universe_domain - end - - ## - # Create a new CloudTasks REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudTasks 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 - - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_tasks_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_tasks_stub.endpoint - config.universe_domain = @cloud_tasks_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_tasks_stub.logger - end - - # Service calls - - ## - # Lists queues. - # - # Queues are returned in lexicographical order. - # - # @overload list_queues(request, options = nil) - # Pass arguments to `list_queues` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) - # Pass arguments to `list_queues` via keyword arguments. Note that at - # least one keyword argument is 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 location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @param filter [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2beta2::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "app_engine_http_target: *". - # - # Note that using filters might cause fewer queues than the - # requested_page size to be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#list_queues ListQueues} method. It - # is an error to switch the value of the - # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#filter filter} while - # iterating through pages. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Queue>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new - # - # # Call the list_queues method. - # result = client.list_queues 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::Tasks::V2beta2::Queue. - # p item - # end - # - def list_queues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest - - # Converts hash 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_queues.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::Tasks::V2beta2::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_queues.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_queues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.list_queues request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a queue. - # - # @overload get_queue(request, options = nil) - # Pass arguments to `get_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::GetQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::GetQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) - # Pass arguments to `get_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new - # - # # Call the get_queue method. - # result = client.get_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def get_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload create_queue(request, options = nil) - # Pass arguments to `create_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::CreateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) - # Pass arguments to `create_queue` via keyword arguments. Note that at - # least one keyword argument is 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 location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - # an existing queue. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new - # - # # Call the create_queue method. - # result = client.create_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def create_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.create_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload update_queue(request, options = nil) - # Pass arguments to `update_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) - # Pass arguments to `update_queue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param queue [::Google::Cloud::Tasks::V2beta2::Queue, ::Hash] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} must be - # specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} cannot be - # changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new - # - # # Call the update_queue method. - # result = client.update_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def update_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.update_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload delete_queue(request, options = nil) - # Pass arguments to `delete_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `delete_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new - # - # # Call the delete_queue method. - # result = client.delete_queue request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta2::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.delete_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - # - # @overload purge_queue(request, options = nil) - # Pass arguments to `purge_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_queue(name: nil) - # Pass arguments to `purge_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new - # - # # Call the purge_queue method. - # result = client.purge_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def purge_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest - - # Converts hash 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.purge_queue.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::Tasks::V2beta2::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.purge_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.purge_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can - # still be added when the queue is paused. A queue is paused if its - # {::Google::Cloud::Tasks::V2beta2::Queue#state state} is - # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. - # - # @overload pause_queue(request, options = nil) - # Pass arguments to `pause_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::PauseQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_queue(name: nil) - # Pass arguments to `pause_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new - # - # # Call the pause_queue method. - # result = client.pause_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def pause_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest - - # Converts hash 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.pause_queue.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::Tasks::V2beta2::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.pause_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.pause_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a queue. - # - # This method resumes a queue after it has been - # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED} or - # {::Google::Cloud::Tasks::V2beta2::Queue::State::DISABLED DISABLED}. The state of a - # queue is stored in the queue's - # {::Google::Cloud::Tasks::V2beta2::Queue#state state}; after calling this method - # it will be set to - # {::Google::Cloud::Tasks::V2beta2::Queue::State::RUNNING RUNNING}. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - # - # @overload resume_queue(request, options = nil) - # Pass arguments to `resume_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_queue(name: nil) - # Pass arguments to `resume_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new - # - # # Call the resume_queue method. - # result = client.resume_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - # p result - # - def resume_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest - - # Converts hash 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.resume_queue.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::Tasks::V2beta2::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.resume_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.resume_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a - # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Returns an empty policy if the - # resource exists and does not have a policy set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_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::Tasks::V2beta2::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_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy for a - # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_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::Tasks::V2beta2::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.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on a - # {::Google::Cloud::Tasks::V2beta2::Queue Queue}. If the resource does not exist, - # this will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Tasks::V2beta2::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.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the tasks in a queue. - # - # By default, only the {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC} - # view is retrieved due to performance considerations; - # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest#response_view response_view} - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @param page_size [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta2::Task>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks 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::Tasks::V2beta2::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::ListTasksRequest - - # Converts hash 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_tasks.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::Tasks::V2beta2::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_tasks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.list_tasks request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::GetTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * For {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, - # the maximum task size is - # 100KB. - # * For {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues}, the maximum - # task size is 1MB. - # - # @overload create_task(request, options = nil) - # Pass arguments to `create_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::CreateTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) - # Pass arguments to `create_task` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task [::Google::Cloud::Tasks::V2beta2::Task, ::Hash] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2beta2::Task#name name}. If a name is not specified - # then the system will generate a random unique task id, which will be set in - # the task returned in the {::Google::Cloud::Tasks::V2beta2::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} is not - # set or is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or completed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1 hour after the original task was - # deleted or completed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9 days after the original task was deleted or completed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new - # - # # Call the create_task method. - # result = client.create_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def create_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.create_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has completed successfully or permanently - # failed. - # - # @overload delete_task(request, options = nil) - # Pass arguments to `delete_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil) - # Pass arguments to `delete_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new - # - # # Call the delete_task method. - # result = client.delete_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta2::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.delete_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Leases tasks from a pull queue for - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration}. - # - # This method is invoked by the worker to obtain a lease. The - # worker must acknowledge the task via - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#acknowledge_task AcknowledgeTask} - # after they have performed the work associated with the task. - # - # The {::Google::Cloud::Tasks::V2beta2::PullMessage#payload payload} is intended - # to store data that the worker needs to perform the work associated with the - # task. To return the payloads in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response}, set - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#response_view response_view} - # to {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL}. - # - # A maximum of 10 qps of - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} requests are - # allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - # is returned when this limit is - # exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - # is also returned when - # {::Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second} - # is exceeded. - # - # @overload lease_tasks(request, options = nil) - # Pass arguments to `lease_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload lease_tasks(parent: nil, max_tasks: nil, lease_duration: nil, response_view: nil, filter: nil) - # Pass arguments to `lease_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param max_tasks [::Integer] - # The maximum number of tasks to lease. - # - # The system will make a best effort to return as close to as - # `max_tasks` as possible. - # - # The largest that `max_tasks` can be is 1000. - # - # The maximum total size of a [lease tasks - # response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - # sum of all task sizes requested reaches this limit, fewer tasks than - # requested are returned. - # @param lease_duration [::Google::Protobuf::Duration, ::Hash] - # Required. The duration of the lease. - # - # Each task returned in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will have its - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} set to the - # current time plus the `lease_duration`. The task is leased until its - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}; thus, the - # task will not be returned to another - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} call before - # its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # - # - # After the worker has successfully finished the work associated - # with the task, the worker must call via - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#acknowledge_task AcknowledgeTask} - # before the {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # Otherwise the task will be returned to a later - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} call so that - # another worker can retry it. - # - # The maximum lease duration is 1 week. - # `lease_duration` will be truncated to the nearest second. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @param filter [::String] - # `filter` can be used to specify a subset of tasks to lease. - # - # When `filter` is set to `tag=` then the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will contain only - # tasks whose {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} is equal to - # ``. `` must be less than 500 characters. - # - # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - # the same tag as the task with the oldest - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be - # returned. - # - # Grammar Syntax: - # - # * `filter = "tag=" tag | "tag_function=" function` - # - # * `tag = string` - # - # * `function = "oldest_tag()"` - # - # The `oldest_tag()` function returns tasks which have the same tag as the - # oldest task (ordered by schedule time). - # - # SDK compatibility: Although the SDK allows tags to be either - # string or - # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - # aren't UTF-8 encoded can't be used in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter} and the - # task's {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} will be displayed - # as empty in Cloud Tasks. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new - # - # # Call the lease_tasks method. - # result = client.lease_tasks request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. - # p result - # - def lease_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest - - # Converts hash 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.lease_tasks.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::Tasks::V2beta2::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.lease_tasks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.lease_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.lease_tasks request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Acknowledges a pull task. - # - # The worker, that is, the entity that - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks leased} this task must - # call this method to indicate that the work associated with the task has - # finished. - # - # The worker must acknowledge a task within the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration} - # or the lease will expire and the task will become available to be leased - # again. After the task is acknowledged, it will not be returned - # by a later {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks}, - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#get_task GetTask}, or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#list_tasks ListTasks}. - # - # @overload acknowledge_task(request, options = nil) - # Pass arguments to `acknowledge_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload acknowledge_task(name: nil, schedule_time: nil) - # Pass arguments to `acknowledge_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # @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/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new - # - # # Call the acknowledge_task method. - # result = client.acknowledge_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def acknowledge_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest - - # Converts hash 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.acknowledge_task.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::Tasks::V2beta2::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.acknowledge_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.acknowledge_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.acknowledge_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Renew the current lease of a pull task. - # - # The worker can use this method to extend the lease by a new - # duration, starting from now. The new task lease will be - # returned in the task's - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # - # @overload renew_lease(request, options = nil) - # Pass arguments to `renew_lease` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload renew_lease(name: nil, schedule_time: nil, lease_duration: nil, response_view: nil) - # Pass arguments to `renew_lease` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # @param lease_duration [::Google::Protobuf::Duration, ::Hash] - # Required. The desired new lease duration, starting from now. - # - # - # The maximum lease duration is 1 week. - # `lease_duration` will be truncated to the nearest second. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new - # - # # Call the renew_lease method. - # result = client.renew_lease request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def renew_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest - - # Converts hash 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.renew_lease.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::Tasks::V2beta2::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.renew_lease.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.renew_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.renew_lease request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Cancel a pull task's lease. - # - # The worker can use this method to cancel a task's lease by - # setting its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} - # to now. This will make the task available to be leased to the next caller - # of {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks}. - # - # @overload cancel_lease(request, options = nil) - # Pass arguments to `cancel_lease` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_lease(name: nil, schedule_time: nil, response_view: nil) - # Pass arguments to `cancel_lease` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new - # - # # Call the cancel_lease method. - # result = client.cancel_lease request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def cancel_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest - - # Converts hash 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_lease.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::Tasks::V2beta2::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_lease.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.cancel_lease request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # {::Google::Cloud::Tasks::V2beta2::RateLimits RateLimits} or is - # {::Google::Cloud::Tasks::V2beta2::Queue::State::PAUSED PAUSED}. - # - # This command is meant to be used for manual debugging. For - # example, {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} can be - # used to retry a failed task after a fix has been made or to manually force - # a task to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the {::Google::Cloud::Tasks::V2beta2::Task#status status} after the - # task is dispatched but before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be - # reset to the time that - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} was called plus - # the retry delay specified in the queue's - # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig}. - # - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - # - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client#run_task RunTask} cannot be called - # on a {::Google::Cloud::Tasks::V2beta2::PullMessage pull task}. - # - # @overload run_task(request, options = nil) - # Pass arguments to `run_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta2::RunTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta2::RunTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_task(name: nil, response_view: nil) - # Pass arguments to `run_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new - # - # # Call the run_task method. - # result = client.run_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - # p result - # - def run_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta2::RunTaskRequest - - # Converts hash 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.run_task.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::Tasks::V2beta2::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.run_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.run_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudTasks REST API. - # - # This class represents the configuration for CloudTasks 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::Tasks::V2beta2::CloudTasks::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_queues to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CloudTasks 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_queues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_queues - ## - # RPC-specific configuration for `get_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_queue - ## - # RPC-specific configuration for `create_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_queue - ## - # RPC-specific configuration for `update_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_queue - ## - # RPC-specific configuration for `delete_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_queue - ## - # RPC-specific configuration for `purge_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_queue - ## - # RPC-specific configuration for `pause_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_queue - ## - # RPC-specific configuration for `resume_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_queue - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `create_task` - # @return [::Gapic::Config::Method] - # - attr_reader :create_task - ## - # RPC-specific configuration for `delete_task` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_task - ## - # RPC-specific configuration for `lease_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :lease_tasks - ## - # RPC-specific configuration for `acknowledge_task` - # @return [::Gapic::Config::Method] - # - attr_reader :acknowledge_task - ## - # RPC-specific configuration for `renew_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :renew_lease - ## - # RPC-specific configuration for `cancel_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_lease - ## - # RPC-specific configuration for `run_task` - # @return [::Gapic::Config::Method] - # - attr_reader :run_task - - # @private - def initialize parent_rpcs = nil - list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues - @list_queues = ::Gapic::Config::Method.new list_queues_config - get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue - @get_queue = ::Gapic::Config::Method.new get_queue_config - create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue - @create_queue = ::Gapic::Config::Method.new create_queue_config - update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue - @update_queue = ::Gapic::Config::Method.new update_queue_config - delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue - @delete_queue = ::Gapic::Config::Method.new delete_queue_config - purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue - @purge_queue = ::Gapic::Config::Method.new purge_queue_config - pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue - @pause_queue = ::Gapic::Config::Method.new pause_queue_config - resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue - @resume_queue = ::Gapic::Config::Method.new resume_queue_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task - @create_task = ::Gapic::Config::Method.new create_task_config - delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task - @delete_task = ::Gapic::Config::Method.new delete_task_config - lease_tasks_config = parent_rpcs.lease_tasks if parent_rpcs.respond_to? :lease_tasks - @lease_tasks = ::Gapic::Config::Method.new lease_tasks_config - acknowledge_task_config = parent_rpcs.acknowledge_task if parent_rpcs.respond_to? :acknowledge_task - @acknowledge_task = ::Gapic::Config::Method.new acknowledge_task_config - renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease - @renew_lease = ::Gapic::Config::Method.new renew_lease_config - cancel_lease_config = parent_rpcs.cancel_lease if parent_rpcs.respond_to? :cancel_lease - @cancel_lease = ::Gapic::Config::Method.new cancel_lease_config - run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task - @run_task = ::Gapic::Config::Method.new run_task_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb deleted file mode 100644 index f7a7c052bb3f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloud_tasks/rest/service_stub.rb +++ /dev/null @@ -1,1315 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" - -module Google - module Cloud - module Tasks - module V2beta2 - module CloudTasks - module Rest - ## - # REST service stub for the CloudTasks service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_queues REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest] - # 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::Tasks::V2beta2::ListQueuesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::ListQueuesResponse] - # A result object deserialized from the server's reply - def list_queues request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_queues_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, - method_name: "list_queues", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetQueueRequest] - # 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::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # A result object deserialized from the server's reply - def get_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_queue_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, - method_name: "get_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest] - # 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::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # A result object deserialized from the server's reply - def create_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_queue_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, - method_name: "create_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest] - # 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::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # A result object deserialized from the server's reply - def update_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_queue_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, - method_name: "update_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest] - # 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_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_queue_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, - method_name: "delete_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest] - # 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::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # A result object deserialized from the server's reply - def purge_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_queue_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, - method_name: "purge_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the pause_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest] - # 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::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # A result object deserialized from the server's reply - def pause_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_queue_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, - method_name: "pause_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the resume_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest] - # 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::Tasks::V2beta2::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # A result object deserialized from the server's reply - def resume_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_queue_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, - method_name: "resume_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_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, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_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, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # 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::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListTasksRequest] - # 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::Tasks::V2beta2::ListTasksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::ListTasksResponse] - # A result object deserialized from the server's reply - def list_tasks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_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, - method_name: "list_tasks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetTaskRequest] - # 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::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # A result object deserialized from the server's reply - def get_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_task_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, - method_name: "get_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest] - # 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::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # A result object deserialized from the server's reply - def create_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_task_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, - method_name: "create_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest] - # 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_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_task_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, - method_name: "delete_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the lease_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest] - # 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::Tasks::V2beta2::LeaseTasksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse] - # A result object deserialized from the server's reply - def lease_tasks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_lease_tasks_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, - method_name: "lease_tasks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the acknowledge_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest] - # 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 acknowledge_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_acknowledge_task_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, - method_name: "acknowledge_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the renew_lease REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest] - # 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::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # A result object deserialized from the server's reply - def renew_lease request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_renew_lease_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, - method_name: "renew_lease", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the cancel_lease REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest] - # 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::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # A result object deserialized from the server's reply - def cancel_lease request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_lease_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, - method_name: "cancel_lease", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::RunTaskRequest] - # 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::Tasks::V2beta2::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # A result object deserialized from the server's reply - def run_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_task_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, - method_name: "run_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta2::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_queues REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListQueuesRequest] - # 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_queues_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta2/{parent}/queues", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{parent}/queues", - body: "queue", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2beta2/{queue.name}", - body: "queue", - matches: [ - ["queue.name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{name}:purge", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::PauseQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::ListTasksRequest] - # 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_tasks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta2/{parent}/tasks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::GetTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::CreateTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{parent}/tasks", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2beta2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the lease_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_lease_tasks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{parent}/tasks:lease", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the acknowledge_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_acknowledge_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{name}:acknowledge", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the renew_lease REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_renew_lease_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{name}:renewLease", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_lease REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest] - # 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_lease_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{name}:cancelLease", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta2::RunTaskRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta2/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb deleted file mode 100644 index 8b4aa633aa01..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta2/cloudtasks.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/httpbody_pb' -require 'google/api/resource_pb' -require 'google/cloud/tasks/v2beta2/queue_pb' -require 'google/cloud/tasks/v2beta2/task_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n+google/cloud/tasks/v2beta2/cloudtasks.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/httpbody.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/tasks/v2beta2/queue.proto\x1a%google/cloud/tasks/v2beta2/task.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x01\n\x11ListQueuesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"`\n\x12ListQueuesResponse\x12\x31\n\x06queues\x18\x01 \x03(\x0b\x32!.google.cloud.tasks.v2beta2.Queue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"|\n\x0fGetQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x32\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x84\x01\n\x12\x43reateQueueRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x35\n\x05queue\x18\x02 \x01(\x0b\x32!.google.cloud.tasks.v2beta2.QueueB\x03\xe0\x41\x02\"|\n\x12UpdateQueueRequest\x12\x35\n\x05queue\x18\x01 \x01(\x0b\x32!.google.cloud.tasks.v2beta2.QueueB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PurgeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PauseQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"K\n\x12ResumeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"i\n\x16UploadQueueYamlRequest\x12\x13\n\x06\x61pp_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12,\n\thttp_body\x18\x02 \x01(\x0b\x32\x14.google.api.HttpBodyH\x00\x88\x01\x01\x42\x0c\n\n_http_body\"\xaf\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"]\n\x11ListTasksResponse\x12/\n\x05tasks\x18\x01 \x03(\x0b\x32 .google.cloud.tasks.v2beta2.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x84\x01\n\x0eGetTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"\xbe\x01\n\x11\x43reateTaskRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x33\n\x04task\x18\x02 \x01(\x0b\x32 .google.cloud.tasks.v2beta2.TaskB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x03 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"I\n\x11\x44\x65leteTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\"\xe4\x01\n\x11LeaseTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x11\n\tmax_tasks\x18\x02 \x01(\x05\x12\x36\n\x0elease_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x04 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\"E\n\x12LeaseTasksResponse\x12/\n\x05tasks\x18\x01 \x03(\x0b\x32 .google.cloud.tasks.v2beta2.Task\"\x86\x01\n\x16\x41\x63knowledgeTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x36\n\rschedule_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\xf7\x01\n\x11RenewLeaseRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x36\n\rschedule_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x36\n\x0elease_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x04 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"\xc0\x01\n\x12\x43\x61ncelLeaseRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12\x36\n\rschedule_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x03 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"\x84\x01\n\x0eRunTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View2\xb5\x1d\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta2.ListQueuesRequest\x1a..google.cloud.tasks.v2beta2.ListQueuesResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{parent=projects/*/locations/*}/queues\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta2.GetQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2beta2/{name=projects/*/locations/*/queues/*}\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta2.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"M\xda\x41\x0cparent,queue\x82\xd3\xe4\x93\x02\x38\"//v2beta2/{parent=projects/*/locations/*}/queues:\x05queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta2.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"X\xda\x41\x11queue,update_mask\x82\xd3\xe4\x93\x02>25/v2beta2/{queue.name=projects/*/locations/*/queues/*}:\x05queue\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta2.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2beta2/{name=projects/*/locations/*/queues/*}\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta2.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:purge:\x01*\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta2.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta2/{name=projects/*/locations/*/queues/*}:pause:\x01*\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta2.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta2.Queue\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v2beta2/{name=projects/*/locations/*/queues/*}:resume:\x01*\x12_\n\x0fUploadQueueYaml\x12\x32.google.cloud.tasks.v2beta2.UploadQueueYamlRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\xa1\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"V\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x45\"@/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02K\"F/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta2.ListTasksRequest\x1a-.google.cloud.tasks.v2beta2.ListTasksResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta2.GetTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta2.CreateTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"P\xda\x41\x0bparent,task\x82\xd3\xe4\x93\x02<\"7/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta2.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xcd\x01\n\nLeaseTasks\x12-.google.cloud.tasks.v2beta2.LeaseTasksRequest\x1a..google.cloud.tasks.v2beta2.LeaseTasksResponse\"`\xda\x41\x15parent,lease_duration\x82\xd3\xe4\x93\x02\x42\"=/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease:\x01*\x12\xc2\x01\n\x0f\x41\x63knowledgeTask\x12\x32.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest\x1a\x16.google.protobuf.Empty\"c\xda\x41\x12name,schedule_time\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge:\x01*\x12\xd0\x01\n\nRenewLease\x12-.google.cloud.tasks.v2beta2.RenewLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"q\xda\x41!name,schedule_time,lease_duration\x82\xd3\xe4\x93\x02G\"B/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease:\x01*\x12\xc4\x01\n\x0b\x43\x61ncelLease\x12..google.cloud.tasks.v2beta2.CancelLeaseRequest\x1a .google.cloud.tasks.v2beta2.Task\"c\xda\x41\x12name,schedule_time\x82\xd3\xe4\x93\x02H\"C/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease:\x01*\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta2.RunTaskRequest\x1a .google.cloud.tasks.v2beta2.Task\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\x1aM\xca\x41\x19\x63loudtasks.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd0\x01\n\x1e\x63om.google.cloud.tasks.v2beta2B\x0f\x43loudTasksProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspb\xa2\x02\x05TASKS\xea\x41M\n\"cloudtasks.googleapis.com/Location\x12\'projects/{project}/locations/{location}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.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.tasks.v2beta2.Queue", "google/cloud/tasks/v2beta2/queue.proto"], - ["google.api.HttpBody", "google/api/httpbody.proto"], - ["google.cloud.tasks.v2beta2.Task", "google/cloud/tasks/v2beta2/task.proto"], - ["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 Tasks - module V2beta2 - ListQueuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListQueuesRequest").msgclass - ListQueuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListQueuesResponse").msgclass - GetQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.GetQueueRequest").msgclass - CreateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.CreateQueueRequest").msgclass - UpdateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UpdateQueueRequest").msgclass - DeleteQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.DeleteQueueRequest").msgclass - PurgeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PurgeQueueRequest").msgclass - PauseQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PauseQueueRequest").msgclass - ResumeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ResumeQueueRequest").msgclass - UploadQueueYamlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UploadQueueYamlRequest").msgclass - ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListTasksRequest").msgclass - ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.ListTasksResponse").msgclass - GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.GetTaskRequest").msgclass - CreateTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.CreateTaskRequest").msgclass - DeleteTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.DeleteTaskRequest").msgclass - LeaseTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.LeaseTasksRequest").msgclass - LeaseTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.LeaseTasksResponse").msgclass - AcknowledgeTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AcknowledgeTaskRequest").msgclass - RenewLeaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RenewLeaseRequest").msgclass - CancelLeaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.CancelLeaseRequest").msgclass - RunTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RunTaskRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb deleted file mode 100644 index a80defa38d7a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb +++ /dev/null @@ -1,274 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/tasks/v2beta2/cloudtasks.proto for package 'google.cloud.tasks.v2beta2' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/tasks/v2beta2/cloudtasks_pb' - -module Google - module Cloud - module Tasks - module V2beta2 - module CloudTasks - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.tasks.v2beta2.CloudTasks' - - # Lists queues. - # - # Queues are returned in lexicographical order. - rpc :ListQueues, ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse - # Gets a queue. - rpc :GetQueue, ::Google::Cloud::Tasks::V2beta2::GetQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :CreateQueue, ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :UpdateQueue, ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :DeleteQueue, ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, ::Google::Protobuf::Empty - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - rpc :PurgeQueue, ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue]. Tasks can - # still be added when the queue is paused. A queue is paused if its - # [state][google.cloud.tasks.v2beta2.Queue.state] is - # [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. - rpc :PauseQueue, ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue - # Resume a queue. - # - # This method resumes a queue after it has been - # [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED] or - # [DISABLED][google.cloud.tasks.v2beta2.Queue.State.DISABLED]. The state of a - # queue is stored in the queue's - # [state][google.cloud.tasks.v2beta2.Queue.state]; after calling this method - # it will be set to - # [RUNNING][google.cloud.tasks.v2beta2.Queue.State.RUNNING]. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - rpc :ResumeQueue, ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, ::Google::Cloud::Tasks::V2beta2::Queue - # Update queue list by uploading a queue.yaml file. - # - # The queue.yaml file is supplied in the request body as a YAML encoded - # string. This method was added to support gcloud clients versions before - # 322.0.0. New clients should use CreateQueue instead of this method. - rpc :UploadQueueYaml, ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest, ::Google::Protobuf::Empty - # Gets the access control policy for a - # [Queue][google.cloud.tasks.v2beta2.Queue]. Returns an empty policy if the - # resource exists and does not have a policy set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the access control policy for a - # [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on a - # [Queue][google.cloud.tasks.v2beta2.Queue]. If the resource does not exist, - # this will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Lists the tasks in a queue. - # - # By default, only the [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC] - # view is retrieved due to performance considerations; - # [response_view][google.cloud.tasks.v2beta2.ListTasksRequest.response_view] - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - rpc :ListTasks, ::Google::Cloud::Tasks::V2beta2::ListTasksRequest, ::Google::Cloud::Tasks::V2beta2::ListTasksResponse - # Gets a task. - rpc :GetTask, ::Google::Cloud::Tasks::V2beta2::GetTaskRequest, ::Google::Cloud::Tasks::V2beta2::Task - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], - # the maximum task size is - # 100KB. - # * For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum - # task size is 1MB. - rpc :CreateTask, ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, ::Google::Cloud::Tasks::V2beta2::Task - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has completed successfully or permanently - # failed. - rpc :DeleteTask, ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, ::Google::Protobuf::Empty - # Leases tasks from a pull queue for - # [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - # - # This method is invoked by the worker to obtain a lease. The - # worker must acknowledge the task via - # [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] - # after they have performed the work associated with the task. - # - # The [payload][google.cloud.tasks.v2beta2.PullMessage.payload] is intended - # to store data that the worker needs to perform the work associated with the - # task. To return the payloads in the - # [response][google.cloud.tasks.v2beta2.LeaseTasksResponse], set - # [response_view][google.cloud.tasks.v2beta2.LeaseTasksRequest.response_view] - # to [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]. - # - # A maximum of 10 qps of - # [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests are - # allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - # is returned when this limit is - # exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - # is also returned when - # [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] - # is exceeded. - rpc :LeaseTasks, ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse - # Acknowledges a pull task. - # - # The worker, that is, the entity that - # [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must - # call this method to indicate that the work associated with the task has - # finished. - # - # The worker must acknowledge a task within the - # [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration] - # or the lease will expire and the task will become available to be leased - # again. After the task is acknowledged, it will not be returned - # by a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks], - # [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or - # [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. - rpc :AcknowledgeTask, ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, ::Google::Protobuf::Empty - # Renew the current lease of a pull task. - # - # The worker can use this method to extend the lease by a new - # duration, starting from now. The new task lease will be - # returned in the task's - # [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - rpc :RenewLease, ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, ::Google::Cloud::Tasks::V2beta2::Task - # Cancel a pull task's lease. - # - # The worker can use this method to cancel a task's lease by - # setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] - # to now. This will make the task available to be leased to the next caller - # of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. - rpc :CancelLease, ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, ::Google::Cloud::Tasks::V2beta2::Task - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # [RateLimits][google.cloud.tasks.v2beta2.RateLimits] or is - # [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. - # - # This command is meant to be used for manual debugging. For - # example, [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] can be - # used to retry a failed task after a fix has been made or to manually force - # a task to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the [status][google.cloud.tasks.v2beta2.Task.status] after the - # task is dispatched but before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be - # reset to the time that - # [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] was called plus - # the retry delay specified in the queue's - # [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig]. - # - # [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - # - # [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] cannot be called - # on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. - rpc :RunTask, ::Google::Cloud::Tasks::V2beta2::RunTaskRequest, ::Google::Cloud::Tasks::V2beta2::Task - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb deleted file mode 100644 index 0ba4333a5205..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/old_target_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta2/old_target.proto - -require 'google/protobuf' - - -descriptor_data = "\n+google/cloud/tasks/v2beta2/old_target.proto\x12\x1agoogle.cloud.tasks.v2beta2Bw\n\x1e\x63om.google.cloud.tasks.v2beta2B\x0eOldTargetProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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 = [ - ] - 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 Tasks - module V2beta2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb deleted file mode 100644 index 7abbc48905fd..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/queue_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta2/queue.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/tasks/v2beta2/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n&google/cloud/tasks/v2beta2/queue.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta2/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\x06\n\x05Queue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12Q\n\x16\x61pp_engine_http_target\x18\x03 \x01(\x0b\x32/.google.cloud.tasks.v2beta2.AppEngineHttpTargetH\x00\x12=\n\x0bpull_target\x18\x04 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.PullTargetH\x00\x12=\n\x0bhttp_target\x18\x11 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.HttpTargetH\x00\x12;\n\x0brate_limits\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.RateLimits\x12=\n\x0cretry_config\x18\x06 \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.RetryConfig\x12\x36\n\x05state\x18\x07 \x01(\x0e\x32\'.google.cloud.tasks.v2beta2.Queue.State\x12.\n\npurge_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x08task_ttl\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x30\n\rtombstone_ttl\x18\n \x01(\x0b\x32\x19.google.protobuf.Duration\x12:\n\x05stats\x18\x10 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.QueueStatsB\x03\xe0\x41\x03\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03:\\\xea\x41Y\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x36projects/{project}/locations/{location}/queues/{queue}B\r\n\x0btarget_type\"k\n\nRateLimits\x12\'\n\x1fmax_tasks_dispatched_per_second\x18\x01 \x01(\x01\x12\x16\n\x0emax_burst_size\x18\x02 \x01(\x05\x12\x1c\n\x14max_concurrent_tasks\x18\x03 \x01(\x05\"\x81\x02\n\x0bRetryConfig\x12\x16\n\x0cmax_attempts\x18\x01 \x01(\x05H\x00\x12\x1c\n\x12unlimited_attempts\x18\x02 \x01(\x08H\x00\x12\x35\n\x12max_retry_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmin_backoff\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmax_backoff\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x06 \x01(\x05\x42\x0e\n\x0cnum_attempts\"\xe8\x01\n\nQueueStats\x12\x18\n\x0btasks_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x46\n\x1doldest_estimated_arrival_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\'\n\x1a\x65xecuted_last_minute_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12(\n\x1b\x63oncurrent_dispatches_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12%\n\x18\x65\x66\x66\x65\x63tive_execution_rate\x18\x05 \x01(\x01\x42\x03\xe0\x41\x03\x42s\n\x1e\x63om.google.cloud.tasks.v2beta2B\nQueueProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta2.AppEngineHttpTarget", "google/cloud/tasks/v2beta2/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.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 Tasks - module V2beta2 - Queue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Queue").msgclass - Queue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Queue.State").enummodule - RateLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RateLimits").msgclass - RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.RetryConfig").msgclass - QueueStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.QueueStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb deleted file mode 100644 index d3a2ea31d304..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloud_tasks/rest" -require "google/cloud/tasks/v2beta2/bindings_override" -require "google/cloud/tasks/v2beta2/version" - -module Google - module Cloud - module Tasks - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/tasks/v2beta2/rest" - # client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new - # - module V2beta2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb deleted file mode 100644 index 87c3bb0dfc07..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/target_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta2/target.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n\'google/cloud/tasks/v2beta2/target.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x1fgoogle/api/field_behavior.proto\"\x0c\n\nPullTarget\"+\n\x0bPullMessage\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x0b\n\x03tag\x18\x02 \x01(\t\"h\n\x13\x41ppEngineHttpTarget\x12Q\n\x1b\x61pp_engine_routing_override\x18\x01 \x01(\x0b\x32,.google.cloud.tasks.v2beta2.AppEngineRouting\"\xc4\x02\n\x14\x41ppEngineHttpRequest\x12;\n\x0bhttp_method\x18\x01 \x01(\x0e\x32&.google.cloud.tasks.v2beta2.HttpMethod\x12H\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32,.google.cloud.tasks.v2beta2.AppEngineRouting\x12\x14\n\x0crelative_url\x18\x03 \x01(\t\x12N\n\x07headers\x18\x04 \x03(\x0b\x32=.google.cloud.tasks.v2beta2.AppEngineHttpRequest.HeadersEntry\x12\x0f\n\x07payload\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\"\xf5\x02\n\x0bHttpRequest\x12\x10\n\x03url\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta2.HttpMethod\x12\x45\n\x07headers\x18\x03 \x03(\x0b\x32\x34.google.cloud.tasks.v2beta2.HttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta2.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"\x1c\n\x0cPathOverride\x12\x0c\n\x04path\x18\x01 \x01(\t\"%\n\rQueryOverride\x12\x14\n\x0cquery_params\x18\x01 \x01(\t\"\x97\x04\n\x0bUriOverride\x12\x43\n\x06scheme\x18\x01 \x01(\x0e\x32..google.cloud.tasks.v2beta2.UriOverride.SchemeH\x00\x88\x01\x01\x12\x11\n\x04host\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\x03H\x02\x88\x01\x01\x12?\n\rpath_override\x18\x04 \x01(\x0b\x32(.google.cloud.tasks.v2beta2.PathOverride\x12\x41\n\x0equery_override\x18\x05 \x01(\x0b\x32).google.cloud.tasks.v2beta2.QueryOverride\x12\x61\n\x19uri_override_enforce_mode\x18\x06 \x01(\x0e\x32>.google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode\"5\n\x06Scheme\x12\x16\n\x12SCHEME_UNSPECIFIED\x10\x00\x12\x08\n\x04HTTP\x10\x01\x12\t\n\x05HTTPS\x10\x02\"b\n\x16UriOverrideEnforceMode\x12)\n%URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED\x10\x00\x12\x11\n\rIF_NOT_EXISTS\x10\x01\x12\n\n\x06\x41LWAYS\x10\x02\x42\t\n\x07_schemeB\x07\n\x05_hostB\x07\n\x05_port\"\xe4\x03\n\nHttpTarget\x12=\n\x0curi_override\x18\x01 \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.UriOverride\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta2.HttpMethod\x12O\n\x10header_overrides\x18\x03 \x03(\x0b\x32\x35.google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta2.OidcTokenH\x00\x1a$\n\x06Header\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x1aO\n\x0eHeaderOverride\x12=\n\x06header\x18\x01 \x01(\x0b\x32-.google.cloud.tasks.v2beta2.HttpTarget.HeaderB\x16\n\x14\x61uthorization_header\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42t\n\x1e\x63om.google.cloud.tasks.v2beta2B\x0bTargetProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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 = [ - ] - 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 Tasks - module V2beta2 - PullTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PullTarget").msgclass - PullMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PullMessage").msgclass - AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AppEngineHttpTarget").msgclass - AppEngineHttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AppEngineHttpRequest").msgclass - AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AppEngineRouting").msgclass - HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpRequest").msgclass - PathOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.PathOverride").msgclass - QueryOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.QueryOverride").msgclass - UriOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UriOverride").msgclass - UriOverride::Scheme = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UriOverride.Scheme").enummodule - UriOverride::UriOverrideEnforceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.UriOverride.UriOverrideEnforceMode").enummodule - HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpTarget").msgclass - HttpTarget::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpTarget.Header").msgclass - HttpTarget::HeaderOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpTarget.HeaderOverride").msgclass - OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.OAuthToken").msgclass - OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.OidcToken").msgclass - HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.HttpMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb deleted file mode 100644 index a188a88287b0..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/task_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta2/task.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/tasks/v2beta2/target_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n%google/cloud/tasks/v2beta2/task.proto\x12\x1agoogle.cloud.tasks.v2beta2\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta2/target.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xe9\x04\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12S\n\x17\x61pp_engine_http_request\x18\x03 \x01(\x0b\x32\x30.google.cloud.tasks.v2beta2.AppEngineHttpRequestH\x00\x12?\n\x0cpull_message\x18\x04 \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.PullMessageH\x00\x12?\n\x0chttp_request\x18\r \x01(\x0b\x32\'.google.cloud.tasks.v2beta2.HttpRequestH\x00\x12\x31\n\rschedule_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x06status\x18\x07 \x01(\x0b\x32&.google.cloud.tasks.v2beta2.TaskStatus\x12\x33\n\x04view\x18\x08 \x01(\x0e\x32%.google.cloud.tasks.v2beta2.Task.View\"1\n\x04View\x12\x14\n\x10VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02:h\xea\x41\x65\n\x1e\x63loudtasks.googleapis.com/Task\x12\x43projects/{project}/locations/{location}/queues/{queue}/tasks/{task}B\x0e\n\x0cpayload_type\"\xdd\x01\n\nTaskStatus\x12\x1e\n\x16\x61ttempt_dispatch_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x61ttempt_response_count\x18\x02 \x01(\x05\x12G\n\x14\x66irst_attempt_status\x18\x03 \x01(\x0b\x32).google.cloud.tasks.v2beta2.AttemptStatus\x12\x46\n\x13last_attempt_status\x18\x04 \x01(\x0b\x32).google.cloud.tasks.v2beta2.AttemptStatus\"\xd5\x01\n\rAttemptStatus\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rdispatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rresponse_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x0fresponse_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusBr\n\x1e\x63om.google.cloud.tasks.v2beta2B\tTaskProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta2.AppEngineHttpRequest", "google/cloud/tasks/v2beta2/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.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 Tasks - module V2beta2 - Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Task").msgclass - Task::View = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.Task.View").enummodule - TaskStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.TaskStatus").msgclass - AttemptStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta2.AttemptStatus").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb deleted file mode 100644 index fb19c639de63..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/lib/google/cloud/tasks/v2beta2/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md deleted file mode 100644 index da33c0281ced..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Tasks V2beta2 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-tasks-v2beta2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/api/httpbody.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/httpbody.rb deleted file mode 100644 index 938f7ac6b2fd..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/httpbody.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Message that represents an arbitrary HTTP body. It should only be used for - # payload formats that can't be represented as JSON, such as raw binary or - # an HTML page. - # - # - # This message can be used both in streaming and non-streaming API methods in - # the request as well as the response. - # - # It can be used as a top-level request field, which is convenient if one - # wants to extract parameters from either the URL or HTTP template into the - # request fields and also want access to the raw HTTP body. - # - # Example: - # - # message GetResourceRequest { - # // A unique request id. - # string request_id = 1; - # - # // The raw HTTP body is bound to this field. - # google.api.HttpBody http_body = 2; - # - # } - # - # service ResourceService { - # rpc GetResource(GetResourceRequest) - # returns (google.api.HttpBody); - # rpc UpdateResource(google.api.HttpBody) - # returns (google.protobuf.Empty); - # - # } - # - # Example with streaming methods: - # - # service CaldavService { - # rpc GetCalendar(stream google.api.HttpBody) - # returns (stream google.api.HttpBody); - # rpc UpdateCalendar(stream google.api.HttpBody) - # returns (stream google.api.HttpBody); - # - # } - # - # Use of this type only changes how the request and response bodies are - # handled, all other features will continue to work unchanged. - # @!attribute [rw] content_type - # @return [::String] - # The HTTP Content-Type header value specifying the content type of the body. - # @!attribute [rw] data - # @return [::String] - # The HTTP request/response body as raw binary. - # @!attribute [rw] extensions - # @return [::Array<::Google::Protobuf::Any>] - # Application specific response metadata. Must be set in the first response - # for streaming APIs. - class HttpBody - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb deleted file mode 100644 index 91f3d9930425..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb +++ /dev/null @@ -1,608 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta2 - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @!attribute [rw] filter - # @return [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2beta2::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "app_engine_http_target: *". - # - # Note that using filters might cause fewer queues than the - # requested_page size to be returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta2::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues} method. It - # is an error to switch the value of the - # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#filter filter} while - # iterating through pages. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - class ListQueuesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues}. - # @!attribute [rw] queues - # @return [::Array<::Google::Cloud::Tasks::V2beta2::Queue>] - # The list of queues. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # - # To return the next page of results, call - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues ListQueues} with this - # value as the - # {::Google::Cloud::Tasks::V2beta2::ListQueuesRequest#page_token page_token}. - # - # If the next_page_token is empty, there are no more results. - # - # The page token is valid for only 2 hours. - class ListQueuesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue GetQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - class GetQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue CreateQueue}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @!attribute [rw] queue - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as - # an existing queue. - class CreateQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue}. - # @!attribute [rw] queue - # @return [::Google::Cloud::Tasks::V2beta2::Queue] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} must be - # specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2beta2::Queue#name name} cannot be - # changed. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - class UpdateQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue DeleteQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - class DeleteQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue PurgeQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class PurgeQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue PauseQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class PauseQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue ResumeQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class ResumeQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml UploadQueueYaml}. - # @!attribute [rw] app_id - # @return [::String] - # Required. The App ID is supplied as an HTTP parameter. Unlike internal - # usage of App ID, it does not include a region prefix. Rather, the App ID - # represents the Project ID against which to make the request. - # @!attribute [rw] http_body - # @return [::Google::Api::HttpBody] - # The http body contains the queue.yaml file which used to update queue lists - class UploadQueueYamlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing tasks using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks}. - # @!attribute [rw] parent - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta2::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - class ListTasksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing tasks using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks}. - # @!attribute [rw] tasks - # @return [::Array<::Google::Cloud::Tasks::V2beta2::Task>] - # The list of tasks. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # - # To return the next page of results, call - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks ListTasks} with this - # value as the - # {::Google::Cloud::Tasks::V2beta2::ListTasksRequest#page_token page_token}. - # - # If the next_page_token is empty, there are no more results. - class ListTasksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a task using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task GetTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - class GetTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask}. - # @!attribute [rw] parent - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @!attribute [rw] task - # @return [::Google::Cloud::Tasks::V2beta2::Task] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2beta2::Task#name name}. If a name is not specified - # then the system will generate a random unique task id, which will be set in - # the task returned in the {::Google::Cloud::Tasks::V2beta2::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} is not - # set or is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or completed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1 hour after the original task was - # deleted or completed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9 days after the original task was deleted or completed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - class CreateTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a task using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task DeleteTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - class DeleteTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for leasing tasks using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}. - # @!attribute [rw] parent - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @!attribute [rw] max_tasks - # @return [::Integer] - # The maximum number of tasks to lease. - # - # The system will make a best effort to return as close to as - # `max_tasks` as possible. - # - # The largest that `max_tasks` can be is 1000. - # - # The maximum total size of a [lease tasks - # response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is 32 MB. If the - # sum of all task sizes requested reaches this limit, fewer tasks than - # requested are returned. - # @!attribute [rw] lease_duration - # @return [::Google::Protobuf::Duration] - # Required. The duration of the lease. - # - # Each task returned in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will have its - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} set to the - # current time plus the `lease_duration`. The task is leased until its - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}; thus, the - # task will not be returned to another - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call before - # its {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # - # - # After the worker has successfully finished the work associated - # with the task, the worker must call via - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask} - # before the {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time}. - # Otherwise the task will be returned to a later - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} call so that - # another worker can retry it. - # - # The maximum lease duration is 1 week. - # `lease_duration` will be truncated to the nearest second. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - # @!attribute [rw] filter - # @return [::String] - # `filter` can be used to specify a subset of tasks to lease. - # - # When `filter` is set to `tag=` then the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse response} will contain only - # tasks whose {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} is equal to - # ``. `` must be less than 500 characters. - # - # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - # the same tag as the task with the oldest - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} will be - # returned. - # - # Grammar Syntax: - # - # * `filter = "tag=" tag | "tag_function=" function` - # - # * `tag = string` - # - # * `function = "oldest_tag()"` - # - # The `oldest_tag()` function returns tasks which have the same tag as the - # oldest task (ordered by schedule time). - # - # SDK compatibility: Although the SDK allows tags to be either - # string or - # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - # aren't UTF-8 encoded can't be used in the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter} and the - # task's {::Google::Cloud::Tasks::V2beta2::PullMessage#tag tag} will be displayed - # as empty in Cloud Tasks. - class LeaseTasksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for leasing tasks using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks}. - # @!attribute [rw] tasks - # @return [::Array<::Google::Cloud::Tasks::V2beta2::Task>] - # The leased tasks. - class LeaseTasksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for acknowledging a task using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task AcknowledgeTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - class AcknowledgeTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for renewing a lease using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # @!attribute [rw] lease_duration - # @return [::Google::Protobuf::Duration] - # Required. The desired new lease duration, starting from now. - # - # - # The maximum lease duration is 1 week. - # `lease_duration` will be truncated to the nearest second. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - class RenewLeaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for canceling a lease using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease CancelLease}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Required. The task's current schedule time, available in the - # {::Google::Cloud::Tasks::V2beta2::Task#schedule_time schedule_time} returned by - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} response or - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease RenewLease} response. - # This restriction is to ensure that your worker currently holds the lease. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - class CancelLeaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for forcing a task to run now using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta2::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Task Task} resource. - class RunTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb deleted file mode 100644 index c00a2ec7be5e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/queue.rb +++ /dev/null @@ -1,448 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta2 - # A queue is a container of related tasks. Queues are configured to manage - # how those tasks are dispatched. Configurable properties include rate limits, - # retry options, target types, and others. - # @!attribute [rw] name - # @return [::String] - # Caller-specified and required in - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue CreateQueue}, after - # which it becomes output only. - # - # The queue name. - # - # The queue name must have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the queue's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - # hyphens (-). The maximum length is 100 characters. - # @!attribute [rw] app_engine_http_target - # @return [::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget] - # App Engine HTTP target. - # - # An App Engine queue is a queue that has an - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget}. - # - # Note: The following fields are mutually exclusive: `app_engine_http_target`, `pull_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] pull_target - # @return [::Google::Cloud::Tasks::V2beta2::PullTarget] - # Pull target. - # - # A pull queue is a queue that has a - # {::Google::Cloud::Tasks::V2beta2::PullTarget PullTarget}. - # - # Note: The following fields are mutually exclusive: `pull_target`, `app_engine_http_target`, `http_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] http_target - # @return [::Google::Cloud::Tasks::V2beta2::HttpTarget] - # An http_target is used to override the target values for HTTP tasks. - # - # Note: The following fields are mutually exclusive: `http_target`, `app_engine_http_target`, `pull_target`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] rate_limits - # @return [::Google::Cloud::Tasks::V2beta2::RateLimits] - # Rate limits for task dispatches. - # - # {::Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} and - # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} are related - # because they both control task attempts however they control how tasks are - # attempted in different ways: - # - # * {::Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} controls the - # total rate of - # dispatches from a queue (i.e. all traffic dispatched from the - # queue, regardless of whether the dispatch is from a first - # attempt or a retry). - # * {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls - # what happens to - # particular a task after its first attempt fails. That is, - # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls - # task retries (the second attempt, third attempt, etc). - # @!attribute [rw] retry_config - # @return [::Google::Cloud::Tasks::V2beta2::RetryConfig] - # Settings that determine the retry behavior. - # - # * For tasks created using Cloud Tasks: the queue-level retry settings - # apply to all tasks in the queue that were created using Cloud Tasks. - # Retry settings cannot be set on individual tasks. - # * For tasks created using the App Engine SDK: the queue-level retry - # settings apply to all tasks in the queue which do not have retry settings - # explicitly set on the task and were created by the App Engine SDK. See - # [App Engine - # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - # @!attribute [rw] state - # @return [::Google::Cloud::Tasks::V2beta2::Queue::State] - # Output only. The state of the queue. - # - # `state` can only be changed by called - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue PauseQueue}, - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue ResumeQueue}, or - # uploading - # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} cannot be - # used to change `state`. - # @!attribute [rw] purge_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time this queue was purged. - # - # All tasks that were {::Google::Cloud::Tasks::V2beta2::Task#create_time created} - # before this time were purged. - # - # A queue can be purged using - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue PurgeQueue}, the [App - # Engine Task Queue SDK, or the Cloud - # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - # - # Purge time will be truncated to the nearest microsecond. Purge - # time will be unset if the queue has never been purged. - # @!attribute [rw] task_ttl - # @return [::Google::Protobuf::Duration] - # The maximum amount of time that a task will be retained in - # this queue. - # - # Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - # After a task has lived for `task_ttl`, the task will be deleted - # regardless of whether it was dispatched or not. - # - # The `task_ttl` for queues created via queue.yaml/xml is equal to the - # maximum duration because there is a - # [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - # these queues. To view the maximum valid duration, see the documentation for - # {::Google::Protobuf::Duration Duration}. - # @!attribute [rw] tombstone_ttl - # @return [::Google::Protobuf::Duration] - # The task tombstone time to live (TTL). - # - # After a task is deleted or completed, the task's tombstone is - # retained for the length of time specified by `tombstone_ttl`. - # The tombstone is used by task de-duplication; another task with the same - # name can't be created until the tombstone has expired. For more information - # about task de-duplication, see the documentation for - # {::Google::Cloud::Tasks::V2beta2::CreateTaskRequest#task CreateTaskRequest}. - # - # Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - # @!attribute [r] stats - # @return [::Google::Cloud::Tasks::V2beta2::QueueStats] - # Output only. The realtime, informational statistics for a queue. In order - # to receive the statistics the caller should include this field in the - # FieldMask. - class Queue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the queue. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The queue is running. Tasks can be dispatched. - # - # If the queue was created using Cloud Tasks and the queue has - # had no activity (method calls or task dispatches) for 30 days, - # the queue may take a few minutes to re-activate. Some method - # calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - # tasks may not be dispatched for a few minutes until the queue - # has been re-activated. - RUNNING = 1 - - # Tasks are paused by the user. If the queue is paused then Cloud - # Tasks will stop delivering tasks from it, but more tasks can - # still be added to it by the user. When a pull queue is paused, - # all {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} calls - # will return a [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION]. - PAUSED = 2 - - # The queue is disabled. - # - # A queue becomes `DISABLED` when - # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - # or - # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - # is uploaded which does not contain the queue. You cannot directly disable - # a queue. - # - # When a queue is disabled, tasks can still be added to a queue - # but the tasks are not dispatched and - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} calls - # return a `FAILED_PRECONDITION` error. - # - # To permanently delete this queue and all of its tasks, call - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue DeleteQueue}. - DISABLED = 3 - end - end - - # Rate limits. - # - # This message determines the maximum rate that tasks can be dispatched by a - # queue, regardless of whether the dispatch is a first task attempt or a retry. - # - # Note: The debugging command, - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task RunTask}, will run a task - # even if the queue has reached its - # {::Google::Cloud::Tasks::V2beta2::RateLimits RateLimits}. - # @!attribute [rw] max_tasks_dispatched_per_second - # @return [::Float] - # The maximum rate at which tasks are dispatched from this queue. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # * For {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, - # the maximum allowed value - # is 500. - # * This field is output only for [pull - # queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the - # `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} requests - # are allowed per pull queue. - # - # - # This field has the same meaning as - # [rate in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - # @!attribute [rw] max_burst_size - # @return [::Integer] - # The max burst size. - # - # Max burst size limits how fast tasks in queue are processed when - # many tasks are in the queue and the rate is high. This field - # allows the queue to have a high rate so processing starts shortly - # after a task is enqueued, but still limits resource usage when - # many tasks are enqueued in a short period of time. - # - # The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - # algorithm is used to control the rate of task dispatches. Each - # queue has a token bucket that holds tokens, up to the maximum - # specified by `max_burst_size`. Each time a task is dispatched, a - # token is removed from the bucket. Tasks will be dispatched until - # the queue's bucket runs out of tokens. The bucket will be - # continuously refilled with new tokens based on - # [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - # - # The default value of `max_burst_size` is picked by Cloud Tasks - # based on the value of - # [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - # - # The maximum value of `max_burst_size` is 500. - # - # For App Engine queues that were created or updated using - # `queue.yaml/xml`, `max_burst_size` is equal to - # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - # If - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} is called - # on a queue without explicitly setting a value for `max_burst_size`, - # `max_burst_size` value will get updated if - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue UpdateQueue} is - # updating [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - # @!attribute [rw] max_concurrent_tasks - # @return [::Integer] - # The maximum number of concurrent tasks that Cloud Tasks allows - # to be dispatched for this queue. After this threshold has been - # reached, Cloud Tasks stops dispatching tasks until the number of - # concurrent requests decreases. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # The maximum allowed value is 5,000. - # - # This field is output only for - # {::Google::Cloud::Tasks::V2beta2::PullTarget pull queues} and always -1, which - # indicates no limit. No other queue types can have `max_concurrent_tasks` - # set to -1. - # - # - # This field has the same meaning as - # [max_concurrent_requests in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - class RateLimits - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retry config. - # - # These settings determine how a failed task attempt is retried. - # @!attribute [rw] max_attempts - # @return [::Integer] - # The maximum number of attempts for a task. - # - # Cloud Tasks will attempt the task `max_attempts` times (that - # is, if the first attempt fails, then there will be - # `max_attempts - 1` retries). Must be > 0. - # - # Note: The following fields are mutually exclusive: `max_attempts`, `unlimited_attempts`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] unlimited_attempts - # @return [::Boolean] - # If true, then the number of attempts is unlimited. - # - # Note: The following fields are mutually exclusive: `unlimited_attempts`, `max_attempts`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_retry_duration - # @return [::Google::Protobuf::Duration] - # If positive, `max_retry_duration` specifies the time limit for - # retrying a failed task, measured from when the task was first - # attempted. Once `max_retry_duration` time has passed *and* the - # task has been attempted - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times, - # no further attempts will be made and the task will be deleted. - # - # If zero, then the task age is unlimited. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # This field is output only for [pull - # queues][google.cloud.tasks.v2beta2.PullTarget]. - # - # - # `max_retry_duration` will be truncated to the nearest second. - # - # This field has the same meaning as - # [task_age_limit in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] min_backoff - # @return [::Google::Protobuf::Duration] - # A task will be {::Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} - # for retry between - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration - # after it fails, if the queue's - # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the - # task should be retried. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # This field is output only for [pull - # queues][google.cloud.tasks.v2beta2.PullTarget]. - # - # - # `min_backoff` will be truncated to the nearest second. - # - # This field has the same meaning as - # [min_backoff_seconds in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_backoff - # @return [::Google::Protobuf::Duration] - # A task will be {::Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} - # for retry between - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration - # after it fails, if the queue's - # {::Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the - # task should be retried. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # This field is output only for [pull - # queues][google.cloud.tasks.v2beta2.PullTarget]. - # - # - # `max_backoff` will be truncated to the nearest second. - # - # This field has the same meaning as - # [max_backoff_seconds in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_doublings - # @return [::Integer] - # The time between retries will double `max_doublings` times. - # - # A task's retry interval starts at - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff}, then - # doubles `max_doublings` times, then increases linearly, and finally retries - # at intervals of - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} up to - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times. - # - # For example, if - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} is 10s, - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} is 300s, - # and `max_doublings` is 3, then the a task will first be retried in 10s. The - # retry interval will double three times, and then increase linearly by 2^3 * - # 10s. Finally, the task will retry at intervals of - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} until the - # task has been attempted - # {::Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times. - # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - # 300s, .... - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # This field is output only for [pull - # queues][google.cloud.tasks.v2beta2.PullTarget]. - # - # - # This field has the same meaning as - # [max_doublings in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - class RetryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Statistics for a queue. - # @!attribute [r] tasks_count - # @return [::Integer] - # Output only. An estimation of the number of tasks in the queue, that is, - # the tasks in the queue that haven't been executed, the tasks in the queue - # which the queue has dispatched but has not yet received a reply for, and - # the failed tasks that the queue is retrying. - # @!attribute [r] oldest_estimated_arrival_time - # @return [::Google::Protobuf::Timestamp] - # Output only. An estimation of the nearest time in the future where a task - # in the queue is scheduled to be executed. - # @!attribute [r] executed_last_minute_count - # @return [::Integer] - # Output only. The number of tasks that the queue has dispatched and received - # a reply for during the last minute. This variable counts both successful - # and non-successful executions. - # @!attribute [r] concurrent_dispatches_count - # @return [::Integer] - # Output only. The number of requests that the queue has dispatched but has - # not received a reply for yet. - # @!attribute [r] effective_execution_rate - # @return [::Float] - # Output only. The current maximum number of tasks per second executed by the - # queue. The maximum value of this variable is controlled by the RateLimits - # of the Queue. However, this value could be less to avoid overloading the - # endpoints tasks in the queue are targeting. - class QueueStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb deleted file mode 100644 index 0ca9fafc9695..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/target.rb +++ /dev/null @@ -1,775 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta2 - # Pull target. - class PullTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The pull message contains data that can be used by the caller of - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} to process the - # task. - # - # This proto can only be used for tasks in a queue which has - # {::Google::Cloud::Tasks::V2beta2::Queue#pull_target pull_target} set. - # @!attribute [rw] payload - # @return [::String] - # A data payload consumed by the worker to execute the task. - # @!attribute [rw] tag - # @return [::String] - # The task's tag. - # - # Tags allow similar tasks to be processed in a batch. If you label - # tasks with a tag, your worker can - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks lease tasks} with the - # same tag using - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter}. For example, - # if you want to aggregate the events associated with a specific user once a - # day, you could tag tasks with the user ID. - # - # The task's tag can only be set when the - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}. - # - # The tag must be less than 500 characters. - # - # SDK compatibility: Although the SDK allows tags to be either - # string or - # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - # encoded, the tag will be empty when the task is returned by Cloud Tasks. - class PullMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # App Engine HTTP target. - # - # The task will be delivered to the App Engine application hostname - # specified by its - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} and - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest}. The - # documentation for - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} - # explains how the task's host URL is constructed. - # - # Using {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} - # requires - # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) - # Google IAM permission for the project - # and the following scope: - # - # `https://www.googleapis.com/auth/cloud-platform` - # @!attribute [rw] app_engine_routing_override - # @return [::Google::Cloud::Tasks::V2beta2::AppEngineRouting] - # Overrides for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - # - # If set, `app_engine_routing_override` is used for all tasks in - # the queue, no matter what the setting is for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - class AppEngineHttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # App Engine HTTP request. - # - # The message defines the HTTP request that is sent to an App Engine app when - # the task is dispatched. - # - # This proto can only be used for tasks in a queue which has - # {::Google::Cloud::Tasks::V2beta2::Queue#app_engine_http_target app_engine_http_target} - # set. - # - # Using {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} - # requires - # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) - # Google IAM permission for the project - # and the following scope: - # - # `https://www.googleapis.com/auth/cloud-platform` - # - # The task will be delivered to the App Engine app which belongs to the same - # project as the queue. For more information, see - # [How Requests are - # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and how routing is affected by - # [dispatch - # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). - # Traffic is encrypted during transport and never leaves Google datacenters. - # Because this traffic is carried over a communication mechanism internal to - # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). - # The request to the handler, however, will appear to have used the HTTP - # protocol. - # - # The {::Google::Cloud::Tasks::V2beta2::AppEngineRouting AppEngineRouting} used to - # construct the URL that the task is delivered to can be set at the queue-level - # or task-level: - # - # * If set, - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override} - # is used for all tasks in the queue, no matter what the setting - # is for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - # - # - # The `url` that the task will be sent to is: - # - # * `url =` {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} `+` - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#relative_url relative_url} - # - # Tasks can be dispatched to secure app handlers, unsecure app handlers, and - # URIs restricted with - # [`login: - # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). - # Because tasks are not run as any user, they cannot be dispatched to URIs - # restricted with - # [`login: - # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) - # Task dispatches also do not follow redirects. - # - # The task attempt has succeeded if the app's request handler returns an HTTP - # response code in the range [`200` - `299`]. The task attempt has failed if - # the app's handler returns a non-2xx response code or Cloud Tasks does - # not receive response before the [deadline][Task.dispatch_deadline]. Failed - # tasks will be retried according to the - # {::Google::Cloud::Tasks::V2beta2::Queue#retry_config retry configuration}. `503` - # (Service Unavailable) is considered an App Engine system error instead of an - # application error and will cause Cloud Tasks' traffic congestion control to - # temporarily throttle the queue's dispatches. Unlike other types of task - # targets, a `429` (Too Many Requests) response from an app handler does not - # cause traffic congestion control to throttle the queue. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2beta2::HttpMethod] - # The HTTP method to use for the request. The default is POST. - # - # The app's request handler for the task's target URL must be able to handle - # HTTP requests with this http_method, otherwise the task attempt fails with - # error code 405 (Method Not Allowed). See [Writing a push task request - # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - # and the App Engine documentation for your runtime on [How Requests are - # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - # @!attribute [rw] app_engine_routing - # @return [::Google::Cloud::Tasks::V2beta2::AppEngineRouting] - # Task-level setting for App Engine routing. - # - # If set, - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override} - # is used for all tasks in the queue, no matter what the setting is for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - # @!attribute [rw] relative_url - # @return [::String] - # The relative URL. - # - # The relative URL must begin with "/" and must be a valid HTTP relative URL. - # It can contain a path and query string arguments. - # If the relative URL is empty, then the root path "/" will be used. - # No spaces are allowed, and the maximum length allowed is 2083 characters. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. - # Headers can be set when the - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}. - # Repeated headers are not supported but a header value can contain commas. - # - # Cloud Tasks sets some headers to default values: - # - # * `User-Agent`: By default, this header is - # `"AppEngine-Google; (+http://code.google.com/appengine)"`. - # This header can be modified, but Cloud Tasks will append - # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - # modified `User-Agent`. - # - # If the task has a - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#payload payload}, Cloud - # Tasks sets the following headers: - # - # * `Content-Type`: By default, the `Content-Type` header is set to - # `"application/octet-stream"`. The default can be overridden by explicitly - # setting `Content-Type` to a particular media type when the - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created}. - # For example, `Content-Type` can be set to `"application/json"`. - # * `Content-Length`: This is computed by Cloud Tasks. This value is - # output only. It cannot be changed. - # - # The headers below cannot be set or overridden: - # - # * `Host` - # * `X-Google-*` - # * `X-AppEngine-*` - # - # In addition, Cloud Tasks sets some headers when the task is dispatched, - # such as headers containing information about the task; see - # [request - # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). - # These headers are set only when the task is dispatched, so they are not - # visible when the task is returned in a Cloud Tasks response. - # - # Although there is no specific limit for the maximum number of headers or - # the size, there is a limit on the maximum size of the - # {::Google::Cloud::Tasks::V2beta2::Task Task}. For more information, see the - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask} - # documentation. - # @!attribute [rw] payload - # @return [::String] - # Payload. - # - # The payload will be sent as the HTTP message body. A message - # body, and thus a payload, is allowed only if the HTTP method is - # POST or PUT. It is an error to set a data payload on a task with - # an incompatible {::Google::Cloud::Tasks::V2beta2::HttpMethod HttpMethod}. - class AppEngineHttpRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine Routing. - # - # Defines routing characteristics specific to App Engine - service, version, - # and instance. - # - # For more information about services, versions, and instances see - # [An Overview of App - # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), - # [Microservices Architecture on Google App - # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] service - # @return [::String] - # App service. - # - # By default, the task is sent to the service which is the default - # service when the task is attempted. - # - # For some queues or tasks which were created using the App Engine - # Task Queue API, {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is - # not parsable into - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For - # example, some tasks which were created using the App Engine SDK use a - # custom domain name; custom domains are not parsed by Cloud Tasks. If - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, - # then {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the - # empty string. - # @!attribute [rw] version - # @return [::String] - # App version. - # - # By default, the task is sent to the version which is the default - # version when the task is attempted. - # - # For some queues or tasks which were created using the App Engine - # Task Queue API, {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is - # not parsable into - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For - # example, some tasks which were created using the App Engine SDK use a - # custom domain name; custom domains are not parsed by Cloud Tasks. If - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, - # then {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the - # empty string. - # @!attribute [rw] instance - # @return [::String] - # App instance. - # - # By default, the task is sent to an instance which is available when - # the task is attempted. - # - # Requests can only be sent to a specific instance if - # [manual scaling is used in App Engine - # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - # App Engine Flex does not support instances. For more information, see - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] host - # @return [::String] - # Output only. The host that the task is sent to. - # - # For more information, see - # [How Requests are - # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - # - # The host is constructed as: - # - # - # * `host = [application_domain_name]`
- # `| [service] + '.' + [application_domain_name]`
- # `| [version] + '.' + [application_domain_name]`
- # `| [version_dot_service]+ '.' + [application_domain_name]`
- # `| [instance] + '.' + [application_domain_name]`
- # `| [instance_dot_service] + '.' + [application_domain_name]`
- # `| [instance_dot_version] + '.' + [application_domain_name]`
- # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - # - # * `application_domain_name` = The domain name of the app, for - # example .appspot.com, which is associated with the - # queue's project ID. Some tasks which were created using the App Engine - # SDK use a custom domain name. - # - # * `service =` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} - # - # * `version =` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} - # - # * `version_dot_service =` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} `+ '.' +` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} - # - # * `instance =` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} - # - # * `instance_dot_service =` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' - # +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - # - # * `instance_dot_version =` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' - # +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - # - # * `instance_dot_version_dot_service =` - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' - # +` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' - # +` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - # - # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} is empty, - # then the task will be sent to the service which is the default service when - # the task is attempted. - # - # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} is empty, - # then the task will be sent to the version which is the default version when - # the task is attempted. - # - # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is - # empty, then the task will be sent to an instance which is available when - # the task is attempted. - # - # If {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, or - # {::Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is - # invalid, then the task will be sent to the default version of the default - # service when the task is attempted. - class AppEngineRouting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # HTTP request. - # - # The task will be pushed to the worker as an HTTP request. An HTTP request - # embodies a url, an http method, headers, body and authorization for the http - # task. - # @!attribute [rw] url - # @return [::String] - # Required. The full url path that the request will be sent to. - # - # This string must begin with either "http://" or "https://". Some examples - # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - # encode some characters for safety and compatibility. The maximum allowed - # URL length is 2083 characters after encoding. - # - # The `Location` header response from a redirect response [`300` - `399`] - # may be followed. The redirect is not counted as a separate attempt. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2beta2::HttpMethod] - # The HTTP method to use for the request. The default is POST. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. - # Headers can be set when running the - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created} or - # [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - # - # These headers represent a subset of the headers that will accompany the - # task's HTTP request. Some HTTP request headers will be ignored or replaced. - # - # A partial list of headers that will be ignored or replaced is: - # - # * Any header that is prefixed with "X-CloudTasks-" will be treated - # as service header. Service headers define properties of the task and are - # predefined in CloudTask. - # * Host: This will be computed by Cloud Tasks and derived from - # {::Google::Cloud::Tasks::V2beta2::HttpRequest#url HttpRequest.url}. - # * Content-Length: This will be computed by Cloud Tasks. - # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - # * `X-Google-*`: Google use only. - # * `X-AppEngine-*`: Google use only. - # - # `Content-Type` won't be set by Cloud Tasks. You can explicitly set - # `Content-Type` to a media type when the - # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - # For example, `Content-Type` can be set to `"application/octet-stream"` or - # `"application/json"`. - # - # Headers which can have multiple values (according to RFC2616) can be - # specified using comma-separated values. - # - # The size of the headers must be less than 80KB. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. - # - # A request body is allowed only if the - # {::Google::Cloud::Tasks::V2beta2::HttpRequest#http_method HTTP method} is POST, - # PUT, or PATCH. It is an error to set body on a task with an incompatible - # {::Google::Cloud::Tasks::V2beta2::HttpMethod HttpMethod}. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Tasks::V2beta2::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as an `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # - # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Tasks::V2beta2::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # - # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HttpRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # PathOverride. - # - # Path message defines path override for HTTP targets. - # @!attribute [rw] path - # @return [::String] - # The URI path (e.g., /users/1234). Default is an empty string. - class PathOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # QueryOverride. - # - # Query message defines query override for HTTP targets. - # @!attribute [rw] query_params - # @return [::String] - # The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - # string. - class QueryOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Uri Override. - # - # When specified, all the HTTP tasks inside the queue will be partially or - # fully overridden depending on the configured values. - # @!attribute [rw] scheme - # @return [::Google::Cloud::Tasks::V2beta2::UriOverride::Scheme] - # Scheme override. - # - # When specified, the task URI scheme is replaced by the provided value (HTTP - # or HTTPS). - # @!attribute [rw] host - # @return [::String] - # Host override. - # - # When specified, replaces the host part of the task URL. For example, - # if the task URL is "https://www.google.com," and host value is set to - # "example.net", the overridden URI will be changed to "https://example.net." - # Host value cannot be an empty string (INVALID_ARGUMENT). - # @!attribute [rw] port - # @return [::Integer] - # Port override. - # - # When specified, replaces the port part of the task URI. For instance, - # for a URI http://www.google.com/foo and port=123, the overridden URI - # becomes http://www.google.com:123/foo. Note that the port value must be a - # positive integer. Setting the port to 0 (Zero) clears the URI port. - # @!attribute [rw] path_override - # @return [::Google::Cloud::Tasks::V2beta2::PathOverride] - # URI path. - # - # When specified, replaces the existing path of the task URL. Setting the - # path value to an empty string clears the URI path segment. - # @!attribute [rw] query_override - # @return [::Google::Cloud::Tasks::V2beta2::QueryOverride] - # URI Query. - # - # When specified, replaces the query part of the task URI. Setting the - # query value to an empty string clears the URI query segment. - # @!attribute [rw] uri_override_enforce_mode - # @return [::Google::Cloud::Tasks::V2beta2::UriOverride::UriOverrideEnforceMode] - # URI Override Enforce Mode - # - # When specified, determines the Target UriOverride mode. If not specified, - # it defaults to ALWAYS. - class UriOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The Scheme for an HTTP request. By default, it is HTTPS. - module Scheme - # Scheme unspecified. Defaults to HTTPS. - SCHEME_UNSPECIFIED = 0 - - # Convert the scheme to HTTP, e.g., https://www.google.ca will change to - # http://www.google.ca. - HTTP = 1 - - # Convert the scheme to HTTPS, e.g., http://www.google.ca will change to - # https://www.google.ca. - HTTPS = 2 - end - - # UriOverrideEnforceMode mode is to define enforcing mode for the override - # modes. - module UriOverrideEnforceMode - # OverrideMode Unspecified. Defaults to ALWAYS. - URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0 - - # In the IF_NOT_EXISTS mode, queue-level configuration is only - # applied where task-level configuration does not exist. - IF_NOT_EXISTS = 1 - - # In the ALWAYS mode, queue-level configuration overrides all - # task-level configuration - ALWAYS = 2 - end - end - - # HTTP target. - # - # When specified as a [Queue][target_type], all the tasks with [HttpRequest] - # will be overridden according to the target. - # @!attribute [rw] uri_override - # @return [::Google::Cloud::Tasks::V2beta2::UriOverride] - # Uri override. - # - # When specified, overrides the execution Uri for all the tasks in the queue. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2beta2::HttpMethod] - # The HTTP method to use for the request. - # - # When specified, it overrides - # {::Google::Cloud::Tasks::V2beta2::HttpTarget#http_method HttpRequest} for the - # task. Note that if the value is set to [HttpMethod][GET] the - # [HttpRequest][body] of the task will be ignored at execution time. - # @!attribute [rw] header_overrides - # @return [::Array<::Google::Cloud::Tasks::V2beta2::HttpTarget::HeaderOverride>] - # HTTP target headers. - # - # This map contains the header field names and values. - # Headers will be set when running the - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task task is created} and/or - # [task is created][google.cloud.tasks.v2beta2.CloudTasks.BufferTask]. - # - # These headers represent a subset of the headers that will accompany the - # task's HTTP request. Some HTTP request headers will be ignored or replaced. - # - # A partial list of headers that will be ignored or replaced is: - # * Any header that is prefixed with "X-CloudTasks-" will be treated - # as service header. Service headers define properties of the task and are - # predefined in CloudTask. - # * Host: This will be computed by Cloud Tasks and derived from - # {::Google::Cloud::Tasks::V2beta2::HttpRequest#url HttpRequest.url}. - # * Content-Length: This will be computed by Cloud Tasks. - # * User-Agent: This will be set to `"Google-CloudTasks"`. - # * `X-Google-*`: Google use only. - # * `X-AppEngine-*`: Google use only. - # - # `Content-Type` won't be set by Cloud Tasks. You can explicitly set - # `Content-Type` to a media type when the - # [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - # For example, `Content-Type` can be set to `"application/octet-stream"` or - # `"application/json"`. - # - # Headers which can have multiple values (according to RFC2616) can be - # specified using comma-separated values. - # - # The size of the headers must be less than 80KB. - # Queue-level headers to override headers of all the tasks in the queue. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Tasks::V2beta2::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as an `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # - # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Tasks::V2beta2::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # - # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines a header message. A header can have a key and a value. - # @!attribute [rw] key - # @return [::String] - # The key of the header. - # @!attribute [rw] value - # @return [::String] - # The value of the header. - class Header - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wraps the Header object. - # @!attribute [rw] header - # @return [::Google::Cloud::Tasks::V2beta2::HttpTarget::Header] - # header embodying a key and a value. - class HeaderOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Contains information needed for generating an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). - # This type of authorization should generally only be used when calling Google - # APIs hosted on *.googleapis.com. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OAuth token. - # The service account must be within the same project as the queue. The - # caller must have iam.serviceAccounts.actAs permission for the service - # account. - # @!attribute [rw] scope - # @return [::String] - # OAuth scope to be used for generating OAuth access token. - # If not specified, "https://www.googleapis.com/auth/cloud-platform" - # will be used. - class OAuthToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OpenID Connect - # token](https://developers.google.com/identity/protocols/OpenIDConnect). - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OIDC token. - # The service account must be within the same project as the queue. The - # caller must have iam.serviceAccounts.actAs permission for the service - # account. - # @!attribute [rw] audience - # @return [::String] - # Audience to be used when generating OIDC token. If not specified, the URI - # specified in target will be used. - class OidcToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The HTTP method used to execute the task. - module HttpMethod - # HTTP method unspecified - HTTP_METHOD_UNSPECIFIED = 0 - - # HTTP POST - POST = 1 - - # HTTP GET - GET = 2 - - # HTTP HEAD - HEAD = 3 - - # HTTP PUT - PUT = 4 - - # HTTP DELETE - DELETE = 5 - - # HTTP PATCH - PATCH = 6 - - # HTTP OPTIONS - OPTIONS = 7 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb deleted file mode 100644 index aae0f9e8995f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/cloud/tasks/v2beta2/task.rb +++ /dev/null @@ -1,208 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta2 - # A unit of scheduled work. - # @!attribute [rw] name - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task CreateTask}. - # - # The task name. - # - # The task name must have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the task's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - # hyphens (-). The maximum length is 100 characters. - # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), or underscores (_). The maximum length is 500 characters. - # @!attribute [rw] app_engine_http_request - # @return [::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest] - # App Engine HTTP request that is sent to the task's target. Can - # be set only if - # {::Google::Cloud::Tasks::V2beta2::Queue#app_engine_http_target app_engine_http_target} - # is set on the queue. - # - # An App Engine task is a task that has - # {::Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} - # set. - # - # Note: The following fields are mutually exclusive: `app_engine_http_request`, `pull_message`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] pull_message - # @return [::Google::Cloud::Tasks::V2beta2::PullMessage] - # {::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks LeaseTasks} to process - # the task. Can be set only if - # {::Google::Cloud::Tasks::V2beta2::Queue#pull_target pull_target} is set on the - # queue. - # - # A pull task is a task that has - # {::Google::Cloud::Tasks::V2beta2::PullMessage PullMessage} set. - # - # Note: The following fields are mutually exclusive: `pull_message`, `app_engine_http_request`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] http_request - # @return [::Google::Cloud::Tasks::V2beta2::HttpRequest] - # HTTP request that is sent to the task's target. - # - # An HTTP task is a task that has - # {::Google::Cloud::Tasks::V2beta2::HttpRequest HttpRequest} set. - # - # Note: The following fields are mutually exclusive: `http_request`, `app_engine_http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # The time when the task is scheduled to be attempted. - # - # For App Engine queues, this is when the task will be attempted or retried. - # - # For pull queues, this is the time when the task is available to - # be leased; if a task is currently leased, this is the time when - # the current lease expires, that is, the time that the task was - # leased plus the - # {::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#lease_duration lease_duration}. - # - # `schedule_time` will be truncated to the nearest microsecond. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the task was created. - # - # `create_time` will be truncated to the nearest second. - # @!attribute [rw] status - # @return [::Google::Cloud::Tasks::V2beta2::TaskStatus] - # Output only. The task status. - # @!attribute [rw] view - # @return [::Google::Cloud::Tasks::V2beta2::Task::View] - # Output only. The view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta2::Task Task} has been returned. - class Task - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The view specifies a subset of {::Google::Cloud::Tasks::V2beta2::Task Task} - # data. - # - # When a task is returned in a response, not all - # information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - module View - # Unspecified. Defaults to BASIC. - VIEW_UNSPECIFIED = 0 - - # The basic view omits fields which can be large or can contain - # sensitive data. - # - # This view does not include the - # ([payload in - # AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] - # and [payload in - # PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These - # payloads are desirable to return only when needed, because they can be - # large and because of the sensitivity of the data that you choose to store - # in it. - BASIC = 1 - - # All information is returned. - # - # Authorization for {::Google::Cloud::Tasks::V2beta2::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta2::Queue Queue} resource. - FULL = 2 - end - end - - # Status of the task. - # @!attribute [rw] attempt_dispatch_count - # @return [::Integer] - # Output only. The number of attempts dispatched. - # - # This count includes attempts which have been dispatched but haven't - # received a response. - # @!attribute [rw] attempt_response_count - # @return [::Integer] - # Output only. The number of attempts which have received a response. - # - # This field is not calculated for [pull - # tasks][google.cloud.tasks.v2beta2.PullMessage]. - # @!attribute [rw] first_attempt_status - # @return [::Google::Cloud::Tasks::V2beta2::AttemptStatus] - # Output only. The status of the task's first attempt. - # - # Only - # {::Google::Cloud::Tasks::V2beta2::AttemptStatus#dispatch_time dispatch_time} - # will be set. The other - # {::Google::Cloud::Tasks::V2beta2::AttemptStatus AttemptStatus} information is - # not retained by Cloud Tasks. - # - # This field is not calculated for [pull - # tasks][google.cloud.tasks.v2beta2.PullMessage]. - # @!attribute [rw] last_attempt_status - # @return [::Google::Cloud::Tasks::V2beta2::AttemptStatus] - # Output only. The status of the task's last attempt. - # - # This field is not calculated for [pull - # tasks][google.cloud.tasks.v2beta2.PullMessage]. - class TaskStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The status of a task attempt. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt was scheduled. - # - # `schedule_time` will be truncated to the nearest microsecond. - # @!attribute [rw] dispatch_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt was dispatched. - # - # `dispatch_time` will be truncated to the nearest microsecond. - # @!attribute [rw] response_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt response was received. - # - # `response_time` will be truncated to the nearest microsecond. - # @!attribute [rw] response_status - # @return [::Google::Rpc::Status] - # Output only. The response from the target for this attempt. - # - # If the task has not been attempted or the task is currently running - # then the response status is unset. - class AttemptStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2/snippets/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile deleted file mode 100644 index 3e8ffddf5b75..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta2", path: "../" -else - gem "google-cloud-tasks-v2beta2" -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-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb deleted file mode 100644 index b6dc7e27d406..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the acknowledge_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#acknowledge_task. -# -def acknowledge_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new - - # Call the acknowledge_task method. - result = client.acknowledge_task request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb deleted file mode 100644 index d14830cb0974..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the cancel_lease call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#cancel_lease. -# -def cancel_lease - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new - - # Call the cancel_lease method. - result = client.cancel_lease request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb deleted file mode 100644 index 9c97427bd607..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the create_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#create_queue. -# -def create_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new - - # Call the create_queue method. - result = client.create_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb deleted file mode 100644 index e0bf7a6bb378..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the create_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#create_task. -# -def create_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new - - # Call the create_task method. - result = client.create_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb deleted file mode 100644 index b5a51bf66325..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the delete_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#delete_queue. -# -def delete_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new - - # Call the delete_queue method. - result = client.delete_queue request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb deleted file mode 100644 index e140f2dd5bed..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the delete_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#delete_task. -# -def delete_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new - - # Call the delete_task method. - result = client.delete_task request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb deleted file mode 100644 index 1c993e8e0b61..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the get_iam_policy call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb deleted file mode 100644 index 5ec8ef1c332d..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the get_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#get_queue. -# -def get_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new - - # Call the get_queue method. - result = client.get_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb deleted file mode 100644 index a4511bfe5be7..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the get_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#get_task. -# -def get_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new - - # Call the get_task method. - result = client.get_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb deleted file mode 100644 index 20aec0526b69..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the lease_tasks call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#lease_tasks. -# -def lease_tasks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new - - # Call the lease_tasks method. - result = client.lease_tasks request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb deleted file mode 100644 index 0338b25067c5..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the list_queues call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#list_queues. -# -def list_queues - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new - - # Call the list_queues method. - result = client.list_queues 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::Tasks::V2beta2::Queue. - p item - end -end -# [END cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb deleted file mode 100644 index a88f6c92ccec..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the list_tasks call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#list_tasks. -# -def list_tasks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new - - # Call the list_tasks method. - result = client.list_tasks 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::Tasks::V2beta2::Task. - p item - end -end -# [END cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb deleted file mode 100644 index f37d59216de0..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the pause_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#pause_queue. -# -def pause_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new - - # Call the pause_queue method. - result = client.pause_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb deleted file mode 100644 index 8e55f1adbd2b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the purge_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#purge_queue. -# -def purge_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new - - # Call the purge_queue method. - result = client.purge_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb deleted file mode 100644 index c73fde9eddb4..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the renew_lease call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#renew_lease. -# -def renew_lease - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new - - # Call the renew_lease method. - result = client.renew_lease request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb deleted file mode 100644 index d2636e095fa1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the resume_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#resume_queue. -# -def resume_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new - - # Call the resume_queue method. - result = client.resume_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb deleted file mode 100644 index e68873afd93c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the run_task call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#run_task. -# -def run_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new - - # Call the run_task method. - result = client.run_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb deleted file mode 100644 index 9ceb07ceada7..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the set_iam_policy call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb deleted file mode 100644 index eb20412a5689..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the test_iam_permissions call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb deleted file mode 100644 index 1811e14dc6e7..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the update_queue call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#update_queue. -# -def update_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new - - # Call the update_queue method. - result = client.update_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb deleted file mode 100644 index affb52517a64..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/cloud_tasks/upload_queue_yaml.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync] -require "google/cloud/tasks/v2beta2" - -## -# Snippet for the upload_queue_yaml call in the CloudTasks 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::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml. -# -def upload_queue_yaml - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new - - # Call the upload_queue_yaml method. - result = client.upload_queue_yaml request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json b/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json deleted file mode 100644 index cc2f4452567f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json +++ /dev/null @@ -1,855 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-tasks-v2beta2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.tasks.v2beta2", - "version": "v2beta2" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync", - "title": "Snippet for the list_queues call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues.", - "file": "cloud_tasks/list_queues.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_queues", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::ListQueuesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::ListQueuesResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "ListQueues", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.ListQueues", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync", - "title": "Snippet for the get_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue.", - "file": "cloud_tasks/get_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_queue", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::GetQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "GetQueue", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.GetQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync", - "title": "Snippet for the create_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue.", - "file": "cloud_tasks/create_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_queue", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::CreateQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "CreateQueue", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.CreateQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync", - "title": "Snippet for the update_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue.", - "file": "cloud_tasks/update_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_queue", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "UpdateQueue", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync", - "title": "Snippet for the delete_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue.", - "file": "cloud_tasks/delete_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_queue", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "DeleteQueue", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync", - "title": "Snippet for the purge_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue.", - "file": "cloud_tasks/purge_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_queue", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "PurgeQueue", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync", - "title": "Snippet for the pause_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue.", - "file": "cloud_tasks/pause_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_queue", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::PauseQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "PauseQueue", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.PauseQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync", - "title": "Snippet for the resume_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue.", - "file": "cloud_tasks/resume_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_queue", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "ResumeQueue", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_UploadQueueYaml_sync", - "title": "Snippet for the upload_queue_yaml call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml.", - "file": "cloud_tasks/upload_queue_yaml.rb", - "language": "RUBY", - "client_method": { - "short_name": "upload_queue_yaml", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#upload_queue_yaml", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "UploadQueueYaml", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.UploadQueueYaml", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_iam_policy.", - "file": "cloud_tasks/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicy", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#set_iam_policy.", - "file": "cloud_tasks/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicy", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#test_iam_permissions.", - "file": "cloud_tasks/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissions", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync", - "title": "Snippet for the list_tasks call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks.", - "file": "cloud_tasks/list_tasks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tasks", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::ListTasksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::ListTasksResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "ListTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.ListTasks", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync", - "title": "Snippet for the get_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task.", - "file": "cloud_tasks/get_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_task", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::GetTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "GetTask", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.GetTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync", - "title": "Snippet for the create_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task.", - "file": "cloud_tasks/create_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_task", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::CreateTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "CreateTask", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.CreateTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync", - "title": "Snippet for the delete_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task.", - "file": "cloud_tasks/delete_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_task", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "DeleteTask", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.DeleteTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync", - "title": "Snippet for the lease_tasks call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks.", - "file": "cloud_tasks/lease_tasks.rb", - "language": "RUBY", - "client_method": { - "short_name": "lease_tasks", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "LeaseTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync", - "title": "Snippet for the acknowledge_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task.", - "file": "cloud_tasks/acknowledge_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "acknowledge_task", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "AcknowledgeTask", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync", - "title": "Snippet for the renew_lease call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease.", - "file": "cloud_tasks/renew_lease.rb", - "language": "RUBY", - "client_method": { - "short_name": "renew_lease", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "RenewLease", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.RenewLease", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync", - "title": "Snippet for the cancel_lease call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease.", - "file": "cloud_tasks/cancel_lease.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_lease", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "CancelLease", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.CancelLease", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync", - "title": "Snippet for the run_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task.", - "file": "cloud_tasks/run_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_task", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta2::RunTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta2::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta2::CloudTasks::Client" - }, - "method": { - "short_name": "RunTask", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks.RunTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - }, - "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-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb deleted file mode 100644 index 898df1868940..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloud_tasks" - -class ::Google::Cloud::Tasks::V2beta2::CloudTasks::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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::Tasks::V2beta2::CloudTasks::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_queue_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.queue_path project: "value0", location: "value1", queue: "value2" - assert_equal "projects/value0/locations/value1/queues/value2", path - end - end - - def test_task_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.task_path project: "value0", location: "value1", queue: "value2", task: "value3" - assert_equal "projects/value0/locations/value1/queues/value2/tasks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb deleted file mode 100644 index adc077978678..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_rest_test.rb +++ /dev/null @@ -1,1207 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" -require "google/cloud/tasks/v2beta2/cloud_tasks/rest" - - -class ::Google::Cloud::Tasks::V2beta2::CloudTasks::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_queues - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - read_mask = {} - - list_queues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_list_queues_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_queues_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_queues ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_queues(::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_queues_client_stub.call_count - end - end - end - - def test_get_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - read_mask = {} - - get_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_get_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_queue({ name: name, read_mask: read_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_queue name: name, read_mask: read_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_queue ::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_queue({ name: name, read_mask: read_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_queue(::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_queue_client_stub.call_count - end - end - end - - def test_create_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - queue = {} - - create_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_create_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_queue({ parent: parent, queue: queue }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_queue parent: parent, queue: queue do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_queue ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_queue({ parent: parent, queue: queue }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_queue(::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_queue_client_stub.call_count - end - end - end - - def test_update_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - queue = {} - update_mask = {} - - update_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_update_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_queue({ queue: queue, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_queue queue: queue, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_queue ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_queue({ queue: queue, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_queue(::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_queue_client_stub.call_count - end - end - end - - def test_delete_queue - # 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_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_queue ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_queue(::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_queue_client_stub.call_count - end - end - end - - def test_purge_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - purge_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_purge_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_queue ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_queue(::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_queue_client_stub.call_count - end - end - end - - def test_pause_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_pause_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_queue ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_queue(::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_queue_client_stub.call_count - end - end - end - - def test_resume_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_resume_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_queue ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_queue(::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_queue_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_list_tasks - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - response_view = :VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tasks({ parent: parent, response_view: response_view, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tasks parent: parent, response_view: response_view, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tasks ::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_count - end - end - end - - def test_get_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - response_view = :VIEW_UNSPECIFIED - - get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_task({ name: name, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_task name: name, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_task ::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_task({ name: name, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_count - end - end - end - - def test_create_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - task = {} - response_view = :VIEW_UNSPECIFIED - - create_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_create_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_task({ parent: parent, task: task, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_task parent: parent, task: task, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_task ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_task({ parent: parent, task: task, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_task(::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_task_client_stub.call_count - end - end - end - - def test_delete_task - # 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_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_delete_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_task({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_task name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_task ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_task({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_task(::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_task_client_stub.call_count - end - end - end - - def test_lease_tasks - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - max_tasks = 42 - lease_duration = {} - response_view = :VIEW_UNSPECIFIED - filter = "hello world" - - lease_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_lease_tasks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, lease_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.lease_tasks parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.lease_tasks ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.lease_tasks(::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, lease_tasks_client_stub.call_count - end - end - end - - def test_acknowledge_task - # 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" - schedule_time = {} - - acknowledge_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_acknowledge_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, acknowledge_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.acknowledge_task({ name: name, schedule_time: schedule_time }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.acknowledge_task name: name, schedule_time: schedule_time do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.acknowledge_task ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.acknowledge_task({ name: name, schedule_time: schedule_time }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.acknowledge_task(::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, acknowledge_task_client_stub.call_count - end - end - end - - def test_renew_lease - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - schedule_time = {} - lease_duration = {} - response_view = :VIEW_UNSPECIFIED - - renew_lease_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_renew_lease_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, renew_lease_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.renew_lease name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.renew_lease ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.renew_lease(::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, renew_lease_client_stub.call_count - end - end - end - - def test_cancel_lease - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - schedule_time = {} - response_view = :VIEW_UNSPECIFIED - - cancel_lease_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_cancel_lease_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_lease_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_lease name: name, schedule_time: schedule_time, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_lease ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.cancel_lease(::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, cancel_lease_client_stub.call_count - end - end - end - - def test_run_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta2::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - response_view = :VIEW_UNSPECIFIED - - run_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta2::CloudTasks::Rest::ServiceStub.stub :transcode_run_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_task({ name: name, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_task name: name, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_task ::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_task({ name: name, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_task(::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_task_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::Tasks::V2beta2::CloudTasks::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::Tasks::V2beta2::CloudTasks::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb deleted file mode 100644 index e8e1832596d6..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/google/cloud/tasks/v2beta2/cloud_tasks_test.rb +++ /dev/null @@ -1,1391 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta2/cloudtasks_pb" -require "google/cloud/tasks/v2beta2/cloud_tasks" - -class ::Google::Cloud::Tasks::V2beta2::CloudTasks::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_queues - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::ListQueuesResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - read_mask = {} - - list_queues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_queues, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_queues_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) 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_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask 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_queues ::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) 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_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, 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_queues(::Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), 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_queues_client_stub.call_rpc_count - end - end - - def test_get_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" - read_mask = {} - - get_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::GetQueueRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_queue({ name: name, read_mask: read_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_queue name: name, read_mask: read_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_queue ::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_queue({ name: name, read_mask: read_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_queue(::Google::Cloud::Tasks::V2beta2::GetQueueRequest.new(name: name, read_mask: read_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_queue_client_stub.call_rpc_count - end - end - - def test_create_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" - queue = {} - - create_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta2::Queue), request["queue"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_queue({ parent: parent, queue: queue }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_queue parent: parent, queue: queue do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_queue ::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_queue({ parent: parent, queue: queue }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_queue(::Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new(parent: parent, queue: queue), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_queue_client_stub.call_rpc_count - end - end - - def test_update_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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. - queue = {} - update_mask = {} - - update_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta2::Queue), request["queue"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_queue({ queue: queue, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_queue queue: queue, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_queue ::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, 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_queue({ queue: queue, 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_queue(::Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new(queue: queue, 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_queue_client_stub.call_rpc_count - end - end - - def test_delete_queue - # 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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_queue ::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_queue({ 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_queue(::Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.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_queue_client_stub.call_rpc_count - end - end - - def test_purge_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" - - purge_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_queue ::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_queue(::Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.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, purge_queue_client_stub.call_rpc_count - end - end - - def test_pause_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" - - pause_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_queue ::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pause_queue(::Google::Cloud::Tasks::V2beta2::PauseQueueRequest.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, pause_queue_client_stub.call_rpc_count - end - end - - def test_resume_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Queue.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" - - resume_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_queue ::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resume_queue(::Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.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, resume_queue_client_stub.call_rpc_count - end - end - - def test_upload_queue_yaml - # 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. - app_id = "hello world" - http_body = {} - - upload_queue_yaml_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :upload_queue_yaml, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest, request - assert_equal "hello world", request["app_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Api::HttpBody), request["http_body"] - assert request.has_http_body? - refute_nil options - end - - Gapic::ServiceStub.stub :new, upload_queue_yaml_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.upload_queue_yaml({ app_id: app_id, http_body: http_body }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.upload_queue_yaml app_id: app_id, http_body: http_body do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.upload_queue_yaml ::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new(app_id: app_id, http_body: http_body) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.upload_queue_yaml({ app_id: app_id, http_body: http_body }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.upload_queue_yaml(::Google::Cloud::Tasks::V2beta2::UploadQueueYamlRequest.new(app_id: app_id, http_body: http_body), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, upload_queue_yaml_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_list_tasks - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::ListTasksResponse.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" - response_view = :VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tasks, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::ListTasksRequest, request - assert_equal "hello world", request["parent"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tasks({ parent: parent, response_view: response_view, 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_tasks parent: parent, response_view: response_view, 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_tasks ::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta2::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_rpc_count - end - end - - def test_get_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" - response_view = :VIEW_UNSPECIFIED - - get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::GetTaskRequest, request - assert_equal "hello world", request["name"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_task({ name: name, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_task name: name, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_task ::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Tasks::V2beta2::GetTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_rpc_count - end - end - - def test_create_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" - task = {} - response_view = :VIEW_UNSPECIFIED - - create_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta2::Task), request["task"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_task({ parent: parent, task: task, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_task parent: parent, task: task, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_task ::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_task({ parent: parent, task: task, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_task(::Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_task_client_stub.call_rpc_count - end - end - - def test_delete_task - # 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_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_task({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_task name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_task ::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_task({ 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_task(::Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.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_task_client_stub.call_rpc_count - end - end - - def test_lease_tasks - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::LeaseTasksResponse.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" - max_tasks = 42 - lease_duration = {} - response_view = :VIEW_UNSPECIFIED - filter = "hello world" - - lease_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :lease_tasks, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["max_tasks"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["lease_duration"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, lease_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.lease_tasks parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.lease_tasks ::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.lease_tasks({ parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.lease_tasks(::Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new(parent: parent, max_tasks: max_tasks, lease_duration: lease_duration, response_view: response_view, filter: filter), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, lease_tasks_client_stub.call_rpc_count - end - end - - def test_acknowledge_task - # 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" - schedule_time = {} - - acknowledge_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :acknowledge_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, acknowledge_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.acknowledge_task({ name: name, schedule_time: schedule_time }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.acknowledge_task name: name, schedule_time: schedule_time do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.acknowledge_task ::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.acknowledge_task({ name: name, schedule_time: schedule_time }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.acknowledge_task(::Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new(name: name, schedule_time: schedule_time), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, acknowledge_task_client_stub.call_rpc_count - end - end - - def test_renew_lease - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" - schedule_time = {} - lease_duration = {} - response_view = :VIEW_UNSPECIFIED - - renew_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :renew_lease, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["lease_duration"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, renew_lease_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.renew_lease name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.renew_lease ::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.renew_lease({ name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.renew_lease(::Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new(name: name, schedule_time: schedule_time, lease_duration: lease_duration, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, renew_lease_client_stub.call_rpc_count - end - end - - def test_cancel_lease - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" - schedule_time = {} - response_view = :VIEW_UNSPECIFIED - - cancel_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_lease, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_lease_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_lease name: name, schedule_time: schedule_time, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_lease ::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_lease({ name: name, schedule_time: schedule_time, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_lease(::Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new(name: name, schedule_time: schedule_time, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_lease_client_stub.call_rpc_count - end - end - - def test_run_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta2::Task.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" - response_view = :VIEW_UNSPECIFIED - - run_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta2::RunTaskRequest, request - assert_equal "hello world", request["name"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_task({ name: name, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_task name: name, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_task ::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_task(::Google::Cloud::Tasks::V2beta2::RunTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_task_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::Tasks::V2beta2::CloudTasks::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::Tasks::V2beta2::CloudTasks::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Tasks::V2beta2::CloudTasks::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb b/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/.gitignore b/owl-bot-staging/google-cloud-tasks-v2beta3/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/.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-tasks-v2beta3/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta3/.repo-metadata.json deleted file mode 100644 index 1acb6f32f0fe..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudtasks.googleapis.com", - "api_shortname": "cloudtasks", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta3/latest", - "distribution_name": "google-cloud-tasks-v2beta3", - "is_cloud": true, - "language": "ruby", - "name": "cloudtasks", - "name_pretty": "Cloud Tasks V2beta3 API", - "product_documentation": "https://cloud.google.com/tasks", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TASKS", - "ruby-cloud-product-url": "https://cloud.google.com/tasks", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml b/owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml deleted file mode 100644 index da9d8f7ee985..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-tasks-v2beta3.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-tasks-v2beta3.rb" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/.yardopts b/owl-bot-staging/google-cloud-tasks-v2beta3/.yardopts deleted file mode 100644 index 07f7a83a5822..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Tasks V2beta3 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-tasks-v2beta3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks-v2beta3/AUTHENTICATION.md deleted file mode 100644 index 8a26642ba1e1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-tasks-v2beta3 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-tasks-v2beta3 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/tasks/v2beta3" - -client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/tasks/v2beta3" - -::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::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-tasks-v2beta3 -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/tasks/v2beta3" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::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-tasks-v2beta3/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks-v2beta3/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-tasks-v2beta3/LICENSE.md b/owl-bot-staging/google-cloud-tasks-v2beta3/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/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-tasks-v2beta3/README.md b/owl-bot-staging/google-cloud-tasks-v2beta3/README.md deleted file mode 100644 index 410125fde32f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Tasks V2beta3 API - -Manages the execution of large numbers of distributed requests. - -Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. - -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 Tasks V2beta3 API. Most users should consider using -the main client gem, -[google-cloud-tasks](https://rubygems.org/gems/google-cloud-tasks). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-tasks-v2beta3 -``` - -## 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/cloudtasks.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/tasks/v2beta3" - -client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -request = ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new # (request fields as keyword arguments...) -response = client.list_queues request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2beta3/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/tasks) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/tasks/v2beta3" -require "logger" - -client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-tasks`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-tasks-v2beta3`. -_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-tasks`. -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-tasks-v2beta3`. - -### 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-tasks-v2beta3/Rakefile b/owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile deleted file mode 100644 index 9d14c39d473d..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TASKS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TASKS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/tasks/v2beta3/cloud_tasks/credentials" - ::Google::Cloud::Tasks::V2beta3::CloudTasks::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TASKS_PROJECT"] = project - ENV["TASKS_TEST_PROJECT"] = project - ENV["TASKS_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-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-tasks-v2beta3" - header "google-cloud-tasks-v2beta3 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-tasks-v2beta3 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3 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-tasks-v2beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json deleted file mode 100644 index d31c26024e7f..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/gapic_metadata.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.tasks.v2beta3", - "libraryPackage": "::Google::Cloud::Tasks::V2beta3", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client", - "rpcs": { - "ListQueues": { - "methods": [ - "list_queues" - ] - }, - "GetQueue": { - "methods": [ - "get_queue" - ] - }, - "CreateQueue": { - "methods": [ - "create_queue" - ] - }, - "UpdateQueue": { - "methods": [ - "update_queue" - ] - }, - "DeleteQueue": { - "methods": [ - "delete_queue" - ] - }, - "PurgeQueue": { - "methods": [ - "purge_queue" - ] - }, - "PauseQueue": { - "methods": [ - "pause_queue" - ] - }, - "ResumeQueue": { - "methods": [ - "resume_queue" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "ListTasks": { - "methods": [ - "list_tasks" - ] - }, - "GetTask": { - "methods": [ - "get_task" - ] - }, - "CreateTask": { - "methods": [ - "create_task" - ] - }, - "DeleteTask": { - "methods": [ - "delete_task" - ] - }, - "RunTask": { - "methods": [ - "run_task" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec b/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec deleted file mode 100644 index b069a59eb484..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/google-cloud-tasks-v2beta3.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/tasks/v2beta3/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-tasks-v2beta3" - gem.version = Google::Cloud::Tasks::V2beta3::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. Note that google-cloud-tasks-v2beta3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tasks instead. See the readme for more details." - gem.summary = "Manages the execution of large numbers of distributed requests." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb deleted file mode 100644 index dbe62c531a09..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google-cloud-tasks-v2beta3.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3" diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb deleted file mode 100644 index 4a4e1bf079bd..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloud_tasks" -require "google/cloud/tasks/v2beta3/version" - -module Google - module Cloud - module Tasks - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/tasks/v2beta3" - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/tasks/v2beta3" - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - module V2beta3 - end - end - end -end - -helper_path = ::File.join __dir__, "v2beta3", "_helpers.rb" -require "google/cloud/tasks/v2beta3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb deleted file mode 100644 index 52093b505354..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" - -module Google - module Cloud - module Tasks - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/tasks/v2beta3/rest" - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - module V2beta3 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Tasks"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2beta3/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb deleted file mode 100644 index ab36034a01a3..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/version" - -require "google/cloud/tasks/v2beta3/cloud_tasks/credentials" -require "google/cloud/tasks/v2beta3/cloud_tasks/paths" -require "google/cloud/tasks/v2beta3/cloud_tasks/client" -require "google/cloud/tasks/v2beta3/cloud_tasks/rest" - -module Google - module Cloud - module Tasks - module V2beta3 - ## - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/tasks/v2beta3/cloud_tasks" - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/tasks/v2beta3/cloud_tasks/rest" - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - module CloudTasks - end - end - end - end -end - -helper_path = ::File.join __dir__, "cloud_tasks", "helpers.rb" -require "google/cloud/tasks/v2beta3/cloud_tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb deleted file mode 100644 index 87441ecbb60b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/client.rb +++ /dev/null @@ -1,2277 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" -require "google/cloud/location" - -module Google - module Cloud - module Tasks - module V2beta3 - module CloudTasks - ## - # Client for the CloudTasks service. - # - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_tasks_stub - - ## - # Configure the CloudTasks Client class. - # - # See {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudTasks clients - # ::Google::Cloud::Tasks::V2beta3::CloudTasks::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", "Tasks", "V2beta3"] - 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.list_queues.timeout = 20.0 - default_config.rpcs.list_queues.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_queue.timeout = 20.0 - default_config.rpcs.get_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_queue.timeout = 20.0 - - default_config.rpcs.update_queue.timeout = 20.0 - - default_config.rpcs.delete_queue.timeout = 20.0 - default_config.rpcs.delete_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.purge_queue.timeout = 20.0 - - default_config.rpcs.pause_queue.timeout = 20.0 - - default_config.rpcs.resume_queue.timeout = 20.0 - - default_config.rpcs.get_iam_policy.timeout = 20.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.set_iam_policy.timeout = 20.0 - - default_config.rpcs.test_iam_permissions.timeout = 20.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tasks.timeout = 20.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_task.timeout = 20.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_task.timeout = 20.0 - - default_config.rpcs.delete_task.timeout = 20.0 - default_config.rpcs.delete_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_task.timeout = 20.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudTasks 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::Tasks::V2beta3::CloudTasks::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 - @cloud_tasks_stub.universe_domain - end - - ## - # Create a new CloudTasks client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudTasks 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/tasks/v2beta3/cloudtasks_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 - - @cloud_tasks_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Tasks::V2beta3::CloudTasks::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, - logger: @config.logger - ) - - @cloud_tasks_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_tasks_stub.endpoint - config.universe_domain = @cloud_tasks_stub.universe_domain - config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_tasks_stub.logger - end - - # Service calls - - ## - # Lists queues. - # - # Queues are returned in lexicographical order. - # - # @overload list_queues(request, options = nil) - # Pass arguments to `list_queues` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) - # Pass arguments to `list_queues` via keyword arguments. Note that at - # least one keyword argument is 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 location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @param filter [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "state: PAUSED". - # - # Note that using filters might cause fewer queues than the - # requested page_size to be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} method. It - # is an error to switch the value of the - # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while - # iterating through pages. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new - # - # # Call the list_queues method. - # result = client.list_queues 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::Tasks::V2beta3::Queue. - # p item - # end - # - def list_queues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest - - # Converts hash 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_queues.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::Tasks::V2beta3::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_queues.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_queues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :list_queues, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_queues, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a queue. - # - # @overload get_queue(request, options = nil) - # Pass arguments to `get_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::GetQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::GetQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) - # Pass arguments to `get_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new - # - # # Call the get_queue method. - # result = client.get_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def get_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload create_queue(request, options = nil) - # Pass arguments to `create_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::CreateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) - # Pass arguments to `create_queue` via keyword arguments. Note that at - # least one keyword argument is 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 location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - # an existing queue. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new - # - # # Call the create_queue method. - # result = client.create_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def create_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :create_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload update_queue(request, options = nil) - # Pass arguments to `update_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) - # Pass arguments to `update_queue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be - # specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be - # changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new - # - # # Call the update_queue method. - # result = client.update_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def update_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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.queue&.name - header_params["queue.name"] = request.queue.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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :update_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload delete_queue(request, options = nil) - # Pass arguments to `delete_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `delete_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new - # - # # Call the delete_queue method. - # result = client.delete_queue request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :delete_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - # - # @overload purge_queue(request, options = nil) - # Pass arguments to `purge_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_queue(name: nil) - # Pass arguments to `purge_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new - # - # # Call the purge_queue method. - # result = client.purge_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def purge_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest - - # Converts hash 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.purge_queue.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::Tasks::V2beta3::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.purge_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :purge_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. Tasks can - # still be added when the queue is paused. A queue is paused if its - # {::Google::Cloud::Tasks::V2beta3::Queue#state state} is - # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. - # - # @overload pause_queue(request, options = nil) - # Pass arguments to `pause_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::PauseQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_queue(name: nil) - # Pass arguments to `pause_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new - # - # # Call the pause_queue method. - # result = client.pause_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def pause_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest - - # Converts hash 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.pause_queue.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::Tasks::V2beta3::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.pause_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :pause_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a queue. - # - # This method resumes a queue after it has been - # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED} or - # {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a - # queue is stored in the queue's - # {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method - # it will be set to - # {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - # - # @overload resume_queue(request, options = nil) - # Pass arguments to `resume_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_queue(name: nil) - # Pass arguments to `resume_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new - # - # # Call the resume_queue method. - # result = client.resume_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def resume_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest - - # Converts hash 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.resume_queue.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::Tasks::V2beta3::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.resume_queue.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :resume_queue, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a - # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Returns an empty policy if the - # resource exists and does not have a policy set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_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::Tasks::V2beta3::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.resource - header_params["resource"] = request.resource - 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_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy for a - # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_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::Tasks::V2beta3::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.resource - header_params["resource"] = request.resource - 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.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on a - # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. If the resource does not exist, - # this will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Tasks::V2beta3::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.resource - header_params["resource"] = request.resource - 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.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the tasks in a queue. - # - # By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC} - # view is retrieved due to performance considerations; - # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view} - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # @param page_size [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks 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::Tasks::V2beta3::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListTasksRequest - - # Converts hash 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_tasks.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::Tasks::V2beta3::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_tasks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :get_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * The maximum task size is 100KB. - # - # @overload create_task(request, options = nil) - # Pass arguments to `create_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::CreateTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) - # Pass arguments to `create_task` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task [::Google::Cloud::Tasks::V2beta3::Task, ::Hash] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified - # then the system will generate a random unique task id, which will be set in - # the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not - # set or is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or executed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1 hour after the original task was - # deleted or executed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9 days after the original task was deleted or executed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new - # - # # Call the create_task method. - # result = client.create_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - # p result - # - def create_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :create_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has executed successfully or permanently - # failed. - # - # @overload delete_task(request, options = nil) - # Pass arguments to `delete_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil) - # Pass arguments to `delete_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new - # - # # Call the delete_task method. - # result = client.delete_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :delete_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or is - # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. - # - # This command is meant to be used for manual debugging. For - # example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} can be - # used to retry a failed task after a fix has been made or to manually force - # a task to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the [status][Task.status] after the task is dispatched but - # before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be - # reset to the time that - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} was called plus - # the retry delay specified in the queue's - # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}. - # - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask} returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - # - # @overload run_task(request, options = nil) - # Pass arguments to `run_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::RunTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::RunTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_task(name: nil, response_view: nil) - # Pass arguments to `run_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tasks::V2beta3::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new - # - # # Call the run_task method. - # result = client.run_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - # p result - # - def run_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::RunTaskRequest - - # Converts hash 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.run_task.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::Tasks::V2beta3::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.run_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.call_rpc :run_task, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudTasks API. - # - # This class represents the configuration for CloudTasks, - # 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::Tasks::V2beta3::CloudTasks::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_queues to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CloudTasks 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_queues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_queues - ## - # RPC-specific configuration for `get_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_queue - ## - # RPC-specific configuration for `create_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_queue - ## - # RPC-specific configuration for `update_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_queue - ## - # RPC-specific configuration for `delete_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_queue - ## - # RPC-specific configuration for `purge_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_queue - ## - # RPC-specific configuration for `pause_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_queue - ## - # RPC-specific configuration for `resume_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_queue - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `create_task` - # @return [::Gapic::Config::Method] - # - attr_reader :create_task - ## - # RPC-specific configuration for `delete_task` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_task - ## - # RPC-specific configuration for `run_task` - # @return [::Gapic::Config::Method] - # - attr_reader :run_task - - # @private - def initialize parent_rpcs = nil - list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues - @list_queues = ::Gapic::Config::Method.new list_queues_config - get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue - @get_queue = ::Gapic::Config::Method.new get_queue_config - create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue - @create_queue = ::Gapic::Config::Method.new create_queue_config - update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue - @update_queue = ::Gapic::Config::Method.new update_queue_config - delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue - @delete_queue = ::Gapic::Config::Method.new delete_queue_config - purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue - @purge_queue = ::Gapic::Config::Method.new purge_queue_config - pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue - @pause_queue = ::Gapic::Config::Method.new pause_queue_config - resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue - @resume_queue = ::Gapic::Config::Method.new resume_queue_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task - @create_task = ::Gapic::Config::Method.new create_task_config - delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task - @delete_task = ::Gapic::Config::Method.new delete_task_config - run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task - @run_task = ::Gapic::Config::Method.new run_task_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb deleted file mode 100644 index 3bccd23bae21..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta3 - module CloudTasks - # Credentials for the CloudTasks API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "TASKS_CREDENTIALS", - "TASKS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TASKS_CREDENTIALS_JSON", - "TASKS_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-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb deleted file mode 100644 index eecb06ef35df..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/paths.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta3 - module CloudTasks - # Path helper methods for the CloudTasks 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 Queue resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/queues/{queue}` - # - # @param project [String] - # @param location [String] - # @param queue [String] - # - # @return [::String] - def queue_path project:, location:, queue: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/queues/#{queue}" - end - - ## - # Create a fully-qualified Task resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/queues/{queue}/tasks/{task}` - # - # @param project [String] - # @param location [String] - # @param queue [String] - # @param task [String] - # - # @return [::String] - def task_path project:, location:, queue:, task: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "queue cannot contain /" if queue.to_s.include? "/" - - "projects/#{project}/locations/#{location}/queues/#{queue}/tasks/#{task}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb deleted file mode 100644 index b443ca9c286e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/version" -require "google/cloud/tasks/v2beta3/bindings_override" - -require "google/cloud/tasks/v2beta3/cloud_tasks/credentials" -require "google/cloud/tasks/v2beta3/cloud_tasks/paths" -require "google/cloud/tasks/v2beta3/cloud_tasks/rest/client" - -module Google - module Cloud - module Tasks - module V2beta3 - ## - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/tasks/v2beta3/cloud_tasks/rest" - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - module CloudTasks - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/tasks/v2beta3/cloud_tasks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb deleted file mode 100644 index 0c27095bec5c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/client.rb +++ /dev/null @@ -1,2130 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" -require "google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Tasks - module V2beta3 - module CloudTasks - module Rest - ## - # REST client for the CloudTasks service. - # - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtasks.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cloud_tasks_stub - - ## - # Configure the CloudTasks Client class. - # - # See {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all CloudTasks clients - # ::Google::Cloud::Tasks::V2beta3::CloudTasks::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", "Tasks", "V2beta3"] - 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.list_queues.timeout = 20.0 - default_config.rpcs.list_queues.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_queue.timeout = 20.0 - default_config.rpcs.get_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_queue.timeout = 20.0 - - default_config.rpcs.update_queue.timeout = 20.0 - - default_config.rpcs.delete_queue.timeout = 20.0 - default_config.rpcs.delete_queue.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.purge_queue.timeout = 20.0 - - default_config.rpcs.pause_queue.timeout = 20.0 - - default_config.rpcs.resume_queue.timeout = 20.0 - - default_config.rpcs.get_iam_policy.timeout = 20.0 - default_config.rpcs.get_iam_policy.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.set_iam_policy.timeout = 20.0 - - default_config.rpcs.test_iam_permissions.timeout = 20.0 - default_config.rpcs.test_iam_permissions.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_tasks.timeout = 20.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_task.timeout = 20.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_task.timeout = 20.0 - - default_config.rpcs.delete_task.timeout = 20.0 - default_config.rpcs.delete_task.retry_policy = { - initial_delay: 0.1, max_delay: 10.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.run_task.timeout = 20.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the CloudTasks 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::Tasks::V2beta3::CloudTasks::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 - @cloud_tasks_stub.universe_domain - end - - ## - # Create a new CloudTasks REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the CloudTasks 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 - - @cloud_tasks_stub = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @cloud_tasks_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cloud_tasks_stub.endpoint - config.universe_domain = @cloud_tasks_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @cloud_tasks_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @cloud_tasks_stub.logger - end - - # Service calls - - ## - # Lists queues. - # - # Queues are returned in lexicographical order. - # - # @overload list_queues(request, options = nil) - # Pass arguments to `list_queues` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queues(parent: nil, filter: nil, page_size: nil, page_token: nil, read_mask: nil) - # Pass arguments to `list_queues` via keyword arguments. Note that at - # least one keyword argument is 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 location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @param filter [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "state: PAUSED". - # - # Note that using filters might cause fewer queues than the - # requested page_size to be returned. - # @param page_size [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#list_queues ListQueues} method. It - # is an error to switch the value of the - # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while - # iterating through pages. - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Queue>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new - # - # # Call the list_queues method. - # result = client.list_queues 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::Tasks::V2beta3::Queue. - # p item - # end - # - def list_queues request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest - - # Converts hash 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_queues.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::Tasks::V2beta3::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_queues.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_queues.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.list_queues request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_queues, "queues", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a queue. - # - # @overload get_queue(request, options = nil) - # Pass arguments to `get_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::GetQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::GetQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil, read_mask: nil) - # Pass arguments to `get_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param read_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new - # - # # Call the get_queue method. - # result = client.get_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def get_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload create_queue(request, options = nil) - # Pass arguments to `create_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::CreateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(parent: nil, queue: nil) - # Pass arguments to `create_queue` via keyword arguments. Note that at - # least one keyword argument is 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 location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - # an existing queue. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new - # - # # Call the create_queue method. - # result = client.create_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def create_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.create_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload update_queue(request, options = nil) - # Pass arguments to `update_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(queue: nil, update_mask: nil) - # Pass arguments to `update_queue` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param queue [::Google::Cloud::Tasks::V2beta3::Queue, ::Hash] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be - # specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be - # changed. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new - # - # # Call the update_queue method. - # result = client.update_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def update_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.update_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - # - # @overload delete_queue(request, options = nil) - # Pass arguments to `delete_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_queue(name: nil) - # Pass arguments to `delete_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_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/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new - # - # # Call the delete_queue method. - # result = client.delete_queue request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest - - # Converts hash 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_queue.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::Tasks::V2beta3::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_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.delete_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - # - # @overload purge_queue(request, options = nil) - # Pass arguments to `purge_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_queue(name: nil) - # Pass arguments to `purge_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new - # - # # Call the purge_queue method. - # result = client.purge_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def purge_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest - - # Converts hash 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.purge_queue.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::Tasks::V2beta3::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.purge_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.purge_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#resume_queue ResumeQueue}. Tasks can - # still be added when the queue is paused. A queue is paused if its - # {::Google::Cloud::Tasks::V2beta3::Queue#state state} is - # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. - # - # @overload pause_queue(request, options = nil) - # Pass arguments to `pause_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::PauseQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_queue(name: nil) - # Pass arguments to `pause_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new - # - # # Call the pause_queue method. - # result = client.pause_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def pause_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest - - # Converts hash 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.pause_queue.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::Tasks::V2beta3::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.pause_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.pause_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resume a queue. - # - # This method resumes a queue after it has been - # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED} or - # {::Google::Cloud::Tasks::V2beta3::Queue::State::DISABLED DISABLED}. The state of a - # queue is stored in the queue's - # {::Google::Cloud::Tasks::V2beta3::Queue#state state}; after calling this method - # it will be set to - # {::Google::Cloud::Tasks::V2beta3::Queue::State::RUNNING RUNNING}. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - # - # @overload resume_queue(request, options = nil) - # Pass arguments to `resume_queue` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_queue(name: nil) - # Pass arguments to `resume_queue` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new - # - # # Call the resume_queue method. - # result = client.resume_queue request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - # p result - # - def resume_queue request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest - - # Converts hash 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.resume_queue.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::Tasks::V2beta3::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.resume_queue.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_queue.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.resume_queue request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a - # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Returns an empty policy if the - # resource exists and does not have a policy set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_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::Tasks::V2beta3::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_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy for a - # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_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 resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_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::Tasks::V2beta3::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.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on a - # {::Google::Cloud::Tasks::V2beta3::Queue Queue}. If the resource does not exist, - # this will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Tasks::V2beta3::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.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the tasks in a queue. - # - # By default, only the {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC} - # view is retrieved due to performance considerations; - # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#response_view response_view} - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tasks(parent: nil, response_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # @param page_size [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @param page_token [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Tasks::V2beta3::Task>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks 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::Tasks::V2beta3::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::ListTasksRequest - - # Converts hash 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_tasks.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::Tasks::V2beta3::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_tasks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.list_tasks request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cloud_tasks_stub, :list_tasks, "tasks", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil, response_view: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::GetTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.get_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * The maximum task size is 100KB. - # - # @overload create_task(request, options = nil) - # Pass arguments to `create_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::CreateTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(parent: nil, task: nil, response_view: nil) - # Pass arguments to `create_task` via keyword arguments. Note that at - # least one keyword argument is 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 queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @param task [::Google::Cloud::Tasks::V2beta3::Task, ::Hash] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified - # then the system will generate a random unique task id, which will be set in - # the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not - # set or is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or executed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1 hour after the original task was - # deleted or executed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9 days after the original task was deleted or executed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new - # - # # Call the create_task method. - # result = client.create_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - # p result - # - def create_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.create_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has executed successfully or permanently - # failed. - # - # @overload delete_task(request, options = nil) - # Pass arguments to `delete_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_task(name: nil) - # Pass arguments to `delete_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new - # - # # Call the delete_task method. - # result = client.delete_task request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest - - # Converts hash 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_task.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::Tasks::V2beta3::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_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.delete_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits} or is - # {::Google::Cloud::Tasks::V2beta3::Queue::State::PAUSED PAUSED}. - # - # This command is meant to be used for manual debugging. For - # example, {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} can be - # used to retry a failed task after a fix has been made or to manually force - # a task to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the [status][Task.status] after the task is dispatched but - # before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} will be - # reset to the time that - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} was called plus - # the retry delay specified in the queue's - # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}. - # - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client#run_task RunTask} returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - # - # @overload run_task(request, options = nil) - # Pass arguments to `run_task` via a request object, either of type - # {::Google::Cloud::Tasks::V2beta3::RunTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tasks::V2beta3::RunTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_task(name: nil, response_view: nil) - # Pass arguments to `run_task` via keyword arguments. Note that at - # least one keyword argument is 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 task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @param response_view [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Tasks::V2beta3::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/tasks/v2beta3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new - # - # # Call the run_task method. - # result = client.run_task request - # - # # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - # p result - # - def run_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tasks::V2beta3::RunTaskRequest - - # Converts hash 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.run_task.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::Tasks::V2beta3::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.run_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cloud_tasks_stub.run_task request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the CloudTasks REST API. - # - # This class represents the configuration for CloudTasks 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::Tasks::V2beta3::CloudTasks::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_queues to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_queues.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtasks.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 CloudTasks 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_queues` - # @return [::Gapic::Config::Method] - # - attr_reader :list_queues - ## - # RPC-specific configuration for `get_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :get_queue - ## - # RPC-specific configuration for `create_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :create_queue - ## - # RPC-specific configuration for `update_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :update_queue - ## - # RPC-specific configuration for `delete_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_queue - ## - # RPC-specific configuration for `purge_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_queue - ## - # RPC-specific configuration for `pause_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_queue - ## - # RPC-specific configuration for `resume_queue` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_queue - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `create_task` - # @return [::Gapic::Config::Method] - # - attr_reader :create_task - ## - # RPC-specific configuration for `delete_task` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_task - ## - # RPC-specific configuration for `run_task` - # @return [::Gapic::Config::Method] - # - attr_reader :run_task - - # @private - def initialize parent_rpcs = nil - list_queues_config = parent_rpcs.list_queues if parent_rpcs.respond_to? :list_queues - @list_queues = ::Gapic::Config::Method.new list_queues_config - get_queue_config = parent_rpcs.get_queue if parent_rpcs.respond_to? :get_queue - @get_queue = ::Gapic::Config::Method.new get_queue_config - create_queue_config = parent_rpcs.create_queue if parent_rpcs.respond_to? :create_queue - @create_queue = ::Gapic::Config::Method.new create_queue_config - update_queue_config = parent_rpcs.update_queue if parent_rpcs.respond_to? :update_queue - @update_queue = ::Gapic::Config::Method.new update_queue_config - delete_queue_config = parent_rpcs.delete_queue if parent_rpcs.respond_to? :delete_queue - @delete_queue = ::Gapic::Config::Method.new delete_queue_config - purge_queue_config = parent_rpcs.purge_queue if parent_rpcs.respond_to? :purge_queue - @purge_queue = ::Gapic::Config::Method.new purge_queue_config - pause_queue_config = parent_rpcs.pause_queue if parent_rpcs.respond_to? :pause_queue - @pause_queue = ::Gapic::Config::Method.new pause_queue_config - resume_queue_config = parent_rpcs.resume_queue if parent_rpcs.respond_to? :resume_queue - @resume_queue = ::Gapic::Config::Method.new resume_queue_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task - @create_task = ::Gapic::Config::Method.new create_task_config - delete_task_config = parent_rpcs.delete_task if parent_rpcs.respond_to? :delete_task - @delete_task = ::Gapic::Config::Method.new delete_task_config - run_task_config = parent_rpcs.run_task if parent_rpcs.respond_to? :run_task - @run_task = ::Gapic::Config::Method.new run_task_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb deleted file mode 100644 index 769a0336a270..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloud_tasks/rest/service_stub.rb +++ /dev/null @@ -1,1067 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" - -module Google - module Cloud - module Tasks - module V2beta3 - module CloudTasks - module Rest - ## - # REST service stub for the CloudTasks service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_queues REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest] - # 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::Tasks::V2beta3::ListQueuesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::ListQueuesResponse] - # A result object deserialized from the server's reply - def list_queues request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_queues_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, - method_name: "list_queues", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetQueueRequest] - # 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::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # A result object deserialized from the server's reply - def get_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_queue_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, - method_name: "get_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest] - # 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::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # A result object deserialized from the server's reply - def create_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_queue_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, - method_name: "create_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest] - # 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::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # A result object deserialized from the server's reply - def update_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_queue_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, - method_name: "update_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest] - # 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_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_queue_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, - method_name: "delete_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the purge_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest] - # 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::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # A result object deserialized from the server's reply - def purge_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_queue_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, - method_name: "purge_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the pause_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest] - # 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::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # A result object deserialized from the server's reply - def pause_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_queue_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, - method_name: "pause_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the resume_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest] - # 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::Tasks::V2beta3::Queue] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # A result object deserialized from the server's reply - def resume_queue request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_queue_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, - method_name: "resume_queue", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Queue.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_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, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_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, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # 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::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListTasksRequest] - # 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::Tasks::V2beta3::ListTasksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::ListTasksResponse] - # A result object deserialized from the server's reply - def list_tasks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_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, - method_name: "list_tasks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetTaskRequest] - # 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::Tasks::V2beta3::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # A result object deserialized from the server's reply - def get_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_task_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, - method_name: "get_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest] - # 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::Tasks::V2beta3::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # A result object deserialized from the server's reply - def create_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_task_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, - method_name: "create_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest] - # 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_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_task_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, - method_name: "delete_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the run_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::RunTaskRequest] - # 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::Tasks::V2beta3::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # A result object deserialized from the server's reply - def run_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_task_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, - method_name: "run_task", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Tasks::V2beta3::Task.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_queues REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListQueuesRequest] - # 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_queues_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta3/{parent}/queues", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{parent}/queues", - body: "queue", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2beta3/{queue.name}", - body: "queue", - matches: [ - ["queue.name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest] - # 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_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{name}:purge", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::PauseQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{name}:pause", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_queue REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_queue_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{name}:resume", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::ListTasksRequest] - # 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_tasks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta3/{parent}/tasks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::GetTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::CreateTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{parent}/tasks", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest] - # 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_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2beta3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_task REST call - # - # @param request_pb [::Google::Cloud::Tasks::V2beta3::RunTaskRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2beta3/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/queues/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb deleted file mode 100644 index 0ee60de3f77c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb +++ /dev/null @@ -1,70 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta3/cloudtasks.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/tasks/v2beta3/queue_pb' -require 'google/cloud/tasks/v2beta3/task_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n+google/cloud/tasks/v2beta3/cloudtasks.proto\x12\x1agoogle.cloud.tasks.v2beta3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/tasks/v2beta3/queue.proto\x1a%google/cloud/tasks/v2beta3/task.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xb7\x01\n\x11ListQueuesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x32\n\tread_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"`\n\x12ListQueuesResponse\x12\x31\n\x06queues\x18\x01 \x03(\x0b\x32!.google.cloud.tasks.v2beta3.Queue\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"|\n\x0fGetQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x32\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x84\x01\n\x12\x43reateQueueRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x63loudtasks.googleapis.com/Queue\x12\x35\n\x05queue\x18\x02 \x01(\x0b\x32!.google.cloud.tasks.v2beta3.QueueB\x03\xe0\x41\x02\"|\n\x12UpdateQueueRequest\x12\x35\n\x05queue\x18\x01 \x01(\x0b\x32!.google.cloud.tasks.v2beta3.QueueB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x12\x44\x65leteQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PurgeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"J\n\x11PauseQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"K\n\x12ResumeQueueRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63loudtasks.googleapis.com/Queue\"\xaf\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"]\n\x11ListTasksResponse\x12/\n\x05tasks\x18\x01 \x03(\x0b\x32 .google.cloud.tasks.v2beta3.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x84\x01\n\x0eGetTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\"\xbe\x01\n\x11\x43reateTaskRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63loudtasks.googleapis.com/Task\x12\x33\n\x04task\x18\x02 \x01(\x0b\x32 .google.cloud.tasks.v2beta3.TaskB\x03\xe0\x41\x02\x12<\n\rresponse_view\x18\x03 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\"I\n\x11\x44\x65leteTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\"\x84\x01\n\x0eRunTaskRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudtasks.googleapis.com/Task\x12<\n\rresponse_view\x18\x02 \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View2\xa5\x16\n\nCloudTasks\x12\xad\x01\n\nListQueues\x12-.google.cloud.tasks.v2beta3.ListQueuesRequest\x1a..google.cloud.tasks.v2beta3.ListQueuesResponse\"@\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{parent=projects/*/locations/*}/queues\x12\x9a\x01\n\x08GetQueue\x12+.google.cloud.tasks.v2beta3.GetQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v2beta3/{name=projects/*/locations/*/queues/*}\x12\xaf\x01\n\x0b\x43reateQueue\x12..google.cloud.tasks.v2beta3.CreateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"M\xda\x41\x0cparent,queue\x82\xd3\xe4\x93\x02\x38\"//v2beta3/{parent=projects/*/locations/*}/queues:\x05queue\x12\xba\x01\n\x0bUpdateQueue\x12..google.cloud.tasks.v2beta3.UpdateQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"X\xda\x41\x11queue,update_mask\x82\xd3\xe4\x93\x02>25/v2beta3/{queue.name=projects/*/locations/*/queues/*}:\x05queue\x12\x95\x01\n\x0b\x44\x65leteQueue\x12..google.cloud.tasks.v2beta3.DeleteQueueRequest\x1a\x16.google.protobuf.Empty\">\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v2beta3/{name=projects/*/locations/*/queues/*}\x12\xa7\x01\n\nPurgeQueue\x12-.google.cloud.tasks.v2beta3.PurgeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:purge:\x01*\x12\xa7\x01\n\nPauseQueue\x12-.google.cloud.tasks.v2beta3.PauseQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\"5/v2beta3/{name=projects/*/locations/*/queues/*}:pause:\x01*\x12\xaa\x01\n\x0bResumeQueue\x12..google.cloud.tasks.v2beta3.ResumeQueueRequest\x1a!.google.cloud.tasks.v2beta3.Queue\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v2beta3/{name=projects/*/locations/*/queues/*}:resume:\x01*\x12\xa1\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"V\xda\x41\x08resource\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy:\x01*\x12\xa8\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"]\xda\x41\x0fresource,policy\x82\xd3\xe4\x93\x02\x45\"@/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy:\x01*\x12\xd3\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"h\xda\x41\x14resource,permissions\x82\xd3\xe4\x93\x02K\"F/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions:\x01*\x12\xb2\x01\n\tListTasks\x12,.google.cloud.tasks.v2beta3.ListTasksRequest\x1a-.google.cloud.tasks.v2beta3.ListTasksResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks\x12\x9f\x01\n\x07GetTask\x12*.google.cloud.tasks.v2beta3.GetTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xaf\x01\n\nCreateTask\x12-.google.cloud.tasks.v2beta3.CreateTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"P\xda\x41\x0bparent,task\x82\xd3\xe4\x93\x02<\"7/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks:\x01*\x12\x9b\x01\n\nDeleteTask\x12-.google.cloud.tasks.v2beta3.DeleteTaskRequest\x1a\x16.google.protobuf.Empty\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}\x12\xa6\x01\n\x07RunTask\x12*.google.cloud.tasks.v2beta3.RunTaskRequest\x1a .google.cloud.tasks.v2beta3.Task\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run:\x01*\x1aM\xca\x41\x19\x63loudtasks.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x80\x01\n\x1e\x63om.google.cloud.tasks.v2beta3B\x0f\x43loudTasksProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb\xa2\x02\x05TASKSb\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.FieldMask", "google/protobuf/field_mask.proto"], - ["google.cloud.tasks.v2beta3.Queue", "google/cloud/tasks/v2beta3/queue.proto"], - ["google.cloud.tasks.v2beta3.Task", "google/cloud/tasks/v2beta3/task.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 Tasks - module V2beta3 - ListQueuesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListQueuesRequest").msgclass - ListQueuesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListQueuesResponse").msgclass - GetQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.GetQueueRequest").msgclass - CreateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.CreateQueueRequest").msgclass - UpdateQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UpdateQueueRequest").msgclass - DeleteQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.DeleteQueueRequest").msgclass - PurgeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PurgeQueueRequest").msgclass - PauseQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PauseQueueRequest").msgclass - ResumeQueueRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ResumeQueueRequest").msgclass - ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListTasksRequest").msgclass - ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.ListTasksResponse").msgclass - GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.GetTaskRequest").msgclass - CreateTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.CreateTaskRequest").msgclass - DeleteTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.DeleteTaskRequest").msgclass - RunTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.RunTaskRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb deleted file mode 100644 index 949716898bbb..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb +++ /dev/null @@ -1,208 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/tasks/v2beta3/cloudtasks.proto for package 'google.cloud.tasks.v2beta3' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/tasks/v2beta3/cloudtasks_pb' - -module Google - module Cloud - module Tasks - module V2beta3 - module CloudTasks - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.tasks.v2beta3.CloudTasks' - - # Lists queues. - # - # Queues are returned in lexicographical order. - rpc :ListQueues, ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse - # Gets a queue. - rpc :GetQueue, ::Google::Cloud::Tasks::V2beta3::GetQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue - # Creates a queue. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :CreateQueue, ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue - # Updates a queue. - # - # This method creates the queue if it does not exist and updates - # the queue if it does exist. - # - # Queues created with this method allow tasks to live for a maximum of 31 - # days. After a task is 31 days old, the task will be deleted regardless of - # whether it was dispatched or not. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :UpdateQueue, ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue - # Deletes a queue. - # - # This command will delete the queue even if it has tasks in it. - # - # Note: If you delete a queue, a queue with the same name can't be created - # for 7 days. - # - # WARNING: Using this method may have unintended side effects if you are - # using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - # Read - # [Overview of Queue Management and - # queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - # this method. - rpc :DeleteQueue, ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, ::Google::Protobuf::Empty - # Purges a queue by deleting all of its tasks. - # - # All tasks created before this method is called are permanently deleted. - # - # Purge operations can take up to one minute to take effect. Tasks - # might be dispatched before the purge takes effect. A purge is irreversible. - rpc :PurgeQueue, ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue - # Pauses the queue. - # - # If a queue is paused then the system will stop dispatching tasks - # until the queue is resumed via - # [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can - # still be added when the queue is paused. A queue is paused if its - # [state][google.cloud.tasks.v2beta3.Queue.state] is - # [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. - rpc :PauseQueue, ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue - # Resume a queue. - # - # This method resumes a queue after it has been - # [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or - # [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a - # queue is stored in the queue's - # [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method - # it will be set to - # [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING]. - # - # WARNING: Resuming many high-QPS queues at the same time can - # lead to target overloading. If you are resuming high-QPS - # queues, follow the 500/50/5 pattern described in - # [Managing Cloud Tasks Scaling - # Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - rpc :ResumeQueue, ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, ::Google::Cloud::Tasks::V2beta3::Queue - # Gets the access control policy for a - # [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the - # resource exists and does not have a policy set. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.getIamPolicy` - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Sets the access control policy for a - # [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy. - # - # Note: The Cloud Console does not check queue-level IAM permissions yet. - # Project-level permissions are required to use the Cloud Console. - # - # Authorization requires the following - # [Google IAM](https://cloud.google.com/iam) permission on the specified - # resource parent: - # - # * `cloudtasks.queues.setIamPolicy` - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on a - # [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, - # this will return an empty set of permissions, not a - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - # Lists the tasks in a queue. - # - # By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] - # view is retrieved due to performance considerations; - # [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] - # controls the subset of information which is returned. - # - # The tasks may be returned in any order. The ordering may change at any - # time. - rpc :ListTasks, ::Google::Cloud::Tasks::V2beta3::ListTasksRequest, ::Google::Cloud::Tasks::V2beta3::ListTasksResponse - # Gets a task. - rpc :GetTask, ::Google::Cloud::Tasks::V2beta3::GetTaskRequest, ::Google::Cloud::Tasks::V2beta3::Task - # Creates a task and adds it to a queue. - # - # Tasks cannot be updated after creation; there is no UpdateTask command. - # - # * The maximum task size is 100KB. - rpc :CreateTask, ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, ::Google::Cloud::Tasks::V2beta3::Task - # Deletes a task. - # - # A task can be deleted if it is scheduled or dispatched. A task - # cannot be deleted if it has executed successfully or permanently - # failed. - rpc :DeleteTask, ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, ::Google::Protobuf::Empty - # Forces a task to run now. - # - # When this method is called, Cloud Tasks will dispatch the task, even if - # the task is already running, the queue has reached its - # [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is - # [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. - # - # This command is meant to be used for manual debugging. For - # example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be - # used to retry a failed task after a fix has been made or to manually force - # a task to be dispatched now. - # - # The dispatched task is returned. That is, the task that is returned - # contains the [status][Task.status] after the task is dispatched but - # before the task is received by its target. - # - # If Cloud Tasks receives a successful response from the task's - # target, then the task will be deleted; otherwise the task's - # [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be - # reset to the time that - # [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus - # the retry delay specified in the queue's - # [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - # - # [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns - # [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - # task that has already succeeded or permanently failed. - rpc :RunTask, ::Google::Cloud::Tasks::V2beta3::RunTaskRequest, ::Google::Cloud::Tasks::V2beta3::Task - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb deleted file mode 100644 index 991fb657a45c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/queue_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta3/queue.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/tasks/v2beta3/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n&google/cloud/tasks/v2beta3/queue.proto\x12\x1agoogle.cloud.tasks.v2beta3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta3/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9c\x07\n\x05Queue\x12\x0c\n\x04name\x18\x01 \x01(\t\x12O\n\x15\x61pp_engine_http_queue\x18\x03 \x01(\x0b\x32..google.cloud.tasks.v2beta3.AppEngineHttpQueueH\x00\x12;\n\x0bhttp_target\x18\r \x01(\x0b\x32&.google.cloud.tasks.v2beta3.HttpTarget\x12;\n\x0brate_limits\x18\x04 \x01(\x0b\x32&.google.cloud.tasks.v2beta3.RateLimits\x12=\n\x0cretry_config\x18\x05 \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.RetryConfig\x12\x36\n\x05state\x18\x06 \x01(\x0e\x32\'.google.cloud.tasks.v2beta3.Queue.State\x12.\n\npurge_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x08task_ttl\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x30\n\rtombstone_ttl\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12X\n\x1astackdriver_logging_config\x18\n \x01(\x0b\x32\x34.google.cloud.tasks.v2beta3.StackdriverLoggingConfig\x12\x39\n\x04type\x18\x0b \x01(\x0e\x32&.google.cloud.tasks.v2beta3.Queue.TypeB\x03\xe0\x41\x05\x12:\n\x05stats\x18\x0c \x01(\x0b\x32&.google.cloud.tasks.v2beta3.QueueStatsB\x03\xe0\x41\x03\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\x0c\n\x08\x44ISABLED\x10\x03\"0\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04PULL\x10\x01\x12\x08\n\x04PUSH\x10\x02:\\\xea\x41Y\n\x1f\x63loudtasks.googleapis.com/Queue\x12\x36projects/{project}/locations/{location}/queues/{queue}B\x0c\n\nqueue_type\"j\n\nRateLimits\x12!\n\x19max_dispatches_per_second\x18\x01 \x01(\x01\x12\x16\n\x0emax_burst_size\x18\x02 \x01(\x05\x12!\n\x19max_concurrent_dispatches\x18\x03 \x01(\x05\"\xd1\x01\n\x0bRetryConfig\x12\x14\n\x0cmax_attempts\x18\x01 \x01(\x05\x12\x35\n\x12max_retry_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmin_backoff\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmax_backoff\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rmax_doublings\x18\x05 \x01(\x05\"2\n\x18StackdriverLoggingConfig\x12\x16\n\x0esampling_ratio\x18\x01 \x01(\x01\"\xe8\x01\n\nQueueStats\x12\x18\n\x0btasks_count\x18\x01 \x01(\x03\x42\x03\xe0\x41\x03\x12\x46\n\x1doldest_estimated_arrival_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\'\n\x1a\x65xecuted_last_minute_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12(\n\x1b\x63oncurrent_dispatches_count\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12%\n\x18\x65\x66\x66\x65\x63tive_execution_rate\x18\x05 \x01(\x01\x42\x03\xe0\x41\x03\x42s\n\x1e\x63om.google.cloud.tasks.v2beta3B\nQueueProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta3.AppEngineHttpQueue", "google/cloud/tasks/v2beta3/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.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 Tasks - module V2beta3 - Queue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Queue").msgclass - Queue::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Queue.State").enummodule - Queue::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Queue.Type").enummodule - RateLimits = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.RateLimits").msgclass - RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.RetryConfig").msgclass - StackdriverLoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.StackdriverLoggingConfig").msgclass - QueueStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.QueueStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb deleted file mode 100644 index 46bbd3572870..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloud_tasks/rest" -require "google/cloud/tasks/v2beta3/bindings_override" -require "google/cloud/tasks/v2beta3/version" - -module Google - module Cloud - module Tasks - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/tasks/v2beta3/rest" - # client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new - # - module V2beta3 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb deleted file mode 100644 index 7dbf1f335f19..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/target_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta3/target.proto - -require 'google/protobuf' - - -descriptor_data = "\n\'google/cloud/tasks/v2beta3/target.proto\x12\x1agoogle.cloud.tasks.v2beta3\"+\n\x0bPullMessage\x12\x0f\n\x07payload\x18\x01 \x01(\x0c\x12\x0b\n\x03tag\x18\x02 \x01(\t\"\x1c\n\x0cPathOverride\x12\x0c\n\x04path\x18\x01 \x01(\t\"%\n\rQueryOverride\x12\x14\n\x0cquery_params\x18\x01 \x01(\t\"\x97\x04\n\x0bUriOverride\x12\x43\n\x06scheme\x18\x01 \x01(\x0e\x32..google.cloud.tasks.v2beta3.UriOverride.SchemeH\x00\x88\x01\x01\x12\x11\n\x04host\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\x03H\x02\x88\x01\x01\x12?\n\rpath_override\x18\x04 \x01(\x0b\x32(.google.cloud.tasks.v2beta3.PathOverride\x12\x41\n\x0equery_override\x18\x05 \x01(\x0b\x32).google.cloud.tasks.v2beta3.QueryOverride\x12\x61\n\x19uri_override_enforce_mode\x18\x06 \x01(\x0e\x32>.google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode\"5\n\x06Scheme\x12\x16\n\x12SCHEME_UNSPECIFIED\x10\x00\x12\x08\n\x04HTTP\x10\x01\x12\t\n\x05HTTPS\x10\x02\"b\n\x16UriOverrideEnforceMode\x12)\n%URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED\x10\x00\x12\x11\n\rIF_NOT_EXISTS\x10\x01\x12\n\n\x06\x41LWAYS\x10\x02\x42\t\n\x07_schemeB\x07\n\x05_hostB\x07\n\x05_port\"\xe4\x03\n\nHttpTarget\x12=\n\x0curi_override\x18\x01 \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.UriOverride\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta3.HttpMethod\x12O\n\x10header_overrides\x18\x03 \x03(\x0b\x32\x35.google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta3.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta3.OidcTokenH\x00\x1a$\n\x06Header\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x1aO\n\x0eHeaderOverride\x12=\n\x06header\x18\x01 \x01(\x0b\x32-.google.cloud.tasks.v2beta3.HttpTarget.HeaderB\x16\n\x14\x61uthorization_header\"\xf0\x02\n\x0bHttpRequest\x12\x0b\n\x03url\x18\x01 \x01(\t\x12;\n\x0bhttp_method\x18\x02 \x01(\x0e\x32&.google.cloud.tasks.v2beta3.HttpMethod\x12\x45\n\x07headers\x18\x03 \x03(\x0b\x32\x34.google.cloud.tasks.v2beta3.HttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x04 \x01(\x0c\x12=\n\x0boauth_token\x18\x05 \x01(\x0b\x32&.google.cloud.tasks.v2beta3.OAuthTokenH\x00\x12;\n\noidc_token\x18\x06 \x01(\x0b\x32%.google.cloud.tasks.v2beta3.OidcTokenH\x00\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14\x61uthorization_header\"g\n\x12\x41ppEngineHttpQueue\x12Q\n\x1b\x61pp_engine_routing_override\x18\x01 \x01(\x0b\x32,.google.cloud.tasks.v2beta3.AppEngineRouting\"\xc1\x02\n\x14\x41ppEngineHttpRequest\x12;\n\x0bhttp_method\x18\x01 \x01(\x0e\x32&.google.cloud.tasks.v2beta3.HttpMethod\x12H\n\x12\x61pp_engine_routing\x18\x02 \x01(\x0b\x32,.google.cloud.tasks.v2beta3.AppEngineRouting\x12\x14\n\x0crelative_uri\x18\x03 \x01(\t\x12N\n\x07headers\x18\x04 \x03(\x0b\x32=.google.cloud.tasks.v2beta3.AppEngineHttpRequest.HeadersEntry\x12\x0c\n\x04\x62ody\x18\x05 \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\x10\x41ppEngineRouting\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08instance\x18\x03 \x01(\t\x12\x0c\n\x04host\x18\x04 \x01(\t\":\n\nOAuthToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\r\n\x05scope\x18\x02 \x01(\t\"<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t*s\n\nHttpMethod\x12\x1b\n\x17HTTP_METHOD_UNSPECIFIED\x10\x00\x12\x08\n\x04POST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\x08\n\x04HEAD\x10\x03\x12\x07\n\x03PUT\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x12\t\n\x05PATCH\x10\x06\x12\x0b\n\x07OPTIONS\x10\x07\x42t\n\x1e\x63om.google.cloud.tasks.v2beta3B\x0bTargetProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspbb\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 = [ - ] - 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 Tasks - module V2beta3 - PullMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PullMessage").msgclass - PathOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.PathOverride").msgclass - QueryOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.QueryOverride").msgclass - UriOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UriOverride").msgclass - UriOverride::Scheme = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UriOverride.Scheme").enummodule - UriOverride::UriOverrideEnforceMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.UriOverride.UriOverrideEnforceMode").enummodule - HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpTarget").msgclass - HttpTarget::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpTarget.Header").msgclass - HttpTarget::HeaderOverride = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpTarget.HeaderOverride").msgclass - HttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpRequest").msgclass - AppEngineHttpQueue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.AppEngineHttpQueue").msgclass - AppEngineHttpRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.AppEngineHttpRequest").msgclass - AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.AppEngineRouting").msgclass - OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.OAuthToken").msgclass - OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.OidcToken").msgclass - HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.HttpMethod").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb deleted file mode 100644 index a62f7cf7f916..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/task_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tasks/v2beta3/task.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/tasks/v2beta3/target_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n%google/cloud/tasks/v2beta3/task.proto\x12\x1agoogle.cloud.tasks.v2beta3\x1a\x19google/api/resource.proto\x1a\'google/cloud/tasks/v2beta3/target.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x8e\x06\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12S\n\x17\x61pp_engine_http_request\x18\x03 \x01(\x0b\x32\x30.google.cloud.tasks.v2beta3.AppEngineHttpRequestH\x00\x12?\n\x0chttp_request\x18\x0b \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.HttpRequestH\x00\x12?\n\x0cpull_message\x18\r \x01(\x0b\x32\'.google.cloud.tasks.v2beta3.PullMessageH\x00\x12\x31\n\rschedule_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x11\x64ispatch_deadline\x18\x0c \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x16\n\x0e\x64ispatch_count\x18\x06 \x01(\x05\x12\x16\n\x0eresponse_count\x18\x07 \x01(\x05\x12:\n\rfirst_attempt\x18\x08 \x01(\x0b\x32#.google.cloud.tasks.v2beta3.Attempt\x12\x39\n\x0clast_attempt\x18\t \x01(\x0b\x32#.google.cloud.tasks.v2beta3.Attempt\x12\x33\n\x04view\x18\n \x01(\x0e\x32%.google.cloud.tasks.v2beta3.Task.View\"1\n\x04View\x12\x14\n\x10VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02:h\xea\x41\x65\n\x1e\x63loudtasks.googleapis.com/Task\x12\x43projects/{project}/locations/{location}/queues/{queue}/tasks/{task}B\x0e\n\x0cpayload_type\"\xcf\x01\n\x07\x41ttempt\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rdispatch_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rresponse_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x0fresponse_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusBr\n\x1e\x63om.google.cloud.tasks.v2beta3B\tTaskProtoP\x01ZCcloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspbb\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.tasks.v2beta3.AppEngineHttpRequest", "google/cloud/tasks/v2beta3/target.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.rpc.Status", "google/rpc/status.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 Tasks - module V2beta3 - Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Task").msgclass - Task::View = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Task.View").enummodule - Attempt = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2beta3.Attempt").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb deleted file mode 100644 index 4734a344c8be..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/lib/google/cloud/tasks/v2beta3/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta3 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md deleted file mode 100644 index 1125683d6825..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Tasks V2beta3 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-tasks-v2beta3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb deleted file mode 100644 index 00fcdde8c8b1..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb +++ /dev/null @@ -1,396 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta3 - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # @!attribute [rw] filter - # @return [::String] - # `filter` can be used to specify a subset of queues. Any - # {::Google::Cloud::Tasks::V2beta3::Queue Queue} field can be used as a filter and - # several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The - # filter syntax is the same as described in [Stackdriver's Advanced Logs - # Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - # - # Sample filter "state: PAUSED". - # - # Note that using filters might cause fewer queues than the - # requested page_size to be returned. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. - # - # The maximum page size is 9800. If unspecified, the page size will - # be the maximum. Fewer queues than requested might be returned, - # even if more queues exist; use the - # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} - # in the response to determine if more queues exist. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta3::ListQueuesResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} method. It - # is an error to switch the value of the - # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#filter filter} while - # iterating through pages. - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - class ListQueuesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues}. - # @!attribute [rw] queues - # @return [::Array<::Google::Cloud::Tasks::V2beta3::Queue>] - # The list of queues. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # - # To return the next page of results, call - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues ListQueues} with this - # value as the - # {::Google::Cloud::Tasks::V2beta3::ListQueuesRequest#page_token page_token}. - # - # If the next_page_token is empty, there are no more results. - # - # The page token is valid for only 2 hours. - class ListQueuesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue GetQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the queue. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @!attribute [rw] read_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Read mask is used for a more granular control over what the API - # returns. If the mask is not present all fields will be returned except - # [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - # specified in the mask. - class GetQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue CreateQueue}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location name in which the queue will be created. - # For example: `projects/PROJECT_ID/locations/LOCATION_ID` - # - # The list of allowed locations can be obtained by calling Cloud - # Tasks' implementation of - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # @!attribute [rw] queue - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # Required. The queue to create. - # - # [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as - # an existing queue. - class CreateQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue}. - # @!attribute [rw] queue - # @return [::Google::Cloud::Tasks::V2beta3::Queue] - # Required. The queue to create or update. - # - # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} must be - # specified. - # - # Output only fields cannot be modified using UpdateQueue. - # Any value specified for an output only field will be ignored. - # The queue's {::Google::Cloud::Tasks::V2beta3::Queue#name name} cannot be - # changed. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # A mask used to specify which fields of the queue are being updated. - # - # If empty, then all fields will be updated. - class UpdateQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue DeleteQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - class DeleteQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue PurgeQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class PurgeQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue PauseQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class PauseQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}. - # @!attribute [rw] name - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - class ResumeQueueRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing tasks using - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks}. - # @!attribute [rw] parent - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum page size. - # - # Fewer tasks than requested might be returned, even if more tasks exist; use - # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} - # in the response to determine if more tasks exist. - # - # The maximum page size is 1000. If unspecified, the page size will be the - # maximum. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying the page of results to return. - # - # To request the first page results, page_token must be empty. To - # request the next page of results, page_token must be the value of - # {::Google::Cloud::Tasks::V2beta3::ListTasksResponse#next_page_token next_page_token} - # returned from the previous call to - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} method. - # - # The page token is valid for only 2 hours. - class ListTasksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing tasks using - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks}. - # @!attribute [rw] tasks - # @return [::Array<::Google::Cloud::Tasks::V2beta3::Task>] - # The list of tasks. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # - # To return the next page of results, call - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks ListTasks} with this - # value as the - # {::Google::Cloud::Tasks::V2beta3::ListTasksRequest#page_token page_token}. - # - # If the next_page_token is empty, there are no more results. - class ListTasksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting a task using - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task GetTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - class GetTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}. - # @!attribute [rw] parent - # @return [::String] - # Required. The queue name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # The queue must already exist. - # @!attribute [rw] task - # @return [::Google::Cloud::Tasks::V2beta3::Task] - # Required. The task to add. - # - # Task names have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - # The user can optionally specify a task - # {::Google::Cloud::Tasks::V2beta3::Task#name name}. If a name is not specified - # then the system will generate a random unique task id, which will be set in - # the task returned in the {::Google::Cloud::Tasks::V2beta3::Task#name response}. - # - # If {::Google::Cloud::Tasks::V2beta3::Task#schedule_time schedule_time} is not - # set or is in the past then Cloud Tasks will set it to the current time. - # - # Task De-duplication: - # - # Explicitly specifying a task ID enables task de-duplication. If - # a task's ID is identical to that of an existing task or a task - # that was deleted or executed recently then the call will fail - # with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - # If the task's queue was created using Cloud Tasks, then another task with - # the same name can't be created for ~1 hour after the original task was - # deleted or executed. If the task's queue was created using queue.yaml or - # queue.xml, then another task with the same name can't be created - # for ~9 days after the original task was deleted or executed. - # - # Because there is an extra lookup cost to identify duplicate task - # names, these {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} - # calls have significantly increased latency. Using hashed strings for the - # task id or for the prefix of the task id is recommended. Choosing task ids - # that are sequential or have sequential prefixes, for example using a - # timestamp, causes an increase in latency and error rates in all - # task commands. The infrastructure relies on an approximately - # uniform distribution of task ids to store and serve tasks - # efficiently. - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - class CreateTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a task using - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task DeleteTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - class DeleteTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for forcing a task to run now using - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask}. - # @!attribute [rw] name - # @return [::String] - # Required. The task name. For example: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # @!attribute [rw] response_view - # @return [::Google::Cloud::Tasks::V2beta3::Task::View] - # The response_view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} will be returned. - # - # By default response_view is - # {::Google::Cloud::Tasks::V2beta3::Task::View::BASIC BASIC}; not all information is - # retrieved by default because some data, such as payloads, might be - # desirable to return only when needed because of its large size or because - # of the sensitivity of data that it contains. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Task Task} resource. - class RunTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb deleted file mode 100644 index 210bc3f6fa93..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/queue.rb +++ /dev/null @@ -1,462 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta3 - # A queue is a container of related tasks. Queues are configured to manage - # how those tasks are dispatched. Configurable properties include rate limits, - # retry options, queue types, and others. - # @!attribute [rw] name - # @return [::String] - # Caller-specified and required in - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue CreateQueue}, after - # which it becomes output only. - # - # The queue name. - # - # The queue name must have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the queue's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - # hyphens (-). The maximum length is 100 characters. - # @!attribute [rw] app_engine_http_queue - # @return [::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue] - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} - # settings apply only to [App Engine - # tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. - # {::Google::Cloud::Tasks::V2beta3::HttpRequest Http tasks} are not affected by - # this proto. - # @!attribute [rw] http_target - # @return [::Google::Cloud::Tasks::V2beta3::HttpTarget] - # Modifies HTTP target for HTTP tasks. - # @!attribute [rw] rate_limits - # @return [::Google::Cloud::Tasks::V2beta3::RateLimits] - # Rate limits for task dispatches. - # - # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits} and - # {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} are related - # because they both control task attempts. However they control task attempts - # in different ways: - # - # * {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits} controls the - # total rate of - # dispatches from a queue (i.e. all traffic dispatched from the - # queue, regardless of whether the dispatch is from a first - # attempt or a retry). - # * {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} controls - # what happens to - # particular a task after its first attempt fails. That is, - # {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config} controls - # task retries (the second attempt, third attempt, etc). - # - # The queue's actual dispatch rate is the result of: - # - # * Number of tasks in the queue - # * User-specified throttling: - # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate_limits}, - # {::Google::Cloud::Tasks::V2beta3::Queue#retry_config retry_config}, and the - # [queue's state][google.cloud.tasks.v2beta3.Queue.state]. - # * System throttling due to `429` (Too Many Requests) or `503` (Service - # Unavailable) responses from the worker, high error rates, or to smooth - # sudden large traffic spikes. - # @!attribute [rw] retry_config - # @return [::Google::Cloud::Tasks::V2beta3::RetryConfig] - # Settings that determine the retry behavior. - # - # * For tasks created using Cloud Tasks: the queue-level retry settings - # apply to all tasks in the queue that were created using Cloud Tasks. - # Retry settings cannot be set on individual tasks. - # * For tasks created using the App Engine SDK: the queue-level retry - # settings apply to all tasks in the queue which do not have retry settings - # explicitly set on the task and were created by the App Engine SDK. See - # [App Engine - # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - # @!attribute [rw] state - # @return [::Google::Cloud::Tasks::V2beta3::Queue::State] - # Output only. The state of the queue. - # - # `state` can only be changed by called - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue PauseQueue}, - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue ResumeQueue}, or - # uploading - # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue} cannot be - # used to change `state`. - # @!attribute [rw] purge_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time this queue was purged. - # - # All tasks that were {::Google::Cloud::Tasks::V2beta3::Task#create_time created} - # before this time were purged. - # - # A queue can be purged using - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue PurgeQueue}, the [App - # Engine Task Queue SDK, or the Cloud - # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - # - # Purge time will be truncated to the nearest microsecond. Purge - # time will be unset if the queue has never been purged. - # @!attribute [rw] task_ttl - # @return [::Google::Protobuf::Duration] - # The maximum amount of time that a task will be retained in - # this queue. - # - # Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - # After a task has lived for `task_ttl`, the task will be deleted - # regardless of whether it was dispatched or not. - # - # The `task_ttl` for queues created via queue.yaml/xml is equal to the - # maximum duration because there is a - # [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - # these queues. To view the maximum valid duration, see the documentation for - # {::Google::Protobuf::Duration Duration}. - # @!attribute [rw] tombstone_ttl - # @return [::Google::Protobuf::Duration] - # The task tombstone time to live (TTL). - # - # After a task is deleted or executed, the task's tombstone is - # retained for the length of time specified by `tombstone_ttl`. - # The tombstone is used by task de-duplication; another task with the same - # name can't be created until the tombstone has expired. For more information - # about task de-duplication, see the documentation for - # {::Google::Cloud::Tasks::V2beta3::CreateTaskRequest#task CreateTaskRequest}. - # - # Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - # @!attribute [rw] stackdriver_logging_config - # @return [::Google::Cloud::Tasks::V2beta3::StackdriverLoggingConfig] - # Configuration options for writing logs to - # [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - # field is unset, then no logs are written. - # @!attribute [rw] type - # @return [::Google::Cloud::Tasks::V2beta3::Queue::Type] - # Immutable. The type of a queue (push or pull). - # - # `Queue.type` is an immutable property of the queue that is set at the queue - # creation time. When left unspecified, the default value of `PUSH` is - # selected. - # @!attribute [r] stats - # @return [::Google::Cloud::Tasks::V2beta3::QueueStats] - # Output only. The realtime, informational statistics for a queue. In order - # to receive the statistics the caller should include this field in the - # FieldMask. - class Queue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the queue. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # The queue is running. Tasks can be dispatched. - # - # If the queue was created using Cloud Tasks and the queue has - # had no activity (method calls or task dispatches) for 30 days, - # the queue may take a few minutes to re-activate. Some method - # calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - # tasks may not be dispatched for a few minutes until the queue - # has been re-activated. - RUNNING = 1 - - # Tasks are paused by the user. If the queue is paused then Cloud - # Tasks will stop delivering tasks from it, but more tasks can - # still be added to it by the user. - PAUSED = 2 - - # The queue is disabled. - # - # A queue becomes `DISABLED` when - # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - # or - # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - # is uploaded which does not contain the queue. You cannot directly disable - # a queue. - # - # When a queue is disabled, tasks can still be added to a queue - # but the tasks are not dispatched. - # - # To permanently delete this queue and all of its tasks, call - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue DeleteQueue}. - DISABLED = 3 - end - - # The type of the queue. - module Type - # Default value. - TYPE_UNSPECIFIED = 0 - - # A pull queue. - PULL = 1 - - # A push queue. - PUSH = 2 - end - end - - # Rate limits. - # - # This message determines the maximum rate that tasks can be dispatched by a - # queue, regardless of whether the dispatch is a first task attempt or a retry. - # - # Note: The debugging command, - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task RunTask}, will run a task - # even if the queue has reached its - # {::Google::Cloud::Tasks::V2beta3::RateLimits RateLimits}. - # @!attribute [rw] max_dispatches_per_second - # @return [::Float] - # The maximum rate at which tasks are dispatched from this queue. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # * For {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue App Engine queues}, - # the maximum allowed value - # is 500. - # - # - # This field has the same meaning as - # [rate in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - # @!attribute [rw] max_burst_size - # @return [::Integer] - # The max burst size. - # - # Max burst size limits how fast tasks in queue are processed when - # many tasks are in the queue and the rate is high. This field - # allows the queue to have a high rate so processing starts shortly - # after a task is enqueued, but still limits resource usage when - # many tasks are enqueued in a short period of time. - # - # The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - # algorithm is used to control the rate of task dispatches. Each - # queue has a token bucket that holds tokens, up to the maximum - # specified by `max_burst_size`. Each time a task is dispatched, a - # token is removed from the bucket. Tasks will be dispatched until - # the queue's bucket runs out of tokens. The bucket will be - # continuously refilled with new tokens based on - # {::Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}. - # - # The default value of `max_burst_size` is picked by Cloud Tasks - # based on the value of - # {::Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}. - # - # The maximum value of `max_burst_size` is 500. - # - # For App Engine queues that were created or updated using - # `queue.yaml/xml`, `max_burst_size` is equal to - # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - # If - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue} is called - # on a queue without explicitly setting a value for `max_burst_size`, - # `max_burst_size` value will get updated if - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue UpdateQueue} is - # updating - # {::Google::Cloud::Tasks::V2beta3::RateLimits#max_dispatches_per_second max_dispatches_per_second}. - # @!attribute [rw] max_concurrent_dispatches - # @return [::Integer] - # The maximum number of concurrent tasks that Cloud Tasks allows - # to be dispatched for this queue. After this threshold has been - # reached, Cloud Tasks stops dispatching tasks until the number of - # concurrent requests decreases. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # The maximum allowed value is 5,000. - # - # - # This field has the same meaning as - # [max_concurrent_requests in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - class RateLimits - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Retry config. - # - # These settings determine when a failed task attempt is retried. - # @!attribute [rw] max_attempts - # @return [::Integer] - # Number of attempts per task. - # - # Cloud Tasks will attempt the task `max_attempts` times (that is, if the - # first attempt fails, then there will be `max_attempts - 1` retries). Must - # be >= -1. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # -1 indicates unlimited attempts. - # - # This field has the same meaning as - # [task_retry_limit in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_retry_duration - # @return [::Google::Protobuf::Duration] - # If positive, `max_retry_duration` specifies the time limit for - # retrying a failed task, measured from when the task was first - # attempted. Once `max_retry_duration` time has passed *and* the - # task has been attempted - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts} times, - # no further attempts will be made and the task will be deleted. - # - # If zero, then the task age is unlimited. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # `max_retry_duration` will be truncated to the nearest second. - # - # This field has the same meaning as - # [task_age_limit in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] min_backoff - # @return [::Google::Protobuf::Duration] - # A task will be {::Google::Cloud::Tasks::V2beta3::Task#schedule_time scheduled} - # for retry between - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} and - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} duration - # after it fails, if the queue's - # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig} specifies that the - # task should be retried. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # `min_backoff` will be truncated to the nearest second. - # - # This field has the same meaning as - # [min_backoff_seconds in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_backoff - # @return [::Google::Protobuf::Duration] - # A task will be {::Google::Cloud::Tasks::V2beta3::Task#schedule_time scheduled} - # for retry between - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} and - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} duration - # after it fails, if the queue's - # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig} specifies that the - # task should be retried. - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # `max_backoff` will be truncated to the nearest second. - # - # This field has the same meaning as - # [max_backoff_seconds in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - # @!attribute [rw] max_doublings - # @return [::Integer] - # The time between retries will double `max_doublings` times. - # - # A task's retry interval starts at - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff}, then - # doubles `max_doublings` times, then increases linearly, and finally retries - # at intervals of - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} up to - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts} times. - # - # For example, if - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#min_backoff min_backoff} is 10s, - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} is 300s, - # and `max_doublings` is 3, then the a task will first be retried in 10s. The - # retry interval will double three times, and then increase linearly by 2^3 * - # 10s. Finally, the task will retry at intervals of - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_backoff max_backoff} until the - # task has been attempted - # {::Google::Cloud::Tasks::V2beta3::RetryConfig#max_attempts max_attempts} times. - # Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, - # 300s, .... - # - # If unspecified when the queue is created, Cloud Tasks will pick the - # default. - # - # - # This field has the same meaning as - # [max_doublings in - # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - class RetryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration options for writing logs to - # [Stackdriver Logging](https://cloud.google.com/logging/docs/). - # @!attribute [rw] sampling_ratio - # @return [::Float] - # Specifies the fraction of operations to write to - # [Stackdriver Logging](https://cloud.google.com/logging/docs/). - # This field may contain any value between 0.0 and 1.0, inclusive. - # 0.0 is the default and means that no operations are logged. - class StackdriverLoggingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Statistics for a queue. - # @!attribute [r] tasks_count - # @return [::Integer] - # Output only. An estimation of the number of tasks in the queue, that is, - # the tasks in the queue that haven't been executed, the tasks in the queue - # which the queue has dispatched but has not yet received a reply for, and - # the failed tasks that the queue is retrying. - # @!attribute [r] oldest_estimated_arrival_time - # @return [::Google::Protobuf::Timestamp] - # Output only. An estimation of the nearest time in the future where a task - # in the queue is scheduled to be executed. - # @!attribute [r] executed_last_minute_count - # @return [::Integer] - # Output only. The number of tasks that the queue has dispatched and received - # a reply for during the last minute. This variable counts both successful - # and non-successful executions. - # @!attribute [r] concurrent_dispatches_count - # @return [::Integer] - # Output only. The number of requests that the queue has dispatched but has - # not received a reply for yet. - # @!attribute [r] effective_execution_rate - # @return [::Float] - # Output only. The current maximum number of tasks per second executed by the - # queue. The maximum value of this variable is controlled by the RateLimits - # of the Queue. However, this value could be less to avoid overloading the - # endpoints tasks in the queue are targeting. - class QueueStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb deleted file mode 100644 index 0e27cb1fe1f2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/target.rb +++ /dev/null @@ -1,728 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta3 - # Pull Message. - # - # This proto can only be used for tasks in a queue which has - # {::Google::Cloud::Tasks::V2beta3::Queue#type PULL} type. It currently exists for - # backwards compatibility with the App Engine Task Queue SDK. This message type - # maybe returned with methods - # [list][google.cloud.tasks.v2beta3.CloudTask.ListTasks] and - # [get][google.cloud.tasks.v2beta3.CloudTask.ListTasks], when the response view - # is [FULL][google.cloud.tasks.v2beta3.Task.View.Full]. - # @!attribute [rw] payload - # @return [::String] - # A data payload consumed by the worker to execute the task. - # @!attribute [rw] tag - # @return [::String] - # The tasks's tag. - # - # The tag is less than 500 characters. - # - # SDK compatibility: Although the SDK allows tags to be either - # string or - # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - # encoded, the tag will be empty when the task is returned by Cloud Tasks. - class PullMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PathOverride. - # - # Path message defines path override for HTTP targets. - # @!attribute [rw] path - # @return [::String] - # The URI path (e.g., /users/1234). Default is an empty string. - class PathOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # QueryOverride. - # - # Query message defines query override for HTTP targets. - # @!attribute [rw] query_params - # @return [::String] - # The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty - # string. - class QueryOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # URI Override. - # - # When specified, all the HTTP tasks inside the queue will be partially or - # fully overridden depending on the configured values. - # @!attribute [rw] scheme - # @return [::Google::Cloud::Tasks::V2beta3::UriOverride::Scheme] - # Scheme override. - # - # When specified, the task URI scheme is replaced by the provided value (HTTP - # or HTTPS). - # @!attribute [rw] host - # @return [::String] - # Host override. - # - # When specified, replaces the host part of the task URL. For example, - # if the task URL is "https://www.google.com," and host value is set to - # "example.net", the overridden URI will be changed to "https://example.net." - # Host value cannot be an empty string (INVALID_ARGUMENT). - # @!attribute [rw] port - # @return [::Integer] - # Port override. - # - # When specified, replaces the port part of the task URI. For instance, - # for a URI http://www.google.com/foo and port=123, the overridden URI - # becomes http://www.google.com:123/foo. Note that the port value must be a - # positive integer. Setting the port to 0 (Zero) clears the URI port. - # @!attribute [rw] path_override - # @return [::Google::Cloud::Tasks::V2beta3::PathOverride] - # URI path. - # - # When specified, replaces the existing path of the task URL. Setting the - # path value to an empty string clears the URI path segment. - # @!attribute [rw] query_override - # @return [::Google::Cloud::Tasks::V2beta3::QueryOverride] - # URI Query. - # - # When specified, replaces the query part of the task URI. Setting the - # query value to an empty string clears the URI query segment. - # @!attribute [rw] uri_override_enforce_mode - # @return [::Google::Cloud::Tasks::V2beta3::UriOverride::UriOverrideEnforceMode] - # URI Override Enforce Mode - # - # When specified, determines the Target UriOverride mode. If not specified, - # it defaults to ALWAYS. - class UriOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The Scheme for an HTTP request. By default, it is HTTPS. - module Scheme - # Scheme unspecified. Defaults to HTTPS. - SCHEME_UNSPECIFIED = 0 - - # Convert the scheme to HTTP, e.g., https://www.google.ca will change to - # http://www.google.ca. - HTTP = 1 - - # Convert the scheme to HTTPS, e.g., http://www.google.ca will change to - # https://www.google.ca. - HTTPS = 2 - end - - # UriOverrideEnforceMode mode is to define enforcing mode for the override - # modes. - module UriOverrideEnforceMode - # OverrideMode Unspecified. Defaults to ALWAYS. - URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0 - - # In the IF_NOT_EXISTS mode, queue-level configuration is only - # applied where task-level configuration does not exist. - IF_NOT_EXISTS = 1 - - # In the ALWAYS mode, queue-level configuration overrides all - # task-level configuration - ALWAYS = 2 - end - end - - # HTTP target. - # - # When specified as a [Queue][target_type], all the tasks with [HttpRequest] - # will be overridden according to the target. - # @!attribute [rw] uri_override - # @return [::Google::Cloud::Tasks::V2beta3::UriOverride] - # URI override. - # - # When specified, overrides the execution URI for all the tasks in the queue. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2beta3::HttpMethod] - # The HTTP method to use for the request. - # - # When specified, it overrides - # {::Google::Cloud::Tasks::V2beta3::HttpTarget#http_method HttpRequest} for the - # task. Note that if the value is set to [HttpMethod][GET] the - # [HttpRequest][body] of the task will be ignored at execution time. - # @!attribute [rw] header_overrides - # @return [::Array<::Google::Cloud::Tasks::V2beta3::HttpTarget::HeaderOverride>] - # HTTP target headers. - # - # This map contains the header field names and values. - # Headers will be set when running the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} and/or - # [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. - # - # These headers represent a subset of the headers that will be configured for - # the task's HTTP request. Some HTTP request headers will be ignored or - # replaced. - # - # A partial list of headers that will be ignored or replaced is: - # * Several predefined headers, prefixed with "X-CloudTasks-", can - # be used to define properties of the task. - # * Host: This will be computed by Cloud Tasks and derived from - # [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. - # * Content-Length: This will be computed by Cloud Tasks. - # - # `Content-Type` won't be set by Cloud Tasks. You can explicitly set - # `Content-Type` to a media type when the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. - # For example,`Content-Type` can be set to `"application/octet-stream"` or - # `"application/json"`. The default value is set to `"application/json"`. - # - # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - # - # Headers which can have multiple values (according to RFC2616) can be - # specified using comma-separated values. - # - # The size of the headers must be less than 80KB. - # Queue-level headers to override headers of all the tasks in the queue. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Tasks::V2beta3::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as the `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # - # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Tasks::V2beta3::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # - # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HttpTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines a header message. A header can have a key and a value. - # @!attribute [rw] key - # @return [::String] - # The Key of the header. - # @!attribute [rw] value - # @return [::String] - # The Value of the header. - class Header - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wraps the Header object. - # @!attribute [rw] header - # @return [::Google::Cloud::Tasks::V2beta3::HttpTarget::Header] - # header embodying a key and a value. - class HeaderOverride - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # HTTP request. - # - # The task will be pushed to the worker as an HTTP request. If the worker - # or the redirected worker acknowledges the task by returning a successful HTTP - # response code ([`200` - `299`]), the task will be removed from the queue. If - # any other HTTP response code is returned or no response is received, the - # task will be retried according to the following: - # - # * User-specified throttling: [retry - # configuration][google.cloud.tasks.v2beta3.Queue.retry_config], - # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate limits}, and the - # [queue's state][google.cloud.tasks.v2beta3.Queue.state]. - # - # * System throttling: To prevent the worker from overloading, Cloud Tasks may - # temporarily reduce the queue's effective rate. User-specified settings - # will not be changed. - # - # System throttling happens because: - # - # * Cloud Tasks backs off on all errors. Normally the backoff specified in - # {::Google::Cloud::Tasks::V2beta3::Queue#rate_limits rate limits} will be used. - # But if the worker returns `429` (Too Many Requests), `503` (Service - # Unavailable), or the rate of errors is high, Cloud Tasks will use a - # higher backoff rate. The retry specified in the `Retry-After` HTTP - # response header is considered. - # - # * To prevent traffic spikes and to smooth sudden increases in traffic, - # dispatches ramp up slowly when the queue is newly created or idle and - # if large numbers of tasks suddenly become available to dispatch (due to - # spikes in create task rates, the queue being unpaused, or many tasks - # that are scheduled at the same time). - # @!attribute [rw] url - # @return [::String] - # Required. The full url path that the request will be sent to. - # - # This string must begin with either "http://" or "https://". Some examples - # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - # encode some characters for safety and compatibility. The maximum allowed - # URL length is 2083 characters after encoding. - # - # The `Location` header response from a redirect response [`300` - `399`] - # may be followed. The redirect is not counted as a separate attempt. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2beta3::HttpMethod] - # The HTTP method to use for the request. The default is POST. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. - # Headers can be set when the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. - # - # These headers represent a subset of the headers that will accompany the - # task's HTTP request. Some HTTP request headers will be ignored or replaced. - # - # A partial list of headers that will be ignored or replaced is: - # - # * Any header that is prefixed with "X-CloudTasks-" will be treated - # as service header. Service headers define properties of the task and are - # predefined in CloudTask. - # * Host: This will be computed by Cloud Tasks and derived from - # {::Google::Cloud::Tasks::V2beta3::HttpRequest#url HttpRequest.url}. - # * Content-Length: This will be computed by Cloud Tasks. - # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - # * `X-Google-*`: Google use only. - # * `X-AppEngine-*`: Google use only. - # - # `Content-Type` won't be set by Cloud Tasks. You can explicitly set - # `Content-Type` to a media type when the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. - # For example, `Content-Type` can be set to `"application/octet-stream"` or - # `"application/json"`. - # - # Headers which can have multiple values (according to RFC2616) can be - # specified using comma-separated values. - # - # The size of the headers must be less than 80KB. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. - # - # A request body is allowed only if the - # {::Google::Cloud::Tasks::V2beta3::HttpRequest#http_method HTTP method} is POST, - # PUT, or PATCH. It is an error to set body on a task with an incompatible - # {::Google::Cloud::Tasks::V2beta3::HttpMethod HttpMethod}. - # @!attribute [rw] oauth_token - # @return [::Google::Cloud::Tasks::V2beta3::OAuthToken] - # If specified, an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - # will be generated and attached as an `Authorization` header in the HTTP - # request. - # - # This type of authorization should generally only be used when calling - # Google APIs hosted on *.googleapis.com. - # - # Note: The following fields are mutually exclusive: `oauth_token`, `oidc_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc_token - # @return [::Google::Cloud::Tasks::V2beta3::OidcToken] - # If specified, an - # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - # token will be generated and attached as an `Authorization` header in the - # HTTP request. - # - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # - # Note: The following fields are mutually exclusive: `oidc_token`, `oauth_token`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HttpRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine HTTP queue. - # - # The task will be delivered to the App Engine application hostname - # specified by its - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} and - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest}. The - # documentation for - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} - # explains how the task's host URL is constructed. - # - # Using {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue AppEngineHttpQueue} - # requires - # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) - # Google IAM permission for the project - # and the following scope: - # - # `https://www.googleapis.com/auth/cloud-platform` - # @!attribute [rw] app_engine_routing_override - # @return [::Google::Cloud::Tasks::V2beta3::AppEngineRouting] - # Overrides for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - # - # If set, `app_engine_routing_override` is used for all tasks in - # the queue, no matter what the setting is for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - class AppEngineHttpQueue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # App Engine HTTP request. - # - # The message defines the HTTP request that is sent to an App Engine app when - # the task is dispatched. - # - # Using {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} - # requires - # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) - # Google IAM permission for the project - # and the following scope: - # - # `https://www.googleapis.com/auth/cloud-platform` - # - # The task will be delivered to the App Engine app which belongs to the same - # project as the queue. For more information, see - # [How Requests are - # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and how routing is affected by - # [dispatch - # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). - # Traffic is encrypted during transport and never leaves Google datacenters. - # Because this traffic is carried over a communication mechanism internal to - # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). - # The request to the handler, however, will appear to have used the HTTP - # protocol. - # - # The {::Google::Cloud::Tasks::V2beta3::AppEngineRouting AppEngineRouting} used to - # construct the URL that the task is delivered to can be set at the queue-level - # or task-level: - # - # * If set, - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue#app_engine_routing_override app_engine_routing_override} - # is used for all tasks in the queue, no matter what the setting - # is for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - # - # - # The `url` that the task will be sent to is: - # - # * `url =` {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} `+` - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#relative_uri relative_uri} - # - # Tasks can be dispatched to secure app handlers, unsecure app handlers, and - # URIs restricted with - # [`login: - # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). - # Because tasks are not run as any user, they cannot be dispatched to URIs - # restricted with - # [`login: - # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) - # Task dispatches also do not follow redirects. - # - # The task attempt has succeeded if the app's request handler returns an HTTP - # response code in the range [`200` - `299`]. The task attempt has failed if - # the app's handler returns a non-2xx response code or Cloud Tasks does - # not receive response before the - # {::Google::Cloud::Tasks::V2beta3::Task#dispatch_deadline deadline}. Failed tasks - # will be retried according to the [retry - # configuration][google.cloud.tasks.v2beta3.Queue.retry_config]. `503` (Service - # Unavailable) is considered an App Engine system error instead of an - # application error and will cause Cloud Tasks' traffic congestion control to - # temporarily throttle the queue's dispatches. Unlike other types of task - # targets, a `429` (Too Many Requests) response from an app handler does not - # cause traffic congestion control to throttle the queue. - # @!attribute [rw] http_method - # @return [::Google::Cloud::Tasks::V2beta3::HttpMethod] - # The HTTP method to use for the request. The default is POST. - # - # The app's request handler for the task's target URL must be able to handle - # HTTP requests with this http_method, otherwise the task attempt fails with - # error code 405 (Method Not Allowed). See [Writing a push task request - # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - # and the App Engine documentation for your runtime on [How Requests are - # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - # @!attribute [rw] app_engine_routing - # @return [::Google::Cloud::Tasks::V2beta3::AppEngineRouting] - # Task-level setting for App Engine routing. - # - # If set, - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpQueue#app_engine_routing_override app_engine_routing_override} - # is used for all tasks in the queue, no matter what the setting is for the - # [task-level - # app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - # @!attribute [rw] relative_uri - # @return [::String] - # The relative URI. - # - # The relative URI must begin with "/" and must be a valid HTTP relative URI. - # It can contain a path and query string arguments. - # If the relative URI is empty, then the root path "/" will be used. - # No spaces are allowed, and the maximum length allowed is 2083 characters. - # @!attribute [rw] headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # HTTP request headers. - # - # This map contains the header field names and values. - # Headers can be set when the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. - # Repeated headers are not supported but a header value can contain commas. - # - # Cloud Tasks sets some headers to default values: - # - # * `User-Agent`: By default, this header is - # `"AppEngine-Google; (+http://code.google.com/appengine)"`. - # This header can be modified, but Cloud Tasks will append - # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - # modified `User-Agent`. - # - # If the task has a - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest#body body}, Cloud Tasks - # sets the following headers: - # - # * `Content-Type`: By default, the `Content-Type` header is set to - # `"application/octet-stream"`. The default can be overridden by explicitly - # setting `Content-Type` to a particular media type when the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task task is created}. - # For example, `Content-Type` can be set to `"application/json"`. - # * `Content-Length`: This is computed by Cloud Tasks. This value is - # output only. It cannot be changed. - # - # The headers below cannot be set or overridden: - # - # * `Host` - # * `X-Google-*` - # * `X-AppEngine-*` - # - # In addition, Cloud Tasks sets some headers when the task is dispatched, - # such as headers containing information about the task; see - # [request - # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - # These headers are set only when the task is dispatched, so they are not - # visible when the task is returned in a Cloud Tasks response. - # - # Although there is no specific limit for the maximum number of headers or - # the size, there is a limit on the maximum size of the - # {::Google::Cloud::Tasks::V2beta3::Task Task}. For more information, see the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask} - # documentation. - # @!attribute [rw] body - # @return [::String] - # HTTP request body. - # - # A request body is allowed only if the HTTP method is POST or PUT. It is - # an error to set a body on a task with an incompatible - # {::Google::Cloud::Tasks::V2beta3::HttpMethod HttpMethod}. - class AppEngineHttpRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # App Engine Routing. - # - # Defines routing characteristics specific to App Engine - service, version, - # and instance. - # - # For more information about services, versions, and instances see - # [An Overview of App - # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), - # [Microservices Architecture on Google App - # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] service - # @return [::String] - # App service. - # - # By default, the task is sent to the service which is the default - # service when the task is attempted. - # - # For some queues or tasks which were created using the App Engine - # Task Queue API, {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is - # not parsable into - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. For - # example, some tasks which were created using the App Engine SDK use a - # custom domain name; custom domains are not parsed by Cloud Tasks. If - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable, - # then {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance} are the - # empty string. - # @!attribute [rw] version - # @return [::String] - # App version. - # - # By default, the task is sent to the version which is the default - # version when the task is attempted. - # - # For some queues or tasks which were created using the App Engine - # Task Queue API, {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is - # not parsable into - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. For - # example, some tasks which were created using the App Engine SDK use a - # custom domain name; custom domains are not parsed by Cloud Tasks. If - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#host host} is not parsable, - # then {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance} are the - # empty string. - # @!attribute [rw] instance - # @return [::String] - # App instance. - # - # By default, the task is sent to an instance which is available when - # the task is attempted. - # - # Requests can only be sent to a specific instance if - # [manual scaling is used in App Engine - # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - # App Engine Flex does not support instances. For more information, see - # [App Engine Standard request - # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - # and [App Engine Flex request - # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - # @!attribute [rw] host - # @return [::String] - # Output only. The host that the task is sent to. - # - # The host is constructed from the domain name of the app associated with - # the queue's project ID (for example .appspot.com), and the - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#service service}, - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#version version}, and - # {::Google::Cloud::Tasks::V2beta3::AppEngineRouting#instance instance}. Tasks - # which were created using the App Engine SDK might have a custom domain - # name. - # - # For more information, see - # [How Requests are - # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - class AppEngineRouting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). - # This type of authorization should generally only be used when calling Google - # APIs hosted on *.googleapis.com. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OAuth token. - # The service account must be within the same project as the queue. The - # caller must have iam.serviceAccounts.actAs permission for the service - # account. - # @!attribute [rw] scope - # @return [::String] - # OAuth scope to be used for generating OAuth access token. - # If not specified, "https://www.googleapis.com/auth/cloud-platform" - # will be used. - class OAuthToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information needed for generating an - # [OpenID Connect - # token](https://developers.google.com/identity/protocols/OpenIDConnect). - # This type of authorization can be used for many scenarios, including - # calling Cloud Run, or endpoints where you intend to validate the token - # yourself. - # @!attribute [rw] service_account_email - # @return [::String] - # [Service account email](https://cloud.google.com/iam/docs/service-accounts) - # to be used for generating OIDC token. - # The service account must be within the same project as the queue. The - # caller must have iam.serviceAccounts.actAs permission for the service - # account. - # @!attribute [rw] audience - # @return [::String] - # Audience to be used when generating OIDC token. If not specified, the URI - # specified in target will be used. - class OidcToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The HTTP method used to execute the task. - module HttpMethod - # HTTP method unspecified - HTTP_METHOD_UNSPECIFIED = 0 - - # HTTP POST - POST = 1 - - # HTTP GET - GET = 2 - - # HTTP HEAD - HEAD = 3 - - # HTTP PUT - PUT = 4 - - # HTTP DELETE - DELETE = 5 - - # HTTP PATCH - PATCH = 6 - - # HTTP OPTIONS - OPTIONS = 7 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb deleted file mode 100644 index b412727c1c81..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/cloud/tasks/v2beta3/task.rb +++ /dev/null @@ -1,213 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - module V2beta3 - # A unit of scheduled work. - # @!attribute [rw] name - # @return [::String] - # Optionally caller-specified in - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task CreateTask}. - # - # The task name. - # - # The task name must have the following format: - # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - # - # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), colons (:), or periods (.). - # For more information, see - # [Identifying - # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - # * `LOCATION_ID` is the canonical ID for the task's location. - # The list of available locations can be obtained by calling - # [ListLocations][google.cloud.location.Locations.ListLocations]. - # For more information, see https://cloud.google.com/about/locations/. - # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - # hyphens (-). The maximum length is 100 characters. - # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - # hyphens (-), or underscores (_). The maximum length is 500 characters. - # @!attribute [rw] app_engine_http_request - # @return [::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest] - # HTTP request that is sent to the App Engine app handler. - # - # An App Engine task is a task that has - # {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest AppEngineHttpRequest} - # set. - # - # Note: The following fields are mutually exclusive: `app_engine_http_request`, `http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] http_request - # @return [::Google::Cloud::Tasks::V2beta3::HttpRequest] - # HTTP request that is sent to the task's target. - # - # An HTTP task is a task that has - # {::Google::Cloud::Tasks::V2beta3::HttpRequest HttpRequest} set. - # - # Note: The following fields are mutually exclusive: `http_request`, `app_engine_http_request`, `pull_message`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] pull_message - # @return [::Google::Cloud::Tasks::V2beta3::PullMessage] - # Pull Message contained in a task in a - # {::Google::Cloud::Tasks::V2beta3::Queue#type PULL} queue type. This payload - # type cannot be explicitly set through Cloud Tasks API. Its purpose, - # currently is to provide backward compatibility with App Engine Task Queue - # [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) - # queues to provide a way to inspect contents of pull tasks through the - # {::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task CloudTasks.GetTask}. - # - # Note: The following fields are mutually exclusive: `pull_message`, `app_engine_http_request`, `http_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # The time when the task is scheduled to be attempted. - # - # For App Engine queues, this is when the task will be attempted or retried. - # - # `schedule_time` will be truncated to the nearest microsecond. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that the task was created. - # - # `create_time` will be truncated to the nearest second. - # @!attribute [rw] dispatch_deadline - # @return [::Google::Protobuf::Duration] - # The deadline for requests sent to the worker. If the worker does not - # respond by this deadline then the request is cancelled and the attempt - # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - # task according to the - # {::Google::Cloud::Tasks::V2beta3::RetryConfig RetryConfig}. - # - # Note that when the request is cancelled, Cloud Tasks will stop listening - # for the response, but whether the worker stops processing depends on the - # worker. For example, if the worker is stuck, it may not react to cancelled - # requests. - # - # The default and maximum values depend on the type of request: - # - # * For {::Google::Cloud::Tasks::V2beta3::HttpRequest HTTP tasks}, the default is - # 10 minutes. The deadline - # must be in the interval [15 seconds, 30 minutes]. - # - # * For {::Google::Cloud::Tasks::V2beta3::AppEngineHttpRequest App Engine tasks}, - # 0 indicates that the - # request has the default deadline. The default deadline depends on the - # [scaling - # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - # of the service: 10 minutes for standard apps with automatic scaling, 24 - # hours for standard apps with manual and basic scaling, and 60 minutes for - # flex apps. If the request deadline is set, it must be in the interval [15 - # seconds, 24 hours 15 seconds]. Regardless of the task's - # `dispatch_deadline`, the app handler will not run for longer than than - # the service's timeout. We recommend setting the `dispatch_deadline` to - # at most a few seconds more than the app handler's timeout. For more - # information see - # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - # - # `dispatch_deadline` will be truncated to the nearest millisecond. The - # deadline is an approximate deadline. - # @!attribute [rw] dispatch_count - # @return [::Integer] - # Output only. The number of attempts dispatched. - # - # This count includes attempts which have been dispatched but haven't - # received a response. - # @!attribute [rw] response_count - # @return [::Integer] - # Output only. The number of attempts which have received a response. - # @!attribute [rw] first_attempt - # @return [::Google::Cloud::Tasks::V2beta3::Attempt] - # Output only. The status of the task's first attempt. - # - # Only {::Google::Cloud::Tasks::V2beta3::Attempt#dispatch_time dispatch_time} will - # be set. The other {::Google::Cloud::Tasks::V2beta3::Attempt Attempt} information - # is not retained by Cloud Tasks. - # @!attribute [rw] last_attempt - # @return [::Google::Cloud::Tasks::V2beta3::Attempt] - # Output only. The status of the task's last attempt. - # @!attribute [rw] view - # @return [::Google::Cloud::Tasks::V2beta3::Task::View] - # Output only. The view specifies which subset of the - # {::Google::Cloud::Tasks::V2beta3::Task Task} has been returned. - class Task - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The view specifies a subset of {::Google::Cloud::Tasks::V2beta3::Task Task} - # data. - # - # When a task is returned in a response, not all - # information is retrieved by default because some data, such as - # payloads, might be desirable to return only when needed because - # of its large size or because of the sensitivity of data that it - # contains. - module View - # Unspecified. Defaults to BASIC. - VIEW_UNSPECIFIED = 0 - - # The basic view omits fields which can be large or can contain - # sensitive data. - # - # This view does not include the - # [body in - # AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body]. - # Bodies are desirable to return only when needed, because they - # can be large and because of the sensitivity of the data that you - # choose to store in it. - BASIC = 1 - - # All information is returned. - # - # Authorization for {::Google::Cloud::Tasks::V2beta3::Task::View::FULL FULL} - # requires `cloudtasks.tasks.fullView` [Google - # IAM](https://cloud.google.com/iam/) permission on the - # {::Google::Cloud::Tasks::V2beta3::Queue Queue} resource. - FULL = 2 - end - end - - # The status of a task attempt. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt was scheduled. - # - # `schedule_time` will be truncated to the nearest microsecond. - # @!attribute [rw] dispatch_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt was dispatched. - # - # `dispatch_time` will be truncated to the nearest microsecond. - # @!attribute [rw] response_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time that this attempt response was received. - # - # `response_time` will be truncated to the nearest microsecond. - # @!attribute [rw] response_status - # @return [::Google::Rpc::Status] - # Output only. The response from the worker for this attempt. - # - # If `response_time` is unset, then the task has not been attempted or is - # currently running and the `response_status` field is meaningless. - class Attempt - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3/snippets/Gemfile b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile deleted file mode 100644 index b6cbdf612a3b..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks-v2beta3", path: "../" -else - gem "google-cloud-tasks-v2beta3" -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-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb deleted file mode 100644 index 9d315fa5fb2a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the create_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#create_queue. -# -def create_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new - - # Call the create_queue method. - result = client.create_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb deleted file mode 100644 index 1307bbaa425c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the create_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#create_task. -# -def create_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new - - # Call the create_task method. - result = client.create_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb deleted file mode 100644 index 32780452f076..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the delete_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#delete_queue. -# -def delete_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new - - # Call the delete_queue method. - result = client.delete_queue request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb deleted file mode 100644 index 2e14ac7238d7..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the delete_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#delete_task. -# -def delete_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new - - # Call the delete_task method. - result = client.delete_task request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb deleted file mode 100644 index b67132daf33c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the get_iam_policy call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb deleted file mode 100644 index 6a08e7775a37..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the get_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#get_queue. -# -def get_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new - - # Call the get_queue method. - result = client.get_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb deleted file mode 100644 index 7601d4c33b48..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the get_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#get_task. -# -def get_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new - - # Call the get_task method. - result = client.get_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb deleted file mode 100644 index 221826aa161c..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the list_queues call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#list_queues. -# -def list_queues - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new - - # Call the list_queues method. - result = client.list_queues 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::Tasks::V2beta3::Queue. - p item - end -end -# [END cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb deleted file mode 100644 index e3e486644e66..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the list_tasks call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#list_tasks. -# -def list_tasks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new - - # Call the list_tasks method. - result = client.list_tasks 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::Tasks::V2beta3::Task. - p item - end -end -# [END cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb deleted file mode 100644 index d2ece1b4633a..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the pause_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#pause_queue. -# -def pause_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new - - # Call the pause_queue method. - result = client.pause_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb deleted file mode 100644 index 0948654d23db..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the purge_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#purge_queue. -# -def purge_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new - - # Call the purge_queue method. - result = client.purge_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb deleted file mode 100644 index e22638c37139..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the resume_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#resume_queue. -# -def resume_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new - - # Call the resume_queue method. - result = client.resume_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb deleted file mode 100644 index dae7f35f5236..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the run_task call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#run_task. -# -def run_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new - - # Call the run_task method. - result = client.run_task request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb deleted file mode 100644 index f83897ede198..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the set_iam_policy call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb deleted file mode 100644 index ee6f4a9fcbc0..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the test_iam_permissions call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb deleted file mode 100644 index cc52805757c2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] -require "google/cloud/tasks/v2beta3" - -## -# Snippet for the update_queue call in the CloudTasks 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::Tasks::V2beta3::CloudTasks::Client#update_queue. -# -def update_queue - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new - - # Call the update_queue method. - result = client.update_queue request - - # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. - p result -end -# [END cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json b/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json deleted file mode 100644 index 7d11f956527e..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json +++ /dev/null @@ -1,655 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-tasks-v2beta3", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.tasks.v2beta3", - "version": "v2beta3" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync", - "title": "Snippet for the list_queues call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues.", - "file": "cloud_tasks/list_queues.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_queues", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::ListQueuesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::ListQueuesResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "ListQueues", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.ListQueues", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync", - "title": "Snippet for the get_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue.", - "file": "cloud_tasks/get_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_queue", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::GetQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "GetQueue", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.GetQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync", - "title": "Snippet for the create_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue.", - "file": "cloud_tasks/create_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_queue", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::CreateQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "CreateQueue", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.CreateQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync", - "title": "Snippet for the update_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue.", - "file": "cloud_tasks/update_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_queue", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "UpdateQueue", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync", - "title": "Snippet for the delete_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue.", - "file": "cloud_tasks/delete_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_queue", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "DeleteQueue", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync", - "title": "Snippet for the purge_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue.", - "file": "cloud_tasks/purge_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_queue", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "PurgeQueue", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync", - "title": "Snippet for the pause_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue.", - "file": "cloud_tasks/pause_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_queue", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::PauseQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "PauseQueue", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.PauseQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync", - "title": "Snippet for the resume_queue call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue.", - "file": "cloud_tasks/resume_queue.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_queue", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Queue", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "ResumeQueue", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_iam_policy.", - "file": "cloud_tasks/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicy", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#set_iam_policy.", - "file": "cloud_tasks/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicy", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#test_iam_permissions.", - "file": "cloud_tasks/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissions", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync", - "title": "Snippet for the list_tasks call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks.", - "file": "cloud_tasks/list_tasks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tasks", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::ListTasksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::ListTasksResponse", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "ListTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.ListTasks", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync", - "title": "Snippet for the get_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task.", - "file": "cloud_tasks/get_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_task", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::GetTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "GetTask", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.GetTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync", - "title": "Snippet for the create_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task.", - "file": "cloud_tasks/create_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_task", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::CreateTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "CreateTask", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.CreateTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync", - "title": "Snippet for the delete_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task.", - "file": "cloud_tasks/delete_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_task", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "DeleteTask", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.DeleteTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync", - "title": "Snippet for the run_task call in the CloudTasks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task.", - "file": "cloud_tasks/run_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_task", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tasks::V2beta3::RunTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tasks::V2beta3::Task", - "client": { - "short_name": "CloudTasks::Client", - "full_name": "::Google::Cloud::Tasks::V2beta3::CloudTasks::Client" - }, - "method": { - "short_name": "RunTask", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks.RunTask", - "service": { - "short_name": "CloudTasks", - "full_name": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - }, - "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-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb deleted file mode 100644 index 664ebc6b1b18..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_paths_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloud_tasks" - -class ::Google::Cloud::Tasks::V2beta3::CloudTasks::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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::Tasks::V2beta3::CloudTasks::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_queue_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.queue_path project: "value0", location: "value1", queue: "value2" - assert_equal "projects/value0/locations/value1/queues/value2", path - end - end - - def test_task_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.task_path project: "value0", location: "value1", queue: "value2", task: "value3" - assert_equal "projects/value0/locations/value1/queues/value2/tasks/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb deleted file mode 100644 index 34a301c32a3d..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_rest_test.rb +++ /dev/null @@ -1,981 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" -require "google/cloud/tasks/v2beta3/cloud_tasks/rest" - - -class ::Google::Cloud::Tasks::V2beta3::CloudTasks::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_queues - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - read_mask = {} - - list_queues_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_list_queues_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_queues_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_queues ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_queues(::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_queues_client_stub.call_count - end - end - end - - def test_get_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - read_mask = {} - - get_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_get_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_queue({ name: name, read_mask: read_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_queue name: name, read_mask: read_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_queue ::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_queue({ name: name, read_mask: read_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_queue(::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_queue_client_stub.call_count - end - end - end - - def test_create_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - queue = {} - - create_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_create_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_queue({ parent: parent, queue: queue }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_queue parent: parent, queue: queue do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_queue ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_queue({ parent: parent, queue: queue }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_queue(::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_queue_client_stub.call_count - end - end - end - - def test_update_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - queue = {} - update_mask = {} - - update_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_update_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_queue({ queue: queue, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_queue queue: queue, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_queue ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_queue({ queue: queue, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_queue(::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_queue_client_stub.call_count - end - end - end - - def test_delete_queue - # 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_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_delete_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_queue ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_queue(::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_queue_client_stub.call_count - end - end - end - - def test_purge_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - purge_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_purge_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_queue ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_queue(::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_queue_client_stub.call_count - end - end - end - - def test_pause_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - pause_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_pause_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_queue ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_queue(::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_queue_client_stub.call_count - end - end - end - - def test_resume_queue - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Queue.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - resume_queue_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_resume_queue_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_queue({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_queue name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_queue ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_queue({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_queue(::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_queue_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_list_tasks - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - response_view = :VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tasks({ parent: parent, response_view: response_view, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tasks parent: parent, response_view: response_view, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tasks ::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_count - end - end - end - - def test_get_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - response_view = :VIEW_UNSPECIFIED - - get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_task({ name: name, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_task name: name, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_task ::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_task({ name: name, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_count - end - end - end - - def test_create_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - task = {} - response_view = :VIEW_UNSPECIFIED - - create_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_create_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_task({ parent: parent, task: task, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_task parent: parent, task: task, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_task ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_task({ parent: parent, task: task, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_task(::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_task_client_stub.call_count - end - end - end - - def test_delete_task - # 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_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_delete_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_task({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_task name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_task ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_task({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_task(::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_task_client_stub.call_count - end - end - end - - def test_run_task - # Create test objects. - client_result = ::Google::Cloud::Tasks::V2beta3::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - response_view = :VIEW_UNSPECIFIED - - run_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Tasks::V2beta3::CloudTasks::Rest::ServiceStub.stub :transcode_run_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_task({ name: name, response_view: response_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_task name: name, response_view: response_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_task ::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_task({ name: name, response_view: response_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_task(::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_task_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::Tasks::V2beta3::CloudTasks::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::Tasks::V2beta3::CloudTasks::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb deleted file mode 100644 index f2365c3dd2eb..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/google/cloud/tasks/v2beta3/cloud_tasks_test.rb +++ /dev/null @@ -1,1078 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks/v2beta3/cloudtasks_pb" -require "google/cloud/tasks/v2beta3/cloud_tasks" - -class ::Google::Cloud::Tasks::V2beta3::CloudTasks::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_queues - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::ListQueuesResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - read_mask = {} - - list_queues_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_queues, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_queues_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }) 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_queues parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask 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_queues ::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask) 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_queues({ parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask }, 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_queues(::Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token, read_mask: read_mask), 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_queues_client_stub.call_rpc_count - end - end - - def test_get_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" - read_mask = {} - - get_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::GetQueueRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["read_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_queue({ name: name, read_mask: read_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_queue name: name, read_mask: read_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_queue ::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_queue({ name: name, read_mask: read_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_queue(::Google::Cloud::Tasks::V2beta3::GetQueueRequest.new(name: name, read_mask: read_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_queue_client_stub.call_rpc_count - end - end - - def test_create_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" - queue = {} - - create_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta3::Queue), request["queue"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_queue({ parent: parent, queue: queue }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_queue parent: parent, queue: queue do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_queue ::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_queue({ parent: parent, queue: queue }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_queue(::Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new(parent: parent, queue: queue), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_queue_client_stub.call_rpc_count - end - end - - def test_update_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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. - queue = {} - update_mask = {} - - update_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta3::Queue), request["queue"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_queue({ queue: queue, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_queue queue: queue, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_queue ::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, 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_queue({ queue: queue, 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_queue(::Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new(queue: queue, 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_queue_client_stub.call_rpc_count - end - end - - def test_delete_queue - # 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_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_queue ::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_queue({ 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_queue(::Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.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_queue_client_stub.call_rpc_count - end - end - - def test_purge_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" - - purge_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.purge_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.purge_queue ::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.purge_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.purge_queue(::Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.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, purge_queue_client_stub.call_rpc_count - end - end - - def test_pause_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" - - pause_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_queue ::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.pause_queue(::Google::Cloud::Tasks::V2beta3::PauseQueueRequest.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, pause_queue_client_stub.call_rpc_count - end - end - - def test_resume_queue - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Queue.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" - - resume_queue_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_queue, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_queue_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_queue({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_queue name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_queue ::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_queue({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resume_queue(::Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.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, resume_queue_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_list_tasks - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::ListTasksResponse.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" - response_view = :VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tasks, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::ListTasksRequest, request - assert_equal "hello world", request["parent"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tasks({ parent: parent, response_view: response_view, 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_tasks parent: parent, response_view: response_view, 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_tasks ::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks({ parent: parent, response_view: response_view, 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_tasks(::Google::Cloud::Tasks::V2beta3::ListTasksRequest.new(parent: parent, response_view: response_view, 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_tasks_client_stub.call_rpc_count - end - end - - def test_get_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Task.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" - response_view = :VIEW_UNSPECIFIED - - get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::GetTaskRequest, request - assert_equal "hello world", request["name"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_task({ name: name, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_task name: name, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_task ::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Tasks::V2beta3::GetTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_rpc_count - end - end - - def test_create_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Task.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" - task = {} - response_view = :VIEW_UNSPECIFIED - - create_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tasks::V2beta3::Task), request["task"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_task({ parent: parent, task: task, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_task parent: parent, task: task, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_task ::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_task({ parent: parent, task: task, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_task(::Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new(parent: parent, task: task, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_task_client_stub.call_rpc_count - end - end - - def test_delete_task - # 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_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_task({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_task name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_task ::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_task({ 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_task(::Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.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_task_client_stub.call_rpc_count - end - end - - def test_run_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tasks::V2beta3::Task.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" - response_view = :VIEW_UNSPECIFIED - - run_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_task, name - assert_kind_of ::Google::Cloud::Tasks::V2beta3::RunTaskRequest, request - assert_equal "hello world", request["name"] - assert_equal :VIEW_UNSPECIFIED, request["response_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_task_client_stub do - # Create client - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_task({ name: name, response_view: response_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.run_task name: name, response_view: response_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.run_task ::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.run_task({ name: name, response_view: response_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.run_task(::Google::Cloud::Tasks::V2beta3::RunTaskRequest.new(name: name, response_view: response_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, run_task_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::Tasks::V2beta3::CloudTasks::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::Tasks::V2beta3::CloudTasks::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Tasks::V2beta3::CloudTasks::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb b/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-tasks-v2beta3/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tasks/.gitignore b/owl-bot-staging/google-cloud-tasks/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-tasks/.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-tasks/.repo-metadata.json b/owl-bot-staging/google-cloud-tasks/.repo-metadata.json deleted file mode 100644 index 4e9d979cb67d..000000000000 --- a/owl-bot-staging/google-cloud-tasks/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudtasks.googleapis.com", - "api_shortname": "cloudtasks", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tasks/latest", - "distribution_name": "google-cloud-tasks", - "is_cloud": true, - "language": "ruby", - "name": "cloudtasks", - "name_pretty": "Cloud Tasks API", - "product_documentation": "https://cloud.google.com/tasks", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint.", - "ruby-cloud-env-prefix": "TASKS", - "ruby-cloud-product-url": "https://cloud.google.com/tasks", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-tasks/.rubocop.yml b/owl-bot-staging/google-cloud-tasks/.rubocop.yml deleted file mode 100644 index c07b01625905..000000000000 --- a/owl-bot-staging/google-cloud-tasks/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-tasks.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-tasks.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-tasks/.toys.rb b/owl-bot-staging/google-cloud-tasks/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-tasks/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tasks/.yardopts b/owl-bot-staging/google-cloud-tasks/.yardopts deleted file mode 100644 index 2b302fd18f8d..000000000000 --- a/owl-bot-staging/google-cloud-tasks/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Cloud Tasks API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md deleted file mode 100644 index 5f0d0f4d1e7e..000000000000 --- a/owl-bot-staging/google-cloud-tasks/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-tasks 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-tasks 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/tasks" - -client = Google::Cloud::Tasks.cloud_tasks do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/tasks" - -Google::Cloud::Tasks.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Tasks.cloud_tasks -``` - -### 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-tasks -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/tasks" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Tasks.cloud_tasks -``` - -### 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-tasks/CHANGELOG.md b/owl-bot-staging/google-cloud-tasks/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-tasks/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-tasks/Gemfile b/owl-bot-staging/google-cloud-tasks/Gemfile deleted file mode 100644 index e00b46b52de6..000000000000 --- a/owl-bot-staging/google-cloud-tasks/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-tasks-v2"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-tasks.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.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-tasks/LICENSE.md b/owl-bot-staging/google-cloud-tasks/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-tasks/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-tasks/README.md b/owl-bot-staging/google-cloud-tasks/README.md deleted file mode 100644 index 8934af5f1638..000000000000 --- a/owl-bot-staging/google-cloud-tasks/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Cloud Tasks API - -API Client library for the Cloud Tasks API - -Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-tasks-v*`. -The gem `google-cloud-tasks` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks/latest) -for this library, google-cloud-tasks, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-tasks-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest). - -See also the [Product Documentation](https://cloud.google.com/tasks) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-tasks -``` - -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/cloudtasks.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/tasks" - -client = Google::Cloud::Tasks.cloud_tasks -request = ::Google::Cloud::Tasks::V2::ListQueuesRequest.new # (request fields as keyword arguments...) -response = client.list_queues request -``` - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-tasks-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -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-tasks`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-tasks-v2`. -_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-tasks`. -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-tasks-v2`. - -### 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-tasks/Rakefile b/owl-bot-staging/google-cloud-tasks/Rakefile deleted file mode 100644 index e99b19a2d841..000000000000 --- a/owl-bot-staging/google-cloud-tasks/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true -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-tasks acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TASKS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TASKS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TASKS_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 TASKS_TEST_PROJECT=test123 TASKS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/tasks/v2/cloud_tasks/credentials" - ::Google::Cloud::Tasks::V2::CloudTasks::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TASKS_PROJECT"] = project - ENV["TASKS_TEST_PROJECT"] = project - ENV["TASKS_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-tasks 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-tasks 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-tasks 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-tasks gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-tasks" - header "google-cloud-tasks rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-tasks yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-tasks 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-tasks 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-tasks 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-tasks/google-cloud-tasks.gemspec b/owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec deleted file mode 100644 index 253fbf39f050..000000000000 --- a/owl-bot-staging/google-cloud-tasks/google-cloud-tasks.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/tasks/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-tasks" - gem.version = Google::Cloud::Tasks::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint." - gem.summary = "API Client library for the Cloud Tasks API" - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-tasks-v2", "~> 1.2" -end diff --git a/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb b/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb deleted file mode 100644 index df59ff14f098..000000000000 --- a/owl-bot-staging/google-cloud-tasks/lib/google-cloud-tasks.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tasks" unless defined? Google::Cloud::Tasks::VERSION diff --git a/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb deleted file mode 100644 index 592f1b9b9a67..000000000000 --- a/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/tasks/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :tasks do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Tasks - ## - # Create a new client object for CloudTasks. - # - # By default, this returns an instance of - # [Google::Cloud::Tasks::V2::CloudTasks::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-tasks-v2/latest/Google-Cloud-Tasks-V2-CloudTasks-Client) - # for a gRPC client for version V2 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the CloudTasks service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the CloudTasks service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Tasks.cloud_tasks_available?}. - # - # ## About CloudTasks - # - # Cloud Tasks allows developers to manage the execution of background - # work in their applications. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.cloud_tasks version: :v2, transport: :grpc, &block - require "google/cloud/tasks/#{version.to_s.downcase}" - - package_name = Google::Cloud::Tasks - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Tasks.const_get(package_name).const_get(:CloudTasks) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the CloudTasks service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Tasks.cloud_tasks}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the CloudTasks service, - # or if the versioned client gem needs an update to support the CloudTasks service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v2`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.cloud_tasks_available? version: :v2, transport: :grpc - require "google/cloud/tasks/#{version.to_s.downcase}" - package_name = Google::Cloud::Tasks - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Tasks.const_get package_name - return false unless service_module.const_defined? :CloudTasks - service_module = service_module.const_get :CloudTasks - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-tasks library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.tasks if block_given? - - ::Google::Cloud.configure.tasks - end - end - end -end - -helper_path = ::File.join __dir__, "tasks", "helpers.rb" -require "google/cloud/tasks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb b/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb deleted file mode 100644 index 118a7f73c05a..000000000000 --- a/owl-bot-staging/google-cloud-tasks/lib/google/cloud/tasks/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tasks - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb b/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb deleted file mode 100644 index 2ecc1556262b..000000000000 --- a/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/client_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tasks" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Tasks::ClientConstructionMinitest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_cloud_tasks_grpc - skip unless Google::Cloud::Tasks.cloud_tasks_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Tasks.cloud_tasks transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Tasks::V2::CloudTasks::Client, client - end - end - - def test_cloud_tasks_rest - skip unless Google::Cloud::Tasks.cloud_tasks_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Tasks.cloud_tasks transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Tasks::V2::CloudTasks::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb b/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb deleted file mode 100644 index c09f853a2397..000000000000 --- a/owl-bot-staging/google-cloud-tasks/test/google/cloud/tasks/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tasks/version" - -class Google::Cloud::Tasks::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Tasks::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-tasks/test/helper.rb b/owl-bot-staging/google-cloud-tasks/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-tasks/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/.gitignore b/owl-bot-staging/google-cloud-telco_automation-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-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-telco_automation-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-telco_automation-v1/.repo-metadata.json deleted file mode 100644 index 6fa8f0fd2fc5..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "telcoautomation.googleapis.com", - "api_shortname": "telcoautomation", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest", - "distribution_name": "google-cloud-telco_automation-v1", - "is_cloud": true, - "language": "ruby", - "name": "telcoautomation", - "name_pretty": "Telco Automation V1 API", - "product_documentation": "https://cloud.google.com/telecom-network-automation", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "APIs to automate management of cloud infrastructure for network functions. Note that google-cloud-telco_automation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-telco_automation instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/telecom-network-automation", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml b/owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml deleted file mode 100644 index d6fc34a05a64..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-telco_automation-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-telco_automation-v1.rb" diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb b/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/.yardopts b/owl-bot-staging/google-cloud-telco_automation-v1/.yardopts deleted file mode 100644 index 74eef8dd924a..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Telco Automation 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-telco_automation-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-telco_automation-v1/AUTHENTICATION.md deleted file mode 100644 index 15c5b59bafcf..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-telco_automation-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-telco_automation-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/telco_automation/v1" - -client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/telco_automation/v1" - -::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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-telco_automation-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/telco_automation/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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-telco_automation-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-telco_automation-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile b/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-telco_automation-v1/LICENSE.md b/owl-bot-staging/google-cloud-telco_automation-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-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-telco_automation-v1/README.md b/owl-bot-staging/google-cloud-telco_automation-v1/README.md deleted file mode 100644 index f64067ee0d10..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Telco Automation V1 API - -APIs to automate management of cloud infrastructure for network functions. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Telco Automation V1 API. Most users should consider using -the main client gem, -[google-cloud-telco_automation](https://rubygems.org/gems/google-cloud-telco_automation). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-telco_automation-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/telcoautomation.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/telco_automation/v1" - -client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new -request = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new # (request fields as keyword arguments...) -response = client.list_orchestration_clusters request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/telecom-network-automation) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/telco_automation/v1" -require "logger" - -client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-telco_automation`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-telco_automation-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-telco_automation`. -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-telco_automation-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-telco_automation-v1/Rakefile b/owl-bot-staging/google-cloud-telco_automation-v1/Rakefile deleted file mode 100644 index 2264fb9ae7a4..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/telco_automation/v1/telco_automation/credentials" - ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-telco_automation-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-telco_automation-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-telco_automation-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-telco_automation-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-telco_automation-v1" - header "google-cloud-telco_automation-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-telco_automation-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-telco_automation-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-telco_automation-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-telco_automation-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-telco_automation-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-telco_automation-v1/gapic_metadata.json deleted file mode 100644 index f7243c38771e..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/gapic_metadata.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.telcoautomation.v1", - "libraryPackage": "::Google::Cloud::TelcoAutomation::V1", - "services": { - "TelcoAutomation": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client", - "rpcs": { - "ListOrchestrationClusters": { - "methods": [ - "list_orchestration_clusters" - ] - }, - "GetOrchestrationCluster": { - "methods": [ - "get_orchestration_cluster" - ] - }, - "CreateOrchestrationCluster": { - "methods": [ - "create_orchestration_cluster" - ] - }, - "DeleteOrchestrationCluster": { - "methods": [ - "delete_orchestration_cluster" - ] - }, - "ListEdgeSlms": { - "methods": [ - "list_edge_slms" - ] - }, - "GetEdgeSlm": { - "methods": [ - "get_edge_slm" - ] - }, - "CreateEdgeSlm": { - "methods": [ - "create_edge_slm" - ] - }, - "DeleteEdgeSlm": { - "methods": [ - "delete_edge_slm" - ] - }, - "CreateBlueprint": { - "methods": [ - "create_blueprint" - ] - }, - "UpdateBlueprint": { - "methods": [ - "update_blueprint" - ] - }, - "GetBlueprint": { - "methods": [ - "get_blueprint" - ] - }, - "DeleteBlueprint": { - "methods": [ - "delete_blueprint" - ] - }, - "ListBlueprints": { - "methods": [ - "list_blueprints" - ] - }, - "ApproveBlueprint": { - "methods": [ - "approve_blueprint" - ] - }, - "ProposeBlueprint": { - "methods": [ - "propose_blueprint" - ] - }, - "RejectBlueprint": { - "methods": [ - "reject_blueprint" - ] - }, - "ListBlueprintRevisions": { - "methods": [ - "list_blueprint_revisions" - ] - }, - "SearchBlueprintRevisions": { - "methods": [ - "search_blueprint_revisions" - ] - }, - "SearchDeploymentRevisions": { - "methods": [ - "search_deployment_revisions" - ] - }, - "DiscardBlueprintChanges": { - "methods": [ - "discard_blueprint_changes" - ] - }, - "ListPublicBlueprints": { - "methods": [ - "list_public_blueprints" - ] - }, - "GetPublicBlueprint": { - "methods": [ - "get_public_blueprint" - ] - }, - "CreateDeployment": { - "methods": [ - "create_deployment" - ] - }, - "UpdateDeployment": { - "methods": [ - "update_deployment" - ] - }, - "GetDeployment": { - "methods": [ - "get_deployment" - ] - }, - "RemoveDeployment": { - "methods": [ - "remove_deployment" - ] - }, - "ListDeployments": { - "methods": [ - "list_deployments" - ] - }, - "ListDeploymentRevisions": { - "methods": [ - "list_deployment_revisions" - ] - }, - "DiscardDeploymentChanges": { - "methods": [ - "discard_deployment_changes" - ] - }, - "ApplyDeployment": { - "methods": [ - "apply_deployment" - ] - }, - "ComputeDeploymentStatus": { - "methods": [ - "compute_deployment_status" - ] - }, - "RollbackDeployment": { - "methods": [ - "rollback_deployment" - ] - }, - "GetHydratedDeployment": { - "methods": [ - "get_hydrated_deployment" - ] - }, - "ListHydratedDeployments": { - "methods": [ - "list_hydrated_deployments" - ] - }, - "UpdateHydratedDeployment": { - "methods": [ - "update_hydrated_deployment" - ] - }, - "ApplyHydratedDeployment": { - "methods": [ - "apply_hydrated_deployment" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec b/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec deleted file mode 100644 index 430444fcf8a1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/google-cloud-telco_automation-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/telco_automation/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-telco_automation-v1" - gem.version = Google::Cloud::TelcoAutomation::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "APIs to automate management of cloud infrastructure for network functions. Note that google-cloud-telco_automation-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-telco_automation instead. See the readme for more details." - gem.summary = "APIs to automate management of cloud infrastructure for network functions." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb deleted file mode 100644 index 259caf3da82e..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google-cloud-telco_automation-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1" diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb deleted file mode 100644 index 8ead8612208c..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/telco_automation" -require "google/cloud/telco_automation/v1/version" - -module Google - module Cloud - module TelcoAutomation - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/telco_automation/v1" - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/telco_automation/v1" - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/telco_automation/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb deleted file mode 100644 index df522790e2b1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" - -module Google - module Cloud - module TelcoAutomation - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/telco_automation/v1/rest" - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "TelcoAutomation"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb deleted file mode 100644 index 51f472690194..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/telco_automation/rest" -require "google/cloud/telco_automation/v1/bindings_override" -require "google/cloud/telco_automation/v1/version" - -module Google - module Cloud - module TelcoAutomation - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/telco_automation/v1/rest" - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb deleted file mode 100644 index 2fe22c8a42e7..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/version" - -require "google/cloud/telco_automation/v1/telco_automation/credentials" -require "google/cloud/telco_automation/v1/telco_automation/paths" -require "google/cloud/telco_automation/v1/telco_automation/operations" -require "google/cloud/telco_automation/v1/telco_automation/client" -require "google/cloud/telco_automation/v1/telco_automation/rest" - -module Google - module Cloud - module TelcoAutomation - module V1 - ## - # TelcoAutomation Service manages the control plane cluster a.k.a. - # Orchestration Cluster (GKE cluster with config controller) of TNA. It also - # exposes blueprint APIs which manages the lifecycle of blueprints that control - # the infrastructure setup (e.g GDCE clusters) and deployment of network - # functions. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/telco_automation/v1/telco_automation" - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/telco_automation/v1/telco_automation/rest" - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - module TelcoAutomation - end - end - end - end -end - -helper_path = ::File.join __dir__, "telco_automation", "helpers.rb" -require "google/cloud/telco_automation/v1/telco_automation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb deleted file mode 100644 index 47ef08d71fa1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/client.rb +++ /dev/null @@ -1,4039 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" -require "google/cloud/location" - -module Google - module Cloud - module TelcoAutomation - module V1 - module TelcoAutomation - ## - # Client for the TelcoAutomation service. - # - # TelcoAutomation Service manages the control plane cluster a.k.a. - # Orchestration Cluster (GKE cluster with config controller) of TNA. It also - # exposes blueprint APIs which manages the lifecycle of blueprints that control - # the infrastructure setup (e.g GDCE clusters) and deployment of network - # functions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :telco_automation_stub - - ## - # Configure the TelcoAutomation Client class. - # - # See {::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TelcoAutomation clients - # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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", "TelcoAutomation", "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 TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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 - @telco_automation_stub.universe_domain - end - - ## - # Create a new TelcoAutomation client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TelcoAutomation 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/telcoautomation/v1/telcoautomation_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 - - @telco_automation_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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, - logger: @config.logger - ) - - @telco_automation_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @telco_automation_stub.endpoint - config.universe_domain = @telco_automation_stub.universe_domain - config.logger = @telco_automation_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @telco_automation_stub.logger - end - - # Service calls - - ## - # Lists OrchestrationClusters in a given project and location. - # - # @overload list_orchestration_clusters(request, options = nil) - # Pass arguments to `list_orchestration_clusters` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_orchestration_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 parent [::String] - # Required. Parent value for ListOrchestrationClustersRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new - # - # # Call the list_orchestration_clusters method. - # result = client.list_orchestration_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::TelcoAutomation::V1::OrchestrationCluster. - # p item - # end - # - def list_orchestration_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_orchestration_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_orchestration_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_orchestration_clusters, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single OrchestrationCluster. - # - # @overload get_orchestration_cluster(request, options = nil) - # Pass arguments to `get_orchestration_cluster` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil) - # Pass arguments to `get_orchestration_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 name [::String] - # Required. Name of the resource - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new - # - # # Call the get_orchestration_cluster method. - # result = client.get_orchestration_cluster request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::OrchestrationCluster. - # p result - # - def get_orchestration_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_orchestration_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :get_orchestration_cluster, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new OrchestrationCluster in a given project and location. - # - # @overload create_orchestration_cluster(request, options = nil) - # Pass arguments to `create_orchestration_cluster` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_cluster(parent: nil, orchestration_cluster_id: nil, orchestration_cluster: nil, request_id: nil) - # Pass arguments to `create_orchestration_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 parent [::String] - # Required. Value for parent. - # @param orchestration_cluster_id [::String] - # Required. Id of the requesting object - # If auto-generating Id server-side, remove this field and - # orchestration_cluster_id from the method_signature of Create RPC - # @param orchestration_cluster [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new - # - # # Call the create_orchestration_cluster method. - # result = client.create_orchestration_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_orchestration_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_orchestration_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :create_orchestration_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single OrchestrationCluster. - # - # @overload delete_orchestration_cluster(request, options = nil) - # Pass arguments to `delete_orchestration_cluster` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_orchestration_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 name [::String] - # Required. Name of the resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.new - # - # # Call the delete_orchestration_cluster method. - # result = client.delete_orchestration_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_orchestration_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_orchestration_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :delete_orchestration_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists EdgeSlms in a given project and location. - # - # @overload list_edge_slms(request, options = nil) - # Pass arguments to `list_edge_slms` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_edge_slms` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListEdgeSlmsRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.new - # - # # Call the list_edge_slms method. - # result = client.list_edge_slms 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::TelcoAutomation::V1::EdgeSlm. - # p item - # end - # - def list_edge_slms request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest - - # Converts hash 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_edge_slms.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::TelcoAutomation::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_edge_slms.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_edge_slms.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_edge_slms, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_edge_slms, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single EdgeSlm. - # - # @overload get_edge_slm(request, options = nil) - # Pass arguments to `get_edge_slm` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slm(name: nil) - # Pass arguments to `get_edge_slm` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new - # - # # Call the get_edge_slm method. - # result = client.get_edge_slm request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::EdgeSlm. - # p result - # - def get_edge_slm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest - - # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_edge_slm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :get_edge_slm, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new EdgeSlm in a given project and location. - # - # @overload create_edge_slm(request, options = nil) - # Pass arguments to `create_edge_slm` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slm(parent: nil, edge_slm_id: nil, edge_slm: nil, request_id: nil) - # Pass arguments to `create_edge_slm` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param edge_slm_id [::String] - # Required. Id of the requesting object - # If auto-generating Id server-side, remove this field and - # edge_slm_id from the method_signature of Create RPC - # @param edge_slm [::Google::Cloud::TelcoAutomation::V1::EdgeSlm, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new - # - # # Call the create_edge_slm method. - # result = client.create_edge_slm 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_edge_slm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest - - # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_edge_slm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :create_edge_slm, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single EdgeSlm. - # - # @overload delete_edge_slm(request, options = nil) - # Pass arguments to `delete_edge_slm` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slm(name: nil, request_id: nil) - # Pass arguments to `delete_edge_slm` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.new - # - # # Call the delete_edge_slm method. - # result = client.delete_edge_slm 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_edge_slm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest - - # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_edge_slm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :delete_edge_slm, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a blueprint. - # - # @overload create_blueprint(request, options = nil) - # Pass arguments to `create_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(parent: nil, blueprint_id: nil, blueprint: nil) - # Pass arguments to `create_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param blueprint_id [::String] - # Optional. The name of the blueprint. - # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] - # Required. The `Blueprint` to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new - # - # # Call the create_blueprint method. - # result = client.create_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def create_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :create_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a blueprint. - # - # @overload update_blueprint(request, options = nil) - # Pass arguments to `update_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(blueprint: nil, update_mask: nil) - # Pass arguments to `update_blueprint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] - # Required. The `blueprint` to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Update mask is used to specify the fields to be overwritten in - # the `blueprint` resource by the update. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new - # - # # Call the update_blueprint method. - # result = client.update_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def update_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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.blueprint&.name - header_params["blueprint.name"] = request.blueprint.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_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :update_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested blueprint. - # - # @overload get_blueprint(request, options = nil) - # Pass arguments to `get_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(name: nil, view: nil) - # Pass arguments to `get_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint. - # Case 1: If the name provided in the request is - # \\{blueprint_id}@\\{revision_id}, then the revision with revision_id will be - # returned. Case 2: If the name provided in the request is \\{blueprint}, then - # the current state of the blueprint is returned. - # @param view [::Google::Cloud::TelcoAutomation::V1::BlueprintView] - # Optional. Defines the type of view of the blueprint. - # When field is not present BLUEPRINT_VIEW_BASIC is considered as default. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new - # - # # Call the get_blueprint method. - # result = client.get_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def get_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :get_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a blueprint and all its revisions. - # - # @overload delete_blueprint(request, options = nil) - # Pass arguments to `delete_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(name: nil) - # Pass arguments to `delete_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint to delete. - # Blueprint name should be in the format \\{blueprint_id}, if - # \\{blueprint_id}@\\{revision_id} is passed then the API throws invalid - # argument. - # - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new - # - # # Call the delete_blueprint method. - # result = client.delete_blueprint request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :delete_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all blueprints. - # - # @overload list_blueprints(request, options = nil) - # Pass arguments to `list_blueprints` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprints(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_blueprints` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param filter [::String] - # Optional. Filtering only supports equality on blueprint state. - # It should be in the form: "state = DRAFT". `OR` operator can be used to - # get response for multiple states. e.g. "state = DRAFT OR state = PROPOSED". - # @param page_size [::Integer] - # Optional. The maximum number of blueprints to return per page. - # @param page_token [::String] - # Optional. The page token, received from a previous ListBlueprints call. - # It can be provided to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new - # - # # Call the list_blueprints method. - # result = client.list_blueprints 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::TelcoAutomation::V1::Blueprint. - # p item - # end - # - def list_blueprints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest - - # Converts hash 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_blueprints.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::TelcoAutomation::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_blueprints.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_blueprints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_blueprints, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_blueprints, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Approves a blueprint and commits a new revision. - # - # @overload approve_blueprint(request, options = nil) - # Pass arguments to `approve_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload approve_blueprint(name: nil) - # Pass arguments to `approve_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint to approve. The blueprint must be in - # Proposed state. A new revision is committed on approval. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new - # - # # Call the approve_blueprint method. - # result = client.approve_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def approve_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest - - # Converts hash 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.approve_blueprint.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::TelcoAutomation::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.approve_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.approve_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :approve_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Proposes a blueprint for approval of changes. - # - # @overload propose_blueprint(request, options = nil) - # Pass arguments to `propose_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload propose_blueprint(name: nil) - # Pass arguments to `propose_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint being proposed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new - # - # # Call the propose_blueprint method. - # result = client.propose_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def propose_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest - - # Converts hash 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.propose_blueprint.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::TelcoAutomation::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.propose_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.propose_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :propose_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rejects a blueprint revision proposal and flips it back to Draft state. - # - # @overload reject_blueprint(request, options = nil) - # Pass arguments to `reject_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reject_blueprint(name: nil) - # Pass arguments to `reject_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint being rejected. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new - # - # # Call the reject_blueprint method. - # result = client.reject_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def reject_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest - - # Converts hash 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.reject_blueprint.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::TelcoAutomation::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.reject_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reject_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :reject_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List blueprint revisions of a given blueprint. - # - # @overload list_blueprint_revisions(request, options = nil) - # Pass arguments to `list_blueprint_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint_revisions(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_blueprint_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint to list revisions for. - # @param page_size [::Integer] - # The maximum number of revisions to return per page. - # @param page_token [::String] - # The page token, received from a previous ListBlueprintRevisions call - # It can be provided to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new - # - # # Call the list_blueprint_revisions method. - # result = client.list_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. - # p item - # end - # - def list_blueprint_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest - - # Converts hash 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_blueprint_revisions.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::TelcoAutomation::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_blueprint_revisions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_blueprint_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_blueprint_revisions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_blueprint_revisions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches across blueprint revisions. - # - # @overload search_blueprint_revisions(request, options = nil) - # Pass arguments to `search_blueprint_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_blueprint_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_blueprint_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param query [::String] - # Required. Supported queries: - # 1. "" : Lists all revisions across all blueprints. - # 2. "latest=true" : Lists latest revisions across all blueprints. - # 3. "name=\\{name}" : Lists all revisions of blueprint with name - # \\{name}. - # 4. "name=\\{name} latest=true": Lists latest revision of blueprint with name - # \\{name} - # @param page_size [::Integer] - # Optional. The maximum number of blueprints revisions to return per page. - # max page size = 100, default page size = 20. - # @param page_token [::String] - # Optional. The page token, received from a previous search call. - # It can be provided to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new - # - # # Call the search_blueprint_revisions method. - # result = client.search_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. - # p item - # end - # - def search_blueprint_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest - - # Converts hash 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.search_blueprint_revisions.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::TelcoAutomation::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.search_blueprint_revisions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_blueprint_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :search_blueprint_revisions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :search_blueprint_revisions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches across deployment revisions. - # - # @overload search_deployment_revisions(request, options = nil) - # Pass arguments to `search_deployment_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_deployment_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_deployment_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param query [::String] - # Required. Supported queries: - # 1. "" : Lists all revisions across all deployments. - # 2. "latest=true" : Lists latest revisions across all - # deployments. - # 3. "name=\\{name}" : Lists all revisions of deployment with name - # \\{name}. - # 4. "name=\\{name} latest=true": Lists latest revision of deployment with name - # \\{name} - # @param page_size [::Integer] - # Optional. The maximum number of deployment revisions to return per page. - # max page size = 100, default page size = 20. - # @param page_token [::String] - # Optional. The page token, received from a previous search call. - # It can be provided to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new - # - # # Call the search_deployment_revisions method. - # result = client.search_deployment_revisions 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::TelcoAutomation::V1::Deployment. - # p item - # end - # - def search_deployment_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest - - # Converts hash 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.search_deployment_revisions.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::TelcoAutomation::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.search_deployment_revisions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_deployment_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :search_deployment_revisions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :search_deployment_revisions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Discards the changes in a blueprint and reverts the blueprint to the last - # approved blueprint revision. No changes take place if a blueprint does not - # have revisions. - # - # @overload discard_blueprint_changes(request, options = nil) - # Pass arguments to `discard_blueprint_changes` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload discard_blueprint_changes(name: nil) - # Pass arguments to `discard_blueprint_changes` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint of which changes are being discarded. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new - # - # # Call the discard_blueprint_changes method. - # result = client.discard_blueprint_changes request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse. - # p result - # - def discard_blueprint_changes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest - - # Converts hash 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.discard_blueprint_changes.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::TelcoAutomation::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.discard_blueprint_changes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.discard_blueprint_changes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :discard_blueprint_changes, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the blueprints in TNA's public catalog. Default page size = 20, - # Max Page Size = 100. - # - # @overload list_public_blueprints(request, options = nil) - # Pass arguments to `list_public_blueprints` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_blueprints(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_public_blueprints` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value of public blueprint. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}". - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.new - # - # # Call the list_public_blueprints method. - # result = client.list_public_blueprints 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::TelcoAutomation::V1::PublicBlueprint. - # p item - # end - # - def list_public_blueprints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest - - # Converts hash 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_public_blueprints.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::TelcoAutomation::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_public_blueprints.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_public_blueprints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_public_blueprints, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_public_blueprints, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested public blueprint. - # - # @overload get_public_blueprint(request, options = nil) - # Pass arguments to `get_public_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_blueprint(name: nil) - # Pass arguments to `get_public_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 public blueprint. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new - # - # # Call the get_public_blueprint method. - # result = client.get_public_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::PublicBlueprint. - # p result - # - def get_public_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest - - # Converts hash 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_public_blueprint.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::TelcoAutomation::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_public_blueprint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_public_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :get_public_blueprint, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a deployment. - # - # @overload create_deployment(request, options = nil) - # Pass arguments to `create_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(parent: nil, deployment_id: nil, deployment: nil) - # Pass arguments to `create_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param deployment_id [::String] - # Optional. The name of the deployment. - # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] - # Required. The `Deployment` to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new - # - # # Call the create_deployment method. - # result = client.create_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def create_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest - - # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :create_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a deployment. - # - # @overload update_deployment(request, options = nil) - # Pass arguments to `update_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(deployment: nil, update_mask: nil) - # Pass arguments to `update_deployment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] - # Required. The `deployment` to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Update mask is used to specify the fields to be overwritten in - # the `deployment` resource by the update. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new - # - # # Call the update_deployment method. - # result = client.update_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def update_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest - - # Converts hash 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_deployment.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::TelcoAutomation::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.deployment&.name - header_params["deployment.name"] = request.deployment.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_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :update_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested deployment. - # - # @overload get_deployment(request, options = nil) - # Pass arguments to `get_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(name: nil, view: nil) - # Pass arguments to `get_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 deployment. - # Case 1: If the name provided in the request is - # \\{deployment_id}@\\{revision_id}, then the revision with revision_id will be - # returned. - # Case 2: If the name provided in the request is \\{deployment}, then - # the current state of the deployment is returned. - # @param view [::Google::Cloud::TelcoAutomation::V1::DeploymentView] - # Optional. Defines the type of view of the deployment. - # When field is not present VIEW_BASIC is considered as default. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new - # - # # Call the get_deployment method. - # result = client.get_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def get_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest - - # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :get_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Removes the deployment by marking it as DELETING. Post which deployment and - # it's revisions gets deleted. - # - # @overload remove_deployment(request, options = nil) - # Pass arguments to `remove_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_deployment(name: nil) - # Pass arguments to `remove_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 deployment to initiate 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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new - # - # # Call the remove_deployment method. - # result = client.remove_deployment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def remove_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest - - # Converts hash 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.remove_deployment.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::TelcoAutomation::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.remove_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :remove_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all deployments. - # - # @overload list_deployments(request, options = nil) - # Pass arguments to `list_deployments` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployments(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_deployments` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param filter [::String] - # Optional. Filtering only supports equality on deployment state. - # It should be in the form: "state = DRAFT". `OR` operator can be used to - # get response for multiple states. e.g. "state = DRAFT OR state = APPLIED". - # @param page_size [::Integer] - # Optional. The maximum number of deployments to return per page. - # @param page_token [::String] - # Optional. The page token, received from a previous ListDeployments call. - # It can be provided to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new - # - # # Call the list_deployments method. - # result = client.list_deployments 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::TelcoAutomation::V1::Deployment. - # p item - # end - # - def list_deployments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest - - # Converts hash 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_deployments.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::TelcoAutomation::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_deployments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_deployments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_deployments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_deployments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List deployment revisions of a given deployment. - # - # @overload list_deployment_revisions(request, options = nil) - # Pass arguments to `list_deployment_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment_revisions(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_deployment_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 deployment to list revisions for. - # @param page_size [::Integer] - # Optional. The maximum number of revisions to return per page. - # @param page_token [::String] - # Optional. The page token, received from a previous ListDeploymentRevisions - # call Provide this to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new - # - # # Call the list_deployment_revisions method. - # result = client.list_deployment_revisions 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::TelcoAutomation::V1::Deployment. - # p item - # end - # - def list_deployment_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest - - # Converts hash 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_deployment_revisions.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::TelcoAutomation::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_deployment_revisions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_deployment_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_deployment_revisions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_deployment_revisions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Discards the changes in a deployment and reverts the deployment to the last - # approved deployment revision. No changes take place if a deployment does - # not have revisions. - # - # @overload discard_deployment_changes(request, options = nil) - # Pass arguments to `discard_deployment_changes` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload discard_deployment_changes(name: nil) - # Pass arguments to `discard_deployment_changes` via keyword arguments. Note that at - # least one keyword argument is 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 deployment of which changes are being discarded. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new - # - # # Call the discard_deployment_changes method. - # result = client.discard_deployment_changes request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse. - # p result - # - def discard_deployment_changes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest - - # Converts hash 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.discard_deployment_changes.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::TelcoAutomation::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.discard_deployment_changes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.discard_deployment_changes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :discard_deployment_changes, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Applies the deployment's YAML files to the parent orchestration cluster. - # - # @overload apply_deployment(request, options = nil) - # Pass arguments to `apply_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload apply_deployment(name: nil) - # Pass arguments to `apply_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 deployment to apply to orchestration cluster. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new - # - # # Call the apply_deployment method. - # result = client.apply_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def apply_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest - - # Converts hash 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.apply_deployment.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::TelcoAutomation::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.apply_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.apply_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :apply_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested deployment status. - # - # @overload compute_deployment_status(request, options = nil) - # Pass arguments to `compute_deployment_status` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload compute_deployment_status(name: nil) - # Pass arguments to `compute_deployment_status` via keyword arguments. Note that at - # least one keyword argument is 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 deployment without revisionID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new - # - # # Call the compute_deployment_status method. - # result = client.compute_deployment_status request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse. - # p result - # - def compute_deployment_status request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest - - # Converts hash 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.compute_deployment_status.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::TelcoAutomation::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.compute_deployment_status.timeout, - metadata: metadata, - retry_policy: @config.rpcs.compute_deployment_status.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :compute_deployment_status, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rollback the active deployment to the given past approved deployment - # revision. - # - # @overload rollback_deployment(request, options = nil) - # Pass arguments to `rollback_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload rollback_deployment(name: nil, revision_id: nil) - # Pass arguments to `rollback_deployment` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the deployment. - # @param revision_id [::String] - # Required. The revision id of deployment to roll back to. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new - # - # # Call the rollback_deployment method. - # result = client.rollback_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def rollback_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest - - # Converts hash 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.rollback_deployment.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::TelcoAutomation::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.rollback_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rollback_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :rollback_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested hydrated deployment. - # - # @overload get_hydrated_deployment(request, options = nil) - # Pass arguments to `get_hydrated_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hydrated_deployment(name: nil) - # Pass arguments to `get_hydrated_deployment` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the hydrated deployment. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new - # - # # Call the get_hydrated_deployment method. - # result = client.get_hydrated_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - # p result - # - def get_hydrated_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest - - # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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_hydrated_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_hydrated_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :get_hydrated_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all hydrated deployments present under a deployment. - # - # @overload list_hydrated_deployments(request, options = nil) - # Pass arguments to `list_hydrated_deployments` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hydrated_deployments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_hydrated_deployments` via keyword arguments. Note that at - # least one keyword argument is 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 deployment managing the hydrated deployments. - # @param page_size [::Integer] - # Optional. The maximum number of hydrated deployments to return. The service - # may return fewer than this value. If unspecified, at most 50 hydrated - # deployments will be returned. The maximum value is 1000. Values above 1000 - # will be set to 1000. - # @param page_token [::String] - # Optional. The page token, received from a previous ListHydratedDeployments - # call. Provide this to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.new - # - # # Call the list_hydrated_deployments method. - # result = client.list_hydrated_deployments 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::TelcoAutomation::V1::HydratedDeployment. - # p item - # end - # - def list_hydrated_deployments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest - - # Converts hash 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_hydrated_deployments.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::TelcoAutomation::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_hydrated_deployments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_hydrated_deployments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :list_hydrated_deployments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @telco_automation_stub, :list_hydrated_deployments, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a hydrated deployment. - # - # @overload update_hydrated_deployment(request, options = nil) - # Pass arguments to `update_hydrated_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hydrated_deployment(hydrated_deployment: nil, update_mask: nil) - # Pass arguments to `update_hydrated_deployment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param hydrated_deployment [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment, ::Hash] - # Required. The hydrated deployment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields to update. Update mask supports a special - # value `*` which fully replaces (equivalent to PUT) the resource provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new - # - # # Call the update_hydrated_deployment method. - # result = client.update_hydrated_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - # p result - # - def update_hydrated_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest - - # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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.hydrated_deployment&.name - header_params["hydrated_deployment.name"] = request.hydrated_deployment.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_hydrated_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_hydrated_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :update_hydrated_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Applies a hydrated deployment to a workload cluster. - # - # @overload apply_hydrated_deployment(request, options = nil) - # Pass arguments to `apply_hydrated_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload apply_hydrated_deployment(name: nil) - # Pass arguments to `apply_hydrated_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 hydrated deployment to apply. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new - # - # # Call the apply_hydrated_deployment method. - # result = client.apply_hydrated_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - # p result - # - def apply_hydrated_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest - - # Converts hash 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.apply_hydrated_deployment.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::TelcoAutomation::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.apply_hydrated_deployment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.apply_hydrated_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.call_rpc :apply_hydrated_deployment, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TelcoAutomation API. - # - # This class represents the configuration for TelcoAutomation, - # 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::TelcoAutomation::V1::TelcoAutomation::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_orchestration_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_orchestration_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_orchestration_clusters.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TelcoAutomation 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_orchestration_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_orchestration_clusters - ## - # RPC-specific configuration for `get_orchestration_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_orchestration_cluster - ## - # RPC-specific configuration for `create_orchestration_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_orchestration_cluster - ## - # RPC-specific configuration for `delete_orchestration_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_orchestration_cluster - ## - # RPC-specific configuration for `list_edge_slms` - # @return [::Gapic::Config::Method] - # - attr_reader :list_edge_slms - ## - # RPC-specific configuration for `get_edge_slm` - # @return [::Gapic::Config::Method] - # - attr_reader :get_edge_slm - ## - # RPC-specific configuration for `create_edge_slm` - # @return [::Gapic::Config::Method] - # - attr_reader :create_edge_slm - ## - # RPC-specific configuration for `delete_edge_slm` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_edge_slm - ## - # RPC-specific configuration for `create_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_blueprint - ## - # RPC-specific configuration for `update_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_blueprint - ## - # RPC-specific configuration for `get_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_blueprint - ## - # RPC-specific configuration for `delete_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_blueprint - ## - # RPC-specific configuration for `list_blueprints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_blueprints - ## - # RPC-specific configuration for `approve_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :approve_blueprint - ## - # RPC-specific configuration for `propose_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :propose_blueprint - ## - # RPC-specific configuration for `reject_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :reject_blueprint - ## - # RPC-specific configuration for `list_blueprint_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_blueprint_revisions - ## - # RPC-specific configuration for `search_blueprint_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :search_blueprint_revisions - ## - # RPC-specific configuration for `search_deployment_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :search_deployment_revisions - ## - # RPC-specific configuration for `discard_blueprint_changes` - # @return [::Gapic::Config::Method] - # - attr_reader :discard_blueprint_changes - ## - # RPC-specific configuration for `list_public_blueprints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_public_blueprints - ## - # RPC-specific configuration for `get_public_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_public_blueprint - ## - # RPC-specific configuration for `create_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_deployment - ## - # RPC-specific configuration for `update_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_deployment - ## - # RPC-specific configuration for `get_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_deployment - ## - # RPC-specific configuration for `remove_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_deployment - ## - # RPC-specific configuration for `list_deployments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_deployments - ## - # RPC-specific configuration for `list_deployment_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_deployment_revisions - ## - # RPC-specific configuration for `discard_deployment_changes` - # @return [::Gapic::Config::Method] - # - attr_reader :discard_deployment_changes - ## - # RPC-specific configuration for `apply_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :apply_deployment - ## - # RPC-specific configuration for `compute_deployment_status` - # @return [::Gapic::Config::Method] - # - attr_reader :compute_deployment_status - ## - # RPC-specific configuration for `rollback_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :rollback_deployment - ## - # RPC-specific configuration for `get_hydrated_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_hydrated_deployment - ## - # RPC-specific configuration for `list_hydrated_deployments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_hydrated_deployments - ## - # RPC-specific configuration for `update_hydrated_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_hydrated_deployment - ## - # RPC-specific configuration for `apply_hydrated_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :apply_hydrated_deployment - - # @private - def initialize parent_rpcs = nil - list_orchestration_clusters_config = parent_rpcs.list_orchestration_clusters if parent_rpcs.respond_to? :list_orchestration_clusters - @list_orchestration_clusters = ::Gapic::Config::Method.new list_orchestration_clusters_config - get_orchestration_cluster_config = parent_rpcs.get_orchestration_cluster if parent_rpcs.respond_to? :get_orchestration_cluster - @get_orchestration_cluster = ::Gapic::Config::Method.new get_orchestration_cluster_config - create_orchestration_cluster_config = parent_rpcs.create_orchestration_cluster if parent_rpcs.respond_to? :create_orchestration_cluster - @create_orchestration_cluster = ::Gapic::Config::Method.new create_orchestration_cluster_config - delete_orchestration_cluster_config = parent_rpcs.delete_orchestration_cluster if parent_rpcs.respond_to? :delete_orchestration_cluster - @delete_orchestration_cluster = ::Gapic::Config::Method.new delete_orchestration_cluster_config - list_edge_slms_config = parent_rpcs.list_edge_slms if parent_rpcs.respond_to? :list_edge_slms - @list_edge_slms = ::Gapic::Config::Method.new list_edge_slms_config - get_edge_slm_config = parent_rpcs.get_edge_slm if parent_rpcs.respond_to? :get_edge_slm - @get_edge_slm = ::Gapic::Config::Method.new get_edge_slm_config - create_edge_slm_config = parent_rpcs.create_edge_slm if parent_rpcs.respond_to? :create_edge_slm - @create_edge_slm = ::Gapic::Config::Method.new create_edge_slm_config - delete_edge_slm_config = parent_rpcs.delete_edge_slm if parent_rpcs.respond_to? :delete_edge_slm - @delete_edge_slm = ::Gapic::Config::Method.new delete_edge_slm_config - create_blueprint_config = parent_rpcs.create_blueprint if parent_rpcs.respond_to? :create_blueprint - @create_blueprint = ::Gapic::Config::Method.new create_blueprint_config - update_blueprint_config = parent_rpcs.update_blueprint if parent_rpcs.respond_to? :update_blueprint - @update_blueprint = ::Gapic::Config::Method.new update_blueprint_config - get_blueprint_config = parent_rpcs.get_blueprint if parent_rpcs.respond_to? :get_blueprint - @get_blueprint = ::Gapic::Config::Method.new get_blueprint_config - delete_blueprint_config = parent_rpcs.delete_blueprint if parent_rpcs.respond_to? :delete_blueprint - @delete_blueprint = ::Gapic::Config::Method.new delete_blueprint_config - list_blueprints_config = parent_rpcs.list_blueprints if parent_rpcs.respond_to? :list_blueprints - @list_blueprints = ::Gapic::Config::Method.new list_blueprints_config - approve_blueprint_config = parent_rpcs.approve_blueprint if parent_rpcs.respond_to? :approve_blueprint - @approve_blueprint = ::Gapic::Config::Method.new approve_blueprint_config - propose_blueprint_config = parent_rpcs.propose_blueprint if parent_rpcs.respond_to? :propose_blueprint - @propose_blueprint = ::Gapic::Config::Method.new propose_blueprint_config - reject_blueprint_config = parent_rpcs.reject_blueprint if parent_rpcs.respond_to? :reject_blueprint - @reject_blueprint = ::Gapic::Config::Method.new reject_blueprint_config - list_blueprint_revisions_config = parent_rpcs.list_blueprint_revisions if parent_rpcs.respond_to? :list_blueprint_revisions - @list_blueprint_revisions = ::Gapic::Config::Method.new list_blueprint_revisions_config - search_blueprint_revisions_config = parent_rpcs.search_blueprint_revisions if parent_rpcs.respond_to? :search_blueprint_revisions - @search_blueprint_revisions = ::Gapic::Config::Method.new search_blueprint_revisions_config - search_deployment_revisions_config = parent_rpcs.search_deployment_revisions if parent_rpcs.respond_to? :search_deployment_revisions - @search_deployment_revisions = ::Gapic::Config::Method.new search_deployment_revisions_config - discard_blueprint_changes_config = parent_rpcs.discard_blueprint_changes if parent_rpcs.respond_to? :discard_blueprint_changes - @discard_blueprint_changes = ::Gapic::Config::Method.new discard_blueprint_changes_config - list_public_blueprints_config = parent_rpcs.list_public_blueprints if parent_rpcs.respond_to? :list_public_blueprints - @list_public_blueprints = ::Gapic::Config::Method.new list_public_blueprints_config - get_public_blueprint_config = parent_rpcs.get_public_blueprint if parent_rpcs.respond_to? :get_public_blueprint - @get_public_blueprint = ::Gapic::Config::Method.new get_public_blueprint_config - create_deployment_config = parent_rpcs.create_deployment if parent_rpcs.respond_to? :create_deployment - @create_deployment = ::Gapic::Config::Method.new create_deployment_config - update_deployment_config = parent_rpcs.update_deployment if parent_rpcs.respond_to? :update_deployment - @update_deployment = ::Gapic::Config::Method.new update_deployment_config - get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment - @get_deployment = ::Gapic::Config::Method.new get_deployment_config - remove_deployment_config = parent_rpcs.remove_deployment if parent_rpcs.respond_to? :remove_deployment - @remove_deployment = ::Gapic::Config::Method.new remove_deployment_config - list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments - @list_deployments = ::Gapic::Config::Method.new list_deployments_config - list_deployment_revisions_config = parent_rpcs.list_deployment_revisions if parent_rpcs.respond_to? :list_deployment_revisions - @list_deployment_revisions = ::Gapic::Config::Method.new list_deployment_revisions_config - discard_deployment_changes_config = parent_rpcs.discard_deployment_changes if parent_rpcs.respond_to? :discard_deployment_changes - @discard_deployment_changes = ::Gapic::Config::Method.new discard_deployment_changes_config - apply_deployment_config = parent_rpcs.apply_deployment if parent_rpcs.respond_to? :apply_deployment - @apply_deployment = ::Gapic::Config::Method.new apply_deployment_config - compute_deployment_status_config = parent_rpcs.compute_deployment_status if parent_rpcs.respond_to? :compute_deployment_status - @compute_deployment_status = ::Gapic::Config::Method.new compute_deployment_status_config - rollback_deployment_config = parent_rpcs.rollback_deployment if parent_rpcs.respond_to? :rollback_deployment - @rollback_deployment = ::Gapic::Config::Method.new rollback_deployment_config - get_hydrated_deployment_config = parent_rpcs.get_hydrated_deployment if parent_rpcs.respond_to? :get_hydrated_deployment - @get_hydrated_deployment = ::Gapic::Config::Method.new get_hydrated_deployment_config - list_hydrated_deployments_config = parent_rpcs.list_hydrated_deployments if parent_rpcs.respond_to? :list_hydrated_deployments - @list_hydrated_deployments = ::Gapic::Config::Method.new list_hydrated_deployments_config - update_hydrated_deployment_config = parent_rpcs.update_hydrated_deployment if parent_rpcs.respond_to? :update_hydrated_deployment - @update_hydrated_deployment = ::Gapic::Config::Method.new update_hydrated_deployment_config - apply_hydrated_deployment_config = parent_rpcs.apply_hydrated_deployment if parent_rpcs.respond_to? :apply_hydrated_deployment - @apply_hydrated_deployment = ::Gapic::Config::Method.new apply_hydrated_deployment_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb deleted file mode 100644 index 95f1611e1573..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation - module V1 - module TelcoAutomation - # Credentials for the TelcoAutomation API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb deleted file mode 100644 index 050b914fa8e1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation - module V1 - module TelcoAutomation - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TelcoAutomation 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 TelcoAutomation 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::TelcoAutomation::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? - throw :response, 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::TelcoAutomation::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? - throw :response, 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::TelcoAutomation::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? - 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::TelcoAutomation::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? - 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::TelcoAutomation::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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb deleted file mode 100644 index 7a62a825c5f7..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/paths.rb +++ /dev/null @@ -1,172 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation - module V1 - module TelcoAutomation - # Path helper methods for the TelcoAutomation API. - module Paths - ## - # Create a fully-qualified Blueprint resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/blueprints/{blueprint}` - # - # @param project [String] - # @param location [String] - # @param orchestration_cluster [String] - # @param blueprint [String] - # - # @return [::String] - def blueprint_path project:, location:, orchestration_cluster:, blueprint: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "orchestration_cluster cannot contain /" if orchestration_cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/orchestrationClusters/#{orchestration_cluster}/blueprints/#{blueprint}" - end - - ## - # Create a fully-qualified Deployment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}` - # - # @param project [String] - # @param location [String] - # @param orchestration_cluster [String] - # @param deployment [String] - # - # @return [::String] - def deployment_path project:, location:, orchestration_cluster:, deployment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "orchestration_cluster cannot contain /" if orchestration_cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/orchestrationClusters/#{orchestration_cluster}/deployments/#{deployment}" - end - - ## - # Create a fully-qualified EdgeSlm resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/edgeSlms/{edge_slm}` - # - # @param project [String] - # @param location [String] - # @param edge_slm [String] - # - # @return [::String] - def edge_slm_path project:, location:, edge_slm: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/edgeSlms/#{edge_slm}" - end - - ## - # Create a fully-qualified HydratedDeployment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}/hydratedDeployments/{hydrated_deployment}` - # - # @param project [String] - # @param location [String] - # @param orchestration_cluster [String] - # @param deployment [String] - # @param hydrated_deployment [String] - # - # @return [::String] - def hydrated_deployment_path project:, location:, orchestration_cluster:, deployment:, hydrated_deployment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "orchestration_cluster cannot contain /" if orchestration_cluster.to_s.include? "/" - raise ::ArgumentError, "deployment cannot contain /" if deployment.to_s.include? "/" - - "projects/#{project}/locations/#{location}/orchestrationClusters/#{orchestration_cluster}/deployments/#{deployment}/hydratedDeployments/#{hydrated_deployment}" - 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 OrchestrationCluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}` - # - # @param project [String] - # @param location [String] - # @param orchestration_cluster [String] - # - # @return [::String] - def orchestration_cluster_path project:, location:, orchestration_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}/orchestrationClusters/#{orchestration_cluster}" - end - - ## - # Create a fully-qualified PublicBlueprint resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/publicBlueprints/{public_lueprint}` - # - # @param project [String] - # @param location [String] - # @param public_lueprint [String] - # - # @return [::String] - def public_blueprint_path project:, location:, public_lueprint: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/publicBlueprints/#{public_lueprint}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb deleted file mode 100644 index ecc60ae205c8..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/version" -require "google/cloud/telco_automation/v1/bindings_override" - -require "google/cloud/telco_automation/v1/telco_automation/credentials" -require "google/cloud/telco_automation/v1/telco_automation/paths" -require "google/cloud/telco_automation/v1/telco_automation/rest/operations" -require "google/cloud/telco_automation/v1/telco_automation/rest/client" - -module Google - module Cloud - module TelcoAutomation - module V1 - ## - # TelcoAutomation Service manages the control plane cluster a.k.a. - # Orchestration Cluster (GKE cluster with config controller) of TNA. It also - # exposes blueprint APIs which manages the lifecycle of blueprints that control - # the infrastructure setup (e.g GDCE clusters) and deployment of network - # functions. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/telco_automation/v1/telco_automation/rest" - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - module TelcoAutomation - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/telco_automation/v1/telco_automation/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb deleted file mode 100644 index 24a2151fd203..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/client.rb +++ /dev/null @@ -1,3752 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" -require "google/cloud/telco_automation/v1/telco_automation/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module TelcoAutomation - module V1 - module TelcoAutomation - module Rest - ## - # REST client for the TelcoAutomation service. - # - # TelcoAutomation Service manages the control plane cluster a.k.a. - # Orchestration Cluster (GKE cluster with config controller) of TNA. It also - # exposes blueprint APIs which manages the lifecycle of blueprints that control - # the infrastructure setup (e.g GDCE clusters) and deployment of network - # functions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :telco_automation_stub - - ## - # Configure the TelcoAutomation Client class. - # - # See {::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TelcoAutomation clients - # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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", "TelcoAutomation", "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 TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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 - @telco_automation_stub.universe_domain - end - - ## - # Create a new TelcoAutomation REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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 - - @telco_automation_stub = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @telco_automation_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @telco_automation_stub.endpoint - config.universe_domain = @telco_automation_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @telco_automation_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @telco_automation_stub.logger - end - - # Service calls - - ## - # Lists OrchestrationClusters in a given project and location. - # - # @overload list_orchestration_clusters(request, options = nil) - # Pass arguments to `list_orchestration_clusters` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_orchestration_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 parent [::String] - # Required. Parent value for ListOrchestrationClustersRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new - # - # # Call the list_orchestration_clusters method. - # result = client.list_orchestration_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::TelcoAutomation::V1::OrchestrationCluster. - # p item - # end - # - def list_orchestration_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_orchestration_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_orchestration_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_orchestration_clusters, "orchestration_clusters", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single OrchestrationCluster. - # - # @overload get_orchestration_cluster(request, options = nil) - # Pass arguments to `get_orchestration_cluster` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil) - # Pass arguments to `get_orchestration_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 name [::String] - # Required. Name of the resource - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new - # - # # Call the get_orchestration_cluster method. - # result = client.get_orchestration_cluster request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::OrchestrationCluster. - # p result - # - def get_orchestration_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_orchestration_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.get_orchestration_cluster request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new OrchestrationCluster in a given project and location. - # - # @overload create_orchestration_cluster(request, options = nil) - # Pass arguments to `create_orchestration_cluster` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_cluster(parent: nil, orchestration_cluster_id: nil, orchestration_cluster: nil, request_id: nil) - # Pass arguments to `create_orchestration_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 parent [::String] - # Required. Value for parent. - # @param orchestration_cluster_id [::String] - # Required. Id of the requesting object - # If auto-generating Id server-side, remove this field and - # orchestration_cluster_id from the method_signature of Create RPC - # @param orchestration_cluster [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new - # - # # Call the create_orchestration_cluster method. - # result = client.create_orchestration_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_orchestration_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_orchestration_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.create_orchestration_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single OrchestrationCluster. - # - # @overload delete_orchestration_cluster(request, options = nil) - # Pass arguments to `delete_orchestration_cluster` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_orchestration_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_orchestration_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 name [::String] - # Required. Name of the resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.new - # - # # Call the delete_orchestration_cluster method. - # result = client.delete_orchestration_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_orchestration_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest - - # Converts hash 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_orchestration_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::TelcoAutomation::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_orchestration_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_orchestration_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.delete_orchestration_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists EdgeSlms in a given project and location. - # - # @overload list_edge_slms(request, options = nil) - # Pass arguments to `list_edge_slms` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_edge_slms` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListEdgeSlmsRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.new - # - # # Call the list_edge_slms method. - # result = client.list_edge_slms 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::TelcoAutomation::V1::EdgeSlm. - # p item - # end - # - def list_edge_slms request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest - - # Converts hash 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_edge_slms.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::TelcoAutomation::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_edge_slms.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_edge_slms.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_edge_slms request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_edge_slms, "edge_slms", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single EdgeSlm. - # - # @overload get_edge_slm(request, options = nil) - # Pass arguments to `get_edge_slm` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slm(name: nil) - # Pass arguments to `get_edge_slm` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new - # - # # Call the get_edge_slm method. - # result = client.get_edge_slm request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::EdgeSlm. - # p result - # - def get_edge_slm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest - - # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_edge_slm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.get_edge_slm request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new EdgeSlm in a given project and location. - # - # @overload create_edge_slm(request, options = nil) - # Pass arguments to `create_edge_slm` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slm(parent: nil, edge_slm_id: nil, edge_slm: nil, request_id: nil) - # Pass arguments to `create_edge_slm` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param edge_slm_id [::String] - # Required. Id of the requesting object - # If auto-generating Id server-side, remove this field and - # edge_slm_id from the method_signature of Create RPC - # @param edge_slm [::Google::Cloud::TelcoAutomation::V1::EdgeSlm, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new - # - # # Call the create_edge_slm method. - # result = client.create_edge_slm 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_edge_slm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest - - # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_edge_slm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.create_edge_slm request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single EdgeSlm. - # - # @overload delete_edge_slm(request, options = nil) - # Pass arguments to `delete_edge_slm` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_edge_slm(name: nil, request_id: nil) - # Pass arguments to `delete_edge_slm` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.new - # - # # Call the delete_edge_slm method. - # result = client.delete_edge_slm 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_edge_slm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest - - # Converts hash 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_edge_slm.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::TelcoAutomation::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_edge_slm.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_edge_slm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.delete_edge_slm request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a blueprint. - # - # @overload create_blueprint(request, options = nil) - # Pass arguments to `create_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(parent: nil, blueprint_id: nil, blueprint: nil) - # Pass arguments to `create_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param blueprint_id [::String] - # Optional. The name of the blueprint. - # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] - # Required. The `Blueprint` to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new - # - # # Call the create_blueprint method. - # result = client.create_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def create_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.create_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a blueprint. - # - # @overload update_blueprint(request, options = nil) - # Pass arguments to `update_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(blueprint: nil, update_mask: nil) - # Pass arguments to `update_blueprint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param blueprint [::Google::Cloud::TelcoAutomation::V1::Blueprint, ::Hash] - # Required. The `blueprint` to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Update mask is used to specify the fields to be overwritten in - # the `blueprint` resource by the update. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new - # - # # Call the update_blueprint method. - # result = client.update_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def update_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.update_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested blueprint. - # - # @overload get_blueprint(request, options = nil) - # Pass arguments to `get_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(name: nil, view: nil) - # Pass arguments to `get_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint. - # Case 1: If the name provided in the request is - # \\{blueprint_id}@\\{revision_id}, then the revision with revision_id will be - # returned. Case 2: If the name provided in the request is \\{blueprint}, then - # the current state of the blueprint is returned. - # @param view [::Google::Cloud::TelcoAutomation::V1::BlueprintView] - # Optional. Defines the type of view of the blueprint. - # When field is not present BLUEPRINT_VIEW_BASIC is considered as default. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new - # - # # Call the get_blueprint method. - # result = client.get_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def get_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.get_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a blueprint and all its revisions. - # - # @overload delete_blueprint(request, options = nil) - # Pass arguments to `delete_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint(name: nil) - # Pass arguments to `delete_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint to delete. - # Blueprint name should be in the format \\{blueprint_id}, if - # \\{blueprint_id}@\\{revision_id} is passed then the API throws invalid - # argument. - # @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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new - # - # # Call the delete_blueprint method. - # result = client.delete_blueprint request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest - - # Converts hash 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_blueprint.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::TelcoAutomation::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_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.delete_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all blueprints. - # - # @overload list_blueprints(request, options = nil) - # Pass arguments to `list_blueprints` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprints(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_blueprints` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param filter [::String] - # Optional. Filtering only supports equality on blueprint state. - # It should be in the form: "state = DRAFT". `OR` operator can be used to - # get response for multiple states. e.g. "state = DRAFT OR state = PROPOSED". - # @param page_size [::Integer] - # Optional. The maximum number of blueprints to return per page. - # @param page_token [::String] - # Optional. The page token, received from a previous ListBlueprints call. - # It can be provided to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new - # - # # Call the list_blueprints method. - # result = client.list_blueprints 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::TelcoAutomation::V1::Blueprint. - # p item - # end - # - def list_blueprints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest - - # Converts hash 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_blueprints.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::TelcoAutomation::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_blueprints.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_blueprints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_blueprints request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_blueprints, "blueprints", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Approves a blueprint and commits a new revision. - # - # @overload approve_blueprint(request, options = nil) - # Pass arguments to `approve_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload approve_blueprint(name: nil) - # Pass arguments to `approve_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint to approve. The blueprint must be in - # Proposed state. A new revision is committed on approval. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new - # - # # Call the approve_blueprint method. - # result = client.approve_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def approve_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest - - # Converts hash 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.approve_blueprint.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::TelcoAutomation::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.approve_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.approve_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.approve_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Proposes a blueprint for approval of changes. - # - # @overload propose_blueprint(request, options = nil) - # Pass arguments to `propose_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload propose_blueprint(name: nil) - # Pass arguments to `propose_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint being proposed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new - # - # # Call the propose_blueprint method. - # result = client.propose_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def propose_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest - - # Converts hash 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.propose_blueprint.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::TelcoAutomation::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.propose_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.propose_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.propose_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rejects a blueprint revision proposal and flips it back to Draft state. - # - # @overload reject_blueprint(request, options = nil) - # Pass arguments to `reject_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reject_blueprint(name: nil) - # Pass arguments to `reject_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint being rejected. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new - # - # # Call the reject_blueprint method. - # result = client.reject_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - # p result - # - def reject_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest - - # Converts hash 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.reject_blueprint.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::TelcoAutomation::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.reject_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reject_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.reject_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List blueprint revisions of a given blueprint. - # - # @overload list_blueprint_revisions(request, options = nil) - # Pass arguments to `list_blueprint_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_blueprint_revisions(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_blueprint_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint to list revisions for. - # @param page_size [::Integer] - # The maximum number of revisions to return per page. - # @param page_token [::String] - # The page token, received from a previous ListBlueprintRevisions call - # It can be provided to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new - # - # # Call the list_blueprint_revisions method. - # result = client.list_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. - # p item - # end - # - def list_blueprint_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest - - # Converts hash 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_blueprint_revisions.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::TelcoAutomation::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_blueprint_revisions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_blueprint_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_blueprint_revisions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_blueprint_revisions, "blueprints", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches across blueprint revisions. - # - # @overload search_blueprint_revisions(request, options = nil) - # Pass arguments to `search_blueprint_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_blueprint_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_blueprint_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param query [::String] - # Required. Supported queries: - # 1. "" : Lists all revisions across all blueprints. - # 2. "latest=true" : Lists latest revisions across all blueprints. - # 3. "name=\\{name}" : Lists all revisions of blueprint with name - # \\{name}. - # 4. "name=\\{name} latest=true": Lists latest revision of blueprint with name - # \\{name} - # @param page_size [::Integer] - # Optional. The maximum number of blueprints revisions to return per page. - # max page size = 100, default page size = 20. - # @param page_token [::String] - # Optional. The page token, received from a previous search call. - # It can be provided to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new - # - # # Call the search_blueprint_revisions method. - # result = client.search_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. - # p item - # end - # - def search_blueprint_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest - - # Converts hash 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.search_blueprint_revisions.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::TelcoAutomation::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.search_blueprint_revisions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_blueprint_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.search_blueprint_revisions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :search_blueprint_revisions, "blueprints", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Searches across deployment revisions. - # - # @overload search_deployment_revisions(request, options = nil) - # Pass arguments to `search_deployment_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_deployment_revisions(parent: nil, query: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_deployment_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param query [::String] - # Required. Supported queries: - # 1. "" : Lists all revisions across all deployments. - # 2. "latest=true" : Lists latest revisions across all - # deployments. - # 3. "name=\\{name}" : Lists all revisions of deployment with name - # \\{name}. - # 4. "name=\\{name} latest=true": Lists latest revision of deployment with name - # \\{name} - # @param page_size [::Integer] - # Optional. The maximum number of deployment revisions to return per page. - # max page size = 100, default page size = 20. - # @param page_token [::String] - # Optional. The page token, received from a previous search call. - # It can be provided to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new - # - # # Call the search_deployment_revisions method. - # result = client.search_deployment_revisions 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::TelcoAutomation::V1::Deployment. - # p item - # end - # - def search_deployment_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest - - # Converts hash 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.search_deployment_revisions.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::TelcoAutomation::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.search_deployment_revisions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_deployment_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.search_deployment_revisions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :search_deployment_revisions, "deployments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Discards the changes in a blueprint and reverts the blueprint to the last - # approved blueprint revision. No changes take place if a blueprint does not - # have revisions. - # - # @overload discard_blueprint_changes(request, options = nil) - # Pass arguments to `discard_blueprint_changes` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload discard_blueprint_changes(name: nil) - # Pass arguments to `discard_blueprint_changes` via keyword arguments. Note that at - # least one keyword argument is 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 blueprint of which changes are being discarded. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new - # - # # Call the discard_blueprint_changes method. - # result = client.discard_blueprint_changes request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse. - # p result - # - def discard_blueprint_changes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest - - # Converts hash 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.discard_blueprint_changes.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::TelcoAutomation::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.discard_blueprint_changes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.discard_blueprint_changes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.discard_blueprint_changes request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists the blueprints in TNA's public catalog. Default page size = 20, - # Max Page Size = 100. - # - # @overload list_public_blueprints(request, options = nil) - # Pass arguments to `list_public_blueprints` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_blueprints(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_public_blueprints` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value of public blueprint. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}". - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.new - # - # # Call the list_public_blueprints method. - # result = client.list_public_blueprints 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::TelcoAutomation::V1::PublicBlueprint. - # p item - # end - # - def list_public_blueprints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest - - # Converts hash 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_public_blueprints.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::TelcoAutomation::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_public_blueprints.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_public_blueprints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_public_blueprints request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_public_blueprints, "public_blueprints", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested public blueprint. - # - # @overload get_public_blueprint(request, options = nil) - # Pass arguments to `get_public_blueprint` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_blueprint(name: nil) - # Pass arguments to `get_public_blueprint` via keyword arguments. Note that at - # least one keyword argument is 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 public blueprint. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new - # - # # Call the get_public_blueprint method. - # result = client.get_public_blueprint request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::PublicBlueprint. - # p result - # - def get_public_blueprint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest - - # Converts hash 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_public_blueprint.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::TelcoAutomation::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_public_blueprint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_public_blueprint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.get_public_blueprint request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a deployment. - # - # @overload create_deployment(request, options = nil) - # Pass arguments to `create_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(parent: nil, deployment_id: nil, deployment: nil) - # Pass arguments to `create_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param deployment_id [::String] - # Optional. The name of the deployment. - # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] - # Required. The `Deployment` to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new - # - # # Call the create_deployment method. - # result = client.create_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def create_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest - - # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.create_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a deployment. - # - # @overload update_deployment(request, options = nil) - # Pass arguments to `update_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(deployment: nil, update_mask: nil) - # Pass arguments to `update_deployment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param deployment [::Google::Cloud::TelcoAutomation::V1::Deployment, ::Hash] - # Required. The `deployment` to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Update mask is used to specify the fields to be overwritten in - # the `deployment` resource by the update. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new - # - # # Call the update_deployment method. - # result = client.update_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def update_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest - - # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.update_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested deployment. - # - # @overload get_deployment(request, options = nil) - # Pass arguments to `get_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment(name: nil, view: nil) - # Pass arguments to `get_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 deployment. - # Case 1: If the name provided in the request is - # \\{deployment_id}@\\{revision_id}, then the revision with revision_id will be - # returned. - # Case 2: If the name provided in the request is \\{deployment}, then - # the current state of the deployment is returned. - # @param view [::Google::Cloud::TelcoAutomation::V1::DeploymentView] - # Optional. Defines the type of view of the deployment. - # When field is not present VIEW_BASIC is considered as default. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new - # - # # Call the get_deployment method. - # result = client.get_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def get_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest - - # Converts hash 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_deployment.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::TelcoAutomation::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_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.get_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Removes the deployment by marking it as DELETING. Post which deployment and - # it's revisions gets deleted. - # - # @overload remove_deployment(request, options = nil) - # Pass arguments to `remove_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_deployment(name: nil) - # Pass arguments to `remove_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 deployment to initiate 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/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new - # - # # Call the remove_deployment method. - # result = client.remove_deployment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def remove_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest - - # Converts hash 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.remove_deployment.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::TelcoAutomation::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.remove_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.remove_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all deployments. - # - # @overload list_deployments(request, options = nil) - # Pass arguments to `list_deployments` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployments(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_deployments` via keyword arguments. Note that at - # least one keyword argument is 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 name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @param filter [::String] - # Optional. Filtering only supports equality on deployment state. - # It should be in the form: "state = DRAFT". `OR` operator can be used to - # get response for multiple states. e.g. "state = DRAFT OR state = APPLIED". - # @param page_size [::Integer] - # Optional. The maximum number of deployments to return per page. - # @param page_token [::String] - # Optional. The page token, received from a previous ListDeployments call. - # It can be provided to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new - # - # # Call the list_deployments method. - # result = client.list_deployments 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::TelcoAutomation::V1::Deployment. - # p item - # end - # - def list_deployments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest - - # Converts hash 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_deployments.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::TelcoAutomation::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_deployments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_deployments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_deployments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_deployments, "deployments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List deployment revisions of a given deployment. - # - # @overload list_deployment_revisions(request, options = nil) - # Pass arguments to `list_deployment_revisions` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_deployment_revisions(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_deployment_revisions` via keyword arguments. Note that at - # least one keyword argument is 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 deployment to list revisions for. - # @param page_size [::Integer] - # Optional. The maximum number of revisions to return per page. - # @param page_token [::String] - # Optional. The page token, received from a previous ListDeploymentRevisions - # call Provide this to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new - # - # # Call the list_deployment_revisions method. - # result = client.list_deployment_revisions 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::TelcoAutomation::V1::Deployment. - # p item - # end - # - def list_deployment_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest - - # Converts hash 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_deployment_revisions.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::TelcoAutomation::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_deployment_revisions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_deployment_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_deployment_revisions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_deployment_revisions, "deployments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Discards the changes in a deployment and reverts the deployment to the last - # approved deployment revision. No changes take place if a deployment does - # not have revisions. - # - # @overload discard_deployment_changes(request, options = nil) - # Pass arguments to `discard_deployment_changes` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload discard_deployment_changes(name: nil) - # Pass arguments to `discard_deployment_changes` via keyword arguments. Note that at - # least one keyword argument is 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 deployment of which changes are being discarded. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new - # - # # Call the discard_deployment_changes method. - # result = client.discard_deployment_changes request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse. - # p result - # - def discard_deployment_changes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest - - # Converts hash 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.discard_deployment_changes.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::TelcoAutomation::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.discard_deployment_changes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.discard_deployment_changes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.discard_deployment_changes request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Applies the deployment's YAML files to the parent orchestration cluster. - # - # @overload apply_deployment(request, options = nil) - # Pass arguments to `apply_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload apply_deployment(name: nil) - # Pass arguments to `apply_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 deployment to apply to orchestration cluster. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new - # - # # Call the apply_deployment method. - # result = client.apply_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def apply_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest - - # Converts hash 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.apply_deployment.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::TelcoAutomation::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.apply_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.apply_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.apply_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested deployment status. - # - # @overload compute_deployment_status(request, options = nil) - # Pass arguments to `compute_deployment_status` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload compute_deployment_status(name: nil) - # Pass arguments to `compute_deployment_status` via keyword arguments. Note that at - # least one keyword argument is 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 deployment without revisionID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new - # - # # Call the compute_deployment_status method. - # result = client.compute_deployment_status request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse. - # p result - # - def compute_deployment_status request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest - - # Converts hash 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.compute_deployment_status.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::TelcoAutomation::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.compute_deployment_status.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.compute_deployment_status.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.compute_deployment_status request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Rollback the active deployment to the given past approved deployment - # revision. - # - # @overload rollback_deployment(request, options = nil) - # Pass arguments to `rollback_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload rollback_deployment(name: nil, revision_id: nil) - # Pass arguments to `rollback_deployment` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the deployment. - # @param revision_id [::String] - # Required. The revision id of deployment to roll back to. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new - # - # # Call the rollback_deployment method. - # result = client.rollback_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - # p result - # - def rollback_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest - - # Converts hash 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.rollback_deployment.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::TelcoAutomation::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.rollback_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.rollback_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.rollback_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the requested hydrated deployment. - # - # @overload get_hydrated_deployment(request, options = nil) - # Pass arguments to `get_hydrated_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hydrated_deployment(name: nil) - # Pass arguments to `get_hydrated_deployment` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the hydrated deployment. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new - # - # # Call the get_hydrated_deployment method. - # result = client.get_hydrated_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - # p result - # - def get_hydrated_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest - - # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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_hydrated_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_hydrated_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.get_hydrated_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all hydrated deployments present under a deployment. - # - # @overload list_hydrated_deployments(request, options = nil) - # Pass arguments to `list_hydrated_deployments` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hydrated_deployments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_hydrated_deployments` via keyword arguments. Note that at - # least one keyword argument is 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 deployment managing the hydrated deployments. - # @param page_size [::Integer] - # Optional. The maximum number of hydrated deployments to return. The service - # may return fewer than this value. If unspecified, at most 50 hydrated - # deployments will be returned. The maximum value is 1000. Values above 1000 - # will be set to 1000. - # @param page_token [::String] - # Optional. The page token, received from a previous ListHydratedDeployments - # call. Provide this to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.new - # - # # Call the list_hydrated_deployments method. - # result = client.list_hydrated_deployments 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::TelcoAutomation::V1::HydratedDeployment. - # p item - # end - # - def list_hydrated_deployments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest - - # Converts hash 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_hydrated_deployments.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::TelcoAutomation::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_hydrated_deployments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_hydrated_deployments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.list_hydrated_deployments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @telco_automation_stub, :list_hydrated_deployments, "hydrated_deployments", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a hydrated deployment. - # - # @overload update_hydrated_deployment(request, options = nil) - # Pass arguments to `update_hydrated_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hydrated_deployment(hydrated_deployment: nil, update_mask: nil) - # Pass arguments to `update_hydrated_deployment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param hydrated_deployment [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment, ::Hash] - # Required. The hydrated deployment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields to update. Update mask supports a special - # value `*` which fully replaces (equivalent to PUT) the resource provided. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new - # - # # Call the update_hydrated_deployment method. - # result = client.update_hydrated_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - # p result - # - def update_hydrated_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest - - # Converts hash 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_hydrated_deployment.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::TelcoAutomation::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_hydrated_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_hydrated_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.update_hydrated_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Applies a hydrated deployment to a workload cluster. - # - # @overload apply_hydrated_deployment(request, options = nil) - # Pass arguments to `apply_hydrated_deployment` via a request object, either of type - # {::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload apply_hydrated_deployment(name: nil) - # Pass arguments to `apply_hydrated_deployment` via keyword arguments. Note that at - # least one keyword argument is 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 hydrated deployment to apply. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/telco_automation/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new - # - # # Call the apply_hydrated_deployment method. - # result = client.apply_hydrated_deployment request - # - # # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - # p result - # - def apply_hydrated_deployment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest - - # Converts hash 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.apply_hydrated_deployment.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::TelcoAutomation::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.apply_hydrated_deployment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.apply_hydrated_deployment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @telco_automation_stub.apply_hydrated_deployment request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TelcoAutomation REST API. - # - # This class represents the configuration for TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::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_orchestration_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_orchestration_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_orchestration_clusters.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TelcoAutomation 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_orchestration_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_orchestration_clusters - ## - # RPC-specific configuration for `get_orchestration_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_orchestration_cluster - ## - # RPC-specific configuration for `create_orchestration_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_orchestration_cluster - ## - # RPC-specific configuration for `delete_orchestration_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_orchestration_cluster - ## - # RPC-specific configuration for `list_edge_slms` - # @return [::Gapic::Config::Method] - # - attr_reader :list_edge_slms - ## - # RPC-specific configuration for `get_edge_slm` - # @return [::Gapic::Config::Method] - # - attr_reader :get_edge_slm - ## - # RPC-specific configuration for `create_edge_slm` - # @return [::Gapic::Config::Method] - # - attr_reader :create_edge_slm - ## - # RPC-specific configuration for `delete_edge_slm` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_edge_slm - ## - # RPC-specific configuration for `create_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_blueprint - ## - # RPC-specific configuration for `update_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_blueprint - ## - # RPC-specific configuration for `get_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_blueprint - ## - # RPC-specific configuration for `delete_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_blueprint - ## - # RPC-specific configuration for `list_blueprints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_blueprints - ## - # RPC-specific configuration for `approve_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :approve_blueprint - ## - # RPC-specific configuration for `propose_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :propose_blueprint - ## - # RPC-specific configuration for `reject_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :reject_blueprint - ## - # RPC-specific configuration for `list_blueprint_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_blueprint_revisions - ## - # RPC-specific configuration for `search_blueprint_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :search_blueprint_revisions - ## - # RPC-specific configuration for `search_deployment_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :search_deployment_revisions - ## - # RPC-specific configuration for `discard_blueprint_changes` - # @return [::Gapic::Config::Method] - # - attr_reader :discard_blueprint_changes - ## - # RPC-specific configuration for `list_public_blueprints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_public_blueprints - ## - # RPC-specific configuration for `get_public_blueprint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_public_blueprint - ## - # RPC-specific configuration for `create_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_deployment - ## - # RPC-specific configuration for `update_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_deployment - ## - # RPC-specific configuration for `get_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_deployment - ## - # RPC-specific configuration for `remove_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_deployment - ## - # RPC-specific configuration for `list_deployments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_deployments - ## - # RPC-specific configuration for `list_deployment_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_deployment_revisions - ## - # RPC-specific configuration for `discard_deployment_changes` - # @return [::Gapic::Config::Method] - # - attr_reader :discard_deployment_changes - ## - # RPC-specific configuration for `apply_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :apply_deployment - ## - # RPC-specific configuration for `compute_deployment_status` - # @return [::Gapic::Config::Method] - # - attr_reader :compute_deployment_status - ## - # RPC-specific configuration for `rollback_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :rollback_deployment - ## - # RPC-specific configuration for `get_hydrated_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_hydrated_deployment - ## - # RPC-specific configuration for `list_hydrated_deployments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_hydrated_deployments - ## - # RPC-specific configuration for `update_hydrated_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_hydrated_deployment - ## - # RPC-specific configuration for `apply_hydrated_deployment` - # @return [::Gapic::Config::Method] - # - attr_reader :apply_hydrated_deployment - - # @private - def initialize parent_rpcs = nil - list_orchestration_clusters_config = parent_rpcs.list_orchestration_clusters if parent_rpcs.respond_to? :list_orchestration_clusters - @list_orchestration_clusters = ::Gapic::Config::Method.new list_orchestration_clusters_config - get_orchestration_cluster_config = parent_rpcs.get_orchestration_cluster if parent_rpcs.respond_to? :get_orchestration_cluster - @get_orchestration_cluster = ::Gapic::Config::Method.new get_orchestration_cluster_config - create_orchestration_cluster_config = parent_rpcs.create_orchestration_cluster if parent_rpcs.respond_to? :create_orchestration_cluster - @create_orchestration_cluster = ::Gapic::Config::Method.new create_orchestration_cluster_config - delete_orchestration_cluster_config = parent_rpcs.delete_orchestration_cluster if parent_rpcs.respond_to? :delete_orchestration_cluster - @delete_orchestration_cluster = ::Gapic::Config::Method.new delete_orchestration_cluster_config - list_edge_slms_config = parent_rpcs.list_edge_slms if parent_rpcs.respond_to? :list_edge_slms - @list_edge_slms = ::Gapic::Config::Method.new list_edge_slms_config - get_edge_slm_config = parent_rpcs.get_edge_slm if parent_rpcs.respond_to? :get_edge_slm - @get_edge_slm = ::Gapic::Config::Method.new get_edge_slm_config - create_edge_slm_config = parent_rpcs.create_edge_slm if parent_rpcs.respond_to? :create_edge_slm - @create_edge_slm = ::Gapic::Config::Method.new create_edge_slm_config - delete_edge_slm_config = parent_rpcs.delete_edge_slm if parent_rpcs.respond_to? :delete_edge_slm - @delete_edge_slm = ::Gapic::Config::Method.new delete_edge_slm_config - create_blueprint_config = parent_rpcs.create_blueprint if parent_rpcs.respond_to? :create_blueprint - @create_blueprint = ::Gapic::Config::Method.new create_blueprint_config - update_blueprint_config = parent_rpcs.update_blueprint if parent_rpcs.respond_to? :update_blueprint - @update_blueprint = ::Gapic::Config::Method.new update_blueprint_config - get_blueprint_config = parent_rpcs.get_blueprint if parent_rpcs.respond_to? :get_blueprint - @get_blueprint = ::Gapic::Config::Method.new get_blueprint_config - delete_blueprint_config = parent_rpcs.delete_blueprint if parent_rpcs.respond_to? :delete_blueprint - @delete_blueprint = ::Gapic::Config::Method.new delete_blueprint_config - list_blueprints_config = parent_rpcs.list_blueprints if parent_rpcs.respond_to? :list_blueprints - @list_blueprints = ::Gapic::Config::Method.new list_blueprints_config - approve_blueprint_config = parent_rpcs.approve_blueprint if parent_rpcs.respond_to? :approve_blueprint - @approve_blueprint = ::Gapic::Config::Method.new approve_blueprint_config - propose_blueprint_config = parent_rpcs.propose_blueprint if parent_rpcs.respond_to? :propose_blueprint - @propose_blueprint = ::Gapic::Config::Method.new propose_blueprint_config - reject_blueprint_config = parent_rpcs.reject_blueprint if parent_rpcs.respond_to? :reject_blueprint - @reject_blueprint = ::Gapic::Config::Method.new reject_blueprint_config - list_blueprint_revisions_config = parent_rpcs.list_blueprint_revisions if parent_rpcs.respond_to? :list_blueprint_revisions - @list_blueprint_revisions = ::Gapic::Config::Method.new list_blueprint_revisions_config - search_blueprint_revisions_config = parent_rpcs.search_blueprint_revisions if parent_rpcs.respond_to? :search_blueprint_revisions - @search_blueprint_revisions = ::Gapic::Config::Method.new search_blueprint_revisions_config - search_deployment_revisions_config = parent_rpcs.search_deployment_revisions if parent_rpcs.respond_to? :search_deployment_revisions - @search_deployment_revisions = ::Gapic::Config::Method.new search_deployment_revisions_config - discard_blueprint_changes_config = parent_rpcs.discard_blueprint_changes if parent_rpcs.respond_to? :discard_blueprint_changes - @discard_blueprint_changes = ::Gapic::Config::Method.new discard_blueprint_changes_config - list_public_blueprints_config = parent_rpcs.list_public_blueprints if parent_rpcs.respond_to? :list_public_blueprints - @list_public_blueprints = ::Gapic::Config::Method.new list_public_blueprints_config - get_public_blueprint_config = parent_rpcs.get_public_blueprint if parent_rpcs.respond_to? :get_public_blueprint - @get_public_blueprint = ::Gapic::Config::Method.new get_public_blueprint_config - create_deployment_config = parent_rpcs.create_deployment if parent_rpcs.respond_to? :create_deployment - @create_deployment = ::Gapic::Config::Method.new create_deployment_config - update_deployment_config = parent_rpcs.update_deployment if parent_rpcs.respond_to? :update_deployment - @update_deployment = ::Gapic::Config::Method.new update_deployment_config - get_deployment_config = parent_rpcs.get_deployment if parent_rpcs.respond_to? :get_deployment - @get_deployment = ::Gapic::Config::Method.new get_deployment_config - remove_deployment_config = parent_rpcs.remove_deployment if parent_rpcs.respond_to? :remove_deployment - @remove_deployment = ::Gapic::Config::Method.new remove_deployment_config - list_deployments_config = parent_rpcs.list_deployments if parent_rpcs.respond_to? :list_deployments - @list_deployments = ::Gapic::Config::Method.new list_deployments_config - list_deployment_revisions_config = parent_rpcs.list_deployment_revisions if parent_rpcs.respond_to? :list_deployment_revisions - @list_deployment_revisions = ::Gapic::Config::Method.new list_deployment_revisions_config - discard_deployment_changes_config = parent_rpcs.discard_deployment_changes if parent_rpcs.respond_to? :discard_deployment_changes - @discard_deployment_changes = ::Gapic::Config::Method.new discard_deployment_changes_config - apply_deployment_config = parent_rpcs.apply_deployment if parent_rpcs.respond_to? :apply_deployment - @apply_deployment = ::Gapic::Config::Method.new apply_deployment_config - compute_deployment_status_config = parent_rpcs.compute_deployment_status if parent_rpcs.respond_to? :compute_deployment_status - @compute_deployment_status = ::Gapic::Config::Method.new compute_deployment_status_config - rollback_deployment_config = parent_rpcs.rollback_deployment if parent_rpcs.respond_to? :rollback_deployment - @rollback_deployment = ::Gapic::Config::Method.new rollback_deployment_config - get_hydrated_deployment_config = parent_rpcs.get_hydrated_deployment if parent_rpcs.respond_to? :get_hydrated_deployment - @get_hydrated_deployment = ::Gapic::Config::Method.new get_hydrated_deployment_config - list_hydrated_deployments_config = parent_rpcs.list_hydrated_deployments if parent_rpcs.respond_to? :list_hydrated_deployments - @list_hydrated_deployments = ::Gapic::Config::Method.new list_hydrated_deployments_config - update_hydrated_deployment_config = parent_rpcs.update_hydrated_deployment if parent_rpcs.respond_to? :update_hydrated_deployment - @update_hydrated_deployment = ::Gapic::Config::Method.new update_hydrated_deployment_config - apply_hydrated_deployment_config = parent_rpcs.apply_hydrated_deployment if parent_rpcs.respond_to? :apply_hydrated_deployment - @apply_hydrated_deployment = ::Gapic::Config::Method.new apply_hydrated_deployment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb deleted file mode 100644 index 6d9d6798af44..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/operations.rb +++ /dev/null @@ -1,925 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation - module V1 - module TelcoAutomation - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "telcoautomation.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TelcoAutomation 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 TelcoAutomation 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @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::TelcoAutomation::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? - throw :response, 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::TelcoAutomation::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? - throw :response, 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::TelcoAutomation::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? - 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::TelcoAutomation::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? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "telcoautomation.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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/[^/]+/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/[^/]+/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/[^/]+/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", - body: "*", - 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-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb deleted file mode 100644 index a3585b11399f..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/telco_automation/rest/service_stub.rb +++ /dev/null @@ -1,2293 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" - -module Google - module Cloud - module TelcoAutomation - module V1 - module TelcoAutomation - module Rest - ## - # REST service stub for the TelcoAutomation service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_orchestration_clusters REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest] - # 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::TelcoAutomation::V1::ListOrchestrationClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse] - # A result object deserialized from the server's reply - def list_orchestration_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_orchestration_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, - method_name: "list_orchestration_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_orchestration_cluster REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest] - # 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::TelcoAutomation::V1::OrchestrationCluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] - # A result object deserialized from the server's reply - def get_orchestration_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_orchestration_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, - method_name: "get_orchestration_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_orchestration_cluster REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest] - # 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_orchestration_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_orchestration_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, - method_name: "create_orchestration_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_orchestration_cluster REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest] - # 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_orchestration_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_orchestration_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, - method_name: "delete_orchestration_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_edge_slms REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest] - # 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::TelcoAutomation::V1::ListEdgeSlmsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse] - # A result object deserialized from the server's reply - def list_edge_slms request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_edge_slms_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, - method_name: "list_edge_slms", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_edge_slm REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest] - # 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::TelcoAutomation::V1::EdgeSlm] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] - # A result object deserialized from the server's reply - def get_edge_slm request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_edge_slm_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, - method_name: "get_edge_slm", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_edge_slm REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest] - # 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_edge_slm request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_edge_slm_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, - method_name: "create_edge_slm", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_edge_slm REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest] - # 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_edge_slm request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_edge_slm_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, - method_name: "delete_edge_slm", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest] - # 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::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # A result object deserialized from the server's reply - def create_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_blueprint_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, - method_name: "create_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest] - # 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::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # A result object deserialized from the server's reply - def update_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_blueprint_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, - method_name: "update_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest] - # 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::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # A result object deserialized from the server's reply - def get_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_blueprint_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, - method_name: "get_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest] - # 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_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_blueprint_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, - method_name: "delete_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_blueprints REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest] - # 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::TelcoAutomation::V1::ListBlueprintsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse] - # A result object deserialized from the server's reply - def list_blueprints request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_blueprints_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, - method_name: "list_blueprints", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the approve_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest] - # 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::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # A result object deserialized from the server's reply - def approve_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_approve_blueprint_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, - method_name: "approve_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the propose_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest] - # 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::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # A result object deserialized from the server's reply - def propose_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_propose_blueprint_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, - method_name: "propose_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the reject_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest] - # 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::TelcoAutomation::V1::Blueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # A result object deserialized from the server's reply - def reject_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reject_blueprint_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, - method_name: "reject_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_blueprint_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest] - # 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::TelcoAutomation::V1::ListBlueprintRevisionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse] - # A result object deserialized from the server's reply - def list_blueprint_revisions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_blueprint_revisions_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, - method_name: "list_blueprint_revisions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_blueprint_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest] - # 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::TelcoAutomation::V1::SearchBlueprintRevisionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse] - # A result object deserialized from the server's reply - def search_blueprint_revisions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_blueprint_revisions_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, - method_name: "search_blueprint_revisions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_deployment_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest] - # 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::TelcoAutomation::V1::SearchDeploymentRevisionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse] - # A result object deserialized from the server's reply - def search_deployment_revisions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_deployment_revisions_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, - method_name: "search_deployment_revisions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the discard_blueprint_changes REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest] - # 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::TelcoAutomation::V1::DiscardBlueprintChangesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse] - # A result object deserialized from the server's reply - def discard_blueprint_changes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_discard_blueprint_changes_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, - method_name: "discard_blueprint_changes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_public_blueprints REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest] - # 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::TelcoAutomation::V1::ListPublicBlueprintsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse] - # A result object deserialized from the server's reply - def list_public_blueprints request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_public_blueprints_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, - method_name: "list_public_blueprints", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_public_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest] - # 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::TelcoAutomation::V1::PublicBlueprint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::PublicBlueprint] - # A result object deserialized from the server's reply - def get_public_blueprint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_public_blueprint_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, - method_name: "get_public_blueprint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest] - # 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::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # A result object deserialized from the server's reply - def create_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_deployment_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, - method_name: "create_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest] - # 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::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # A result object deserialized from the server's reply - def update_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_deployment_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, - method_name: "update_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest] - # 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::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # A result object deserialized from the server's reply - def get_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_deployment_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, - method_name: "get_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the remove_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest] - # 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 remove_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_deployment_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, - method_name: "remove_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_deployments REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest] - # 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::TelcoAutomation::V1::ListDeploymentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse] - # A result object deserialized from the server's reply - def list_deployments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_deployments_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, - method_name: "list_deployments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_deployment_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest] - # 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::TelcoAutomation::V1::ListDeploymentRevisionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse] - # A result object deserialized from the server's reply - def list_deployment_revisions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_deployment_revisions_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, - method_name: "list_deployment_revisions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the discard_deployment_changes REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest] - # 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::TelcoAutomation::V1::DiscardDeploymentChangesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse] - # A result object deserialized from the server's reply - def discard_deployment_changes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_discard_deployment_changes_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, - method_name: "discard_deployment_changes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the apply_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest] - # 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::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # A result object deserialized from the server's reply - def apply_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_apply_deployment_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, - method_name: "apply_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the compute_deployment_status REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest] - # 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::TelcoAutomation::V1::ComputeDeploymentStatusResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse] - # A result object deserialized from the server's reply - def compute_deployment_status request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_compute_deployment_status_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, - method_name: "compute_deployment_status", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the rollback_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest] - # 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::TelcoAutomation::V1::Deployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # A result object deserialized from the server's reply - def rollback_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_rollback_deployment_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, - method_name: "rollback_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::Deployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_hydrated_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest] - # 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::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # A result object deserialized from the server's reply - def get_hydrated_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_hydrated_deployment_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, - method_name: "get_hydrated_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_hydrated_deployments REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest] - # 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::TelcoAutomation::V1::ListHydratedDeploymentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse] - # A result object deserialized from the server's reply - def list_hydrated_deployments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_hydrated_deployments_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, - method_name: "list_hydrated_deployments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_hydrated_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest] - # 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::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # A result object deserialized from the server's reply - def update_hydrated_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_hydrated_deployment_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, - method_name: "update_hydrated_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the apply_hydrated_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest] - # 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::TelcoAutomation::V1::HydratedDeployment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # A result object deserialized from the server's reply - def apply_hydrated_deployment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_apply_hydrated_deployment_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, - method_name: "apply_hydrated_deployment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_orchestration_clusters REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest] - # 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_orchestration_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/orchestrationClusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_orchestration_cluster REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest] - # 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_orchestration_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_orchestration_cluster REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest] - # 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_orchestration_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/orchestrationClusters", - body: "orchestration_cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_orchestration_cluster REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest] - # 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_orchestration_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_edge_slms REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest] - # 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_edge_slms_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/edgeSlms", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_edge_slm REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest] - # 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_edge_slm_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/edgeSlms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_edge_slm REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest] - # 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_edge_slm_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/edgeSlms", - body: "edge_slm", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_edge_slm REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest] - # 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_edge_slm_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/edgeSlms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest] - # 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_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/blueprints", - body: "blueprint", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest] - # 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_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{blueprint.name}", - body: "blueprint", - matches: [ - ["blueprint.name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest] - # 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_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest] - # 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_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_blueprints REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest] - # 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_blueprints_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/blueprints", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the approve_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_approve_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:approve", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the propose_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_propose_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:propose", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reject_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reject_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:reject", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_blueprint_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest] - # 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_blueprint_revisions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:listRevisions", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_blueprint_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_blueprint_revisions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/blueprints:searchRevisions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_deployment_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_deployment_revisions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/deployments:searchRevisions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the discard_blueprint_changes REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_discard_blueprint_changes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:discard", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/blueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_public_blueprints REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest] - # 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_public_blueprints_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/publicBlueprints", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_public_blueprint REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest] - # 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_public_blueprint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/publicBlueprints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest] - # 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_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/deployments", - body: "deployment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest] - # 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_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{deployment.name}", - body: "deployment", - matches: [ - ["deployment.name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest] - # 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_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:remove", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_deployments REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest] - # 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_deployments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/deployments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_deployment_revisions REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest] - # 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_deployment_revisions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:listRevisions", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the discard_deployment_changes REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_discard_deployment_changes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:discard", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the apply_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_apply_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:apply", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the compute_deployment_status REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_compute_deployment_status_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:computeDeploymentStatus", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the rollback_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_rollback_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:rollback", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_hydrated_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest] - # 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_hydrated_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/hydratedDeployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_hydrated_deployments REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest] - # 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_hydrated_deployments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/hydratedDeployments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_hydrated_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest] - # 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_hydrated_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{hydrated_deployment.name}", - body: "hydrated_deployment", - matches: [ - ["hydrated_deployment.name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/hydratedDeployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the apply_hydrated_deployment REST call - # - # @param request_pb [::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_apply_hydrated_deployment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:apply", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/orchestrationClusters/[^/]+/deployments/[^/]+/hydratedDeployments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb deleted file mode 100644 index c881f2cf866a..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telco_automation/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb deleted file mode 100644 index cba463efc248..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_pb.rb +++ /dev/null @@ -1,131 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/telcoautomation/v1/telcoautomation.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/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/telcoautomation/v1/telcoautomation.proto\x12\x1fgoogle.cloud.telcoautomation.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb2\x05\n\x14OrchestrationCluster\x12\x0c\n\x04name\x18\x01 \x01(\t\x12L\n\x11management_config\x18\x05 \x01(\x0b\x32\x31.google.cloud.telcoautomation.v1.ManagementConfig\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x06labels\x18\x04 \x03(\x0b\x32\x41.google.cloud.telcoautomation.v1.OrchestrationCluster.LabelsEntry\x12\x18\n\x0btna_version\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12O\n\x05state\x18\x07 \x01(\x0e\x32;.google.cloud.telcoautomation.v1.OrchestrationCluster.StateB\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\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04:\x90\x01\xea\x41\x8c\x01\n3telcoautomation.googleapis.com/OrchestrationCluster\x12Uprojects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}\"\xbb\x06\n\x07\x45\x64geSlm\x12\x0c\n\x04name\x18\x01 \x01(\t\x12Z\n\x15orchestration_cluster\x18\x05 \x01(\tB;\xe0\x41\x05\xfa\x41\x35\n3telcoautomation.googleapis.com/OrchestrationCluster\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06labels\x18\x04 \x03(\x0b\x32\x34.google.cloud.telcoautomation.v1.EdgeSlm.LabelsEntryB\x03\xe0\x41\x01\x12\x18\n\x0btna_version\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x07 \x01(\x0e\x32..google.cloud.telcoautomation.v1.EdgeSlm.StateB\x03\xe0\x41\x03\x12`\n\x15workload_cluster_type\x18\x08 \x01(\x0e\x32<.google.cloud.telcoautomation.v1.EdgeSlm.WorkloadClusterTypeB\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\"R\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\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\"O\n\x13WorkloadClusterType\x12%\n!WORKLOAD_CLUSTER_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04GDCE\x10\x01\x12\x07\n\x03GKE\x10\x02:{\xea\x41x\n&telcoautomation.googleapis.com/EdgeSlm\x12;projects/{project}/locations/{location}/edgeSlms/{edge_slm}*\x08\x65\x64geSlms2\x07\x65\x64geSlm\"\xe1\x07\n\tBlueprint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1b\n\x0brevision_id\x18\x02 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12 \n\x10source_blueprint\x18\x03 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x05\x12=\n\x14revision_create_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0e\x61pproval_state\x18\x06 \x01(\x0e\x32\x38.google.cloud.telcoautomation.v1.Blueprint.ApprovalStateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrepository\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x05\x66iles\x18\t \x03(\x0b\x32%.google.cloud.telcoautomation.v1.FileB\x03\xe0\x41\x01\x12K\n\x06labels\x18\n \x03(\x0b\x32\x36.google.cloud.telcoautomation.v1.Blueprint.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0fsource_provider\x18\r \x01(\tB\x03\xe0\x41\x03\x12O\n\x10\x64\x65ployment_level\x18\x0e \x01(\x0e\x32\x30.google.cloud.telcoautomation.v1.DeploymentLevelB\x03\xe0\x41\x03\x12\x1d\n\x10rollback_support\x18\x0f \x01(\x08\x42\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\"V\n\rApprovalState\x12\x1e\n\x1a\x41PPROVAL_STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0c\n\x08PROPOSED\x10\x02\x12\x0c\n\x08\x41PPROVED\x10\x03:\xb3\x01\xea\x41\xaf\x01\n(telcoautomation.googleapis.com/Blueprint\x12lprojects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/blueprints/{blueprint}*\nblueprints2\tblueprint\"\xf4\x02\n\x0fPublicBlueprint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12J\n\x10\x64\x65ployment_level\x18\x04 \x01(\x0e\x32\x30.google.cloud.telcoautomation.v1.DeploymentLevel\x12\x17\n\x0fsource_provider\x18\x05 \x01(\t\x12\x1d\n\x10rollback_support\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03:\xa3\x01\xea\x41\x9f\x01\n.telcoautomation.googleapis.com/PublicBlueprint\x12Jprojects/{project}/locations/{location}/publicBlueprints/{public_lueprint}*\x10publicBlueprints2\x0fpublicBlueprint\"\xee\x07\n\nDeployment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1b\n\x0brevision_id\x18\x02 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12&\n\x19source_blueprint_revision\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12=\n\x14revision_create_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x05 \x01(\x0e\x32\x31.google.cloud.telcoautomation.v1.Deployment.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrepository\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x05\x66iles\x18\x08 \x03(\x0b\x32%.google.cloud.telcoautomation.v1.FileB\x03\xe0\x41\x01\x12L\n\x06labels\x18\t \x03(\x0b\x32\x37.google.cloud.telcoautomation.v1.Deployment.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0fsource_provider\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12 \n\x10workload_cluster\x18\r \x01(\tB\x06\xe0\x41\x05\xe0\x41\x01\x12O\n\x10\x64\x65ployment_level\x18\x0e \x01(\x0e\x32\x30.google.cloud.telcoautomation.v1.DeploymentLevelB\x03\xe0\x41\x03\x12\x1d\n\x10rollback_support\x18\x0f \x01(\x08\x42\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\"D\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0b\n\x07\x41PPLIED\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03:\xb8\x01\xea\x41\xb4\x01\n)telcoautomation.googleapis.com/Deployment\x12nprojects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}*\x0b\x64\x65ployments2\ndeployment\"\x86\x04\n\x12HydratedDeployment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12M\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.telcoautomation.v1.HydratedDeployment.StateB\x03\xe0\x41\x03\x12\x39\n\x05\x66iles\x18\x03 \x03(\x0b\x32%.google.cloud.telcoautomation.v1.FileB\x03\xe0\x41\x01\x12\x1d\n\x10workload_cluster\x18\x04 \x01(\tB\x03\xe0\x41\x03\"6\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44RAFT\x10\x01\x12\x0b\n\x07\x41PPLIED\x10\x02:\xfb\x01\xea\x41\xf7\x01\n1telcoautomation.googleapis.com/HydratedDeployment\x12\x98\x01projects/{project}/locations/{location}/orchestrationClusters/{orchestration_cluster}/deployments/{deployment}/hydratedDeployments/{hydrated_deployment}*\x13hydratedDeployments2\x12hydratedDeployment\"\xb8\x01\n ListOrchestrationClustersRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33telcoautomation.googleapis.com/OrchestrationCluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xa8\x01\n!ListOrchestrationClustersResponse\x12U\n\x16orchestration_clusters\x18\x01 \x03(\x0b\x32\x35.google.cloud.telcoautomation.v1.OrchestrationCluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"k\n\x1eGetOrchestrationClusterRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3telcoautomation.googleapis.com/OrchestrationCluster\"\x8b\x02\n!CreateOrchestrationClusterRequest\x12K\n\x06parent\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\x12\x33telcoautomation.googleapis.com/OrchestrationCluster\x12%\n\x18orchestration_cluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12Y\n\x15orchestration_cluster\x18\x03 \x01(\x0b\x32\x35.google.cloud.telcoautomation.v1.OrchestrationClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n!DeleteOrchestrationClusterRequest\x12I\n\x04name\x18\x01 \x01(\tB;\xe0\x41\x02\xfa\x41\x35\n3telcoautomation.googleapis.com/OrchestrationCluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x13ListEdgeSlmsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&telcoautomation.googleapis.com/EdgeSlm\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x81\x01\n\x14ListEdgeSlmsResponse\x12;\n\tedge_slms\x18\x01 \x03(\x0b\x32(.google.cloud.telcoautomation.v1.EdgeSlm\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Q\n\x11GetEdgeSlmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&telcoautomation.googleapis.com/EdgeSlm\"\xca\x01\n\x14\x43reateEdgeSlmRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&telcoautomation.googleapis.com/EdgeSlm\x12\x18\n\x0b\x65\x64ge_slm_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x08\x65\x64ge_slm\x18\x03 \x01(\x0b\x32(.google.cloud.telcoautomation.v1.EdgeSlmB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"m\n\x14\x44\x65leteEdgeSlmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&telcoautomation.googleapis.com/EdgeSlm\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb9\x01\n\x16\x43reateBlueprintRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x19\n\x0c\x62lueprint_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x42\n\tblueprint\x18\x03 \x01(\x0b\x32*.google.cloud.telcoautomation.v1.BlueprintB\x03\xe0\x41\x02\"\x92\x01\n\x16UpdateBlueprintRequest\x12\x42\n\tblueprint\x18\x01 \x01(\x0b\x32*.google.cloud.telcoautomation.v1.BlueprintB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x98\x01\n\x13GetBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\x12\x41\n\x04view\x18\x02 \x01(\x0e\x32..google.cloud.telcoautomation.v1.BlueprintViewB\x03\xe0\x41\x01\"X\n\x16\x44\x65leteBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"\x9f\x01\n\x15ListBlueprintsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x13\n\x06\x66ilter\x18\x04 \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\"q\n\x16ListBlueprintsResponse\x12>\n\nblueprints\x18\x01 \x03(\x0b\x32*.google.cloud.telcoautomation.v1.Blueprint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Y\n\x17\x41pproveBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"Y\n\x17ProposeBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"X\n\x16RejectBlueprintRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"\x86\x01\n\x1dListBlueprintRevisionsRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"y\n\x1eListBlueprintRevisionsResponse\x12>\n\nblueprints\x18\x01 \x03(\x0b\x32*.google.cloud.telcoautomation.v1.Blueprint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x1fSearchBlueprintRevisionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"{\n SearchBlueprintRevisionsResponse\x12>\n\nblueprints\x18\x01 \x03(\x0b\x32*.google.cloud.telcoautomation.v1.Blueprint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x1e\x44iscardBlueprintChangesRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(telcoautomation.googleapis.com/Blueprint\"!\n\x1f\x44iscardBlueprintChangesResponse\"\x96\x01\n\x1bListPublicBlueprintsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.telcoautomation.googleapis.com/PublicBlueprint\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\"\x89\x01\n\x1cListPublicBlueprintsResponse\x12K\n\x11public_blueprints\x18\x01 \x03(\x0b\x32\x30.google.cloud.telcoautomation.v1.PublicBlueprint\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"a\n\x19GetPublicBlueprintRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.telcoautomation.googleapis.com/PublicBlueprint\"\xbe\x01\n\x17\x43reateDeploymentRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)telcoautomation.googleapis.com/Deployment\x12\x1a\n\rdeployment_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\ndeployment\x18\x03 \x01(\x0b\x32+.google.cloud.telcoautomation.v1.DeploymentB\x03\xe0\x41\x02\"\x95\x01\n\x17UpdateDeploymentRequest\x12\x44\n\ndeployment\x18\x01 \x01(\x0b\x32+.google.cloud.telcoautomation.v1.DeploymentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x9b\x01\n\x14GetDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\x12\x42\n\x04view\x18\x02 \x01(\x0e\x32/.google.cloud.telcoautomation.v1.DeploymentViewB\x03\xe0\x41\x01\"Z\n\x17RemoveDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"\xa1\x01\n\x16ListDeploymentsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)telcoautomation.googleapis.com/Deployment\x12\x13\n\x06\x66ilter\x18\x04 \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\"t\n\x17ListDeploymentsResponse\x12@\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32+.google.cloud.telcoautomation.v1.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x92\x01\n\x1eListDeploymentRevisionsRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\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\x1fListDeploymentRevisionsResponse\x12@\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32+.google.cloud.telcoautomation.v1.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa9\x01\n SearchDeploymentRevisionsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(telcoautomation.googleapis.com/Blueprint\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"~\n!SearchDeploymentRevisionsResponse\x12@\n\x0b\x64\x65ployments\x18\x01 \x03(\x0b\x32+.google.cloud.telcoautomation.v1.Deployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"b\n\x1f\x44iscardDeploymentChangesRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"\"\n DiscardDeploymentChangesResponse\"Y\n\x16\x41pplyDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"a\n\x1e\x43omputeDeploymentStatusRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\"\xc9\x01\n\x1f\x43omputeDeploymentStatusResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12G\n\x11\x61ggregated_status\x18\x02 \x01(\x0e\x32\'.google.cloud.telcoautomation.v1.StatusB\x03\xe0\x41\x03\x12O\n\x11resource_statuses\x18\x03 \x03(\x0b\x32/.google.cloud.telcoautomation.v1.ResourceStatusB\x03\xe0\x41\x03\"v\n\x19RollbackDeploymentRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)telcoautomation.googleapis.com/Deployment\x12\x18\n\x0brevision_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"g\n\x1cGetHydratedDeploymentRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1telcoautomation.googleapis.com/HydratedDeployment\"\x9c\x01\n\x1eListHydratedDeploymentsRequest\x12I\n\x06parent\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\x12\x31telcoautomation.googleapis.com/HydratedDeployment\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\"\x8d\x01\n\x1fListHydratedDeploymentsResponse\x12Q\n\x14hydrated_deployments\x18\x01 \x03(\x0b\x32\x33.google.cloud.telcoautomation.v1.HydratedDeployment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xae\x01\n\x1fUpdateHydratedDeploymentRequest\x12U\n\x13hydrated_deployment\x18\x01 \x01(\x0b\x32\x33.google.cloud.telcoautomation.v1.HydratedDeploymentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"i\n\x1e\x41pplyHydratedDeploymentRequest\x12G\n\x04name\x18\x01 \x01(\tB9\xe0\x41\x02\xfa\x41\x33\n1telcoautomation.googleapis.com/HydratedDeployment\"\xdc\x01\n\x10ManagementConfig\x12_\n\x1astandard_management_config\x18\x01 \x01(\x0b\x32\x39.google.cloud.telcoautomation.v1.StandardManagementConfigH\x00\x12W\n\x16\x66ull_management_config\x18\x02 \x01(\x0b\x32\x35.google.cloud.telcoautomation.v1.FullManagementConfigH\x00\x42\x0e\n\x0coneof_config\"\xe3\x02\n\x18StandardManagementConfig\x12\x14\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06subnet\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16master_ipv4_cidr_block\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x63luster_cidr_block\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13services_cidr_block\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x63luster_named_range\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14services_named_range\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12o\n!master_authorized_networks_config\x18\x08 \x01(\x0b\x32?.google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfigB\x03\xe0\x41\x01\"\xdf\x02\n\x14\x46ullManagementConfig\x12\x14\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06subnet\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16master_ipv4_cidr_block\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x63luster_cidr_block\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13services_cidr_block\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13\x63luster_named_range\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14services_named_range\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12o\n!master_authorized_networks_config\x18\x08 \x01(\x0b\x32?.google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfigB\x03\xe0\x41\x01\"\xc6\x01\n\x1eMasterAuthorizedNetworksConfig\x12\x63\n\x0b\x63idr_blocks\x18\x01 \x03(\x0b\x32I.google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfig.CidrBlockB\x03\xe0\x41\x01\x1a?\n\tCidrBlock\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ncidr_block\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\\\n\x04\x46ile\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x64\x65leted\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x15\n\x08\x65\x64itable\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xc1\x02\n\x0eResourceStatus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1a\n\x12resource_namespace\x18\x02 \x01(\t\x12\r\n\x05group\x18\x03 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12\x0c\n\x04kind\x18\x05 \x01(\t\x12I\n\rresource_type\x18\x06 \x01(\x0e\x32-.google.cloud.telcoautomation.v1.ResourceTypeB\x03\xe0\x41\x03\x12<\n\x06status\x18\x07 \x01(\x0e\x32\'.google.cloud.telcoautomation.v1.StatusB\x03\xe0\x41\x03\x12N\n\x10nf_deploy_status\x18\x08 \x01(\x0b\x32/.google.cloud.telcoautomation.v1.NFDeployStatusB\x03\xe0\x41\x03\"\x8c\x01\n\x0eNFDeployStatus\x12\x19\n\x0ctargeted_nfs\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tready_nfs\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12G\n\x05sites\x18\x03 \x03(\x0b\x32\x33.google.cloud.telcoautomation.v1.NFDeploySiteStatusB\x03\xe0\x41\x03\"\xd8\x01\n\x12NFDeploySiteStatus\x12\x11\n\x04site\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10pending_deletion\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12H\n\thydration\x18\x03 \x01(\x0b\x32\x30.google.cloud.telcoautomation.v1.HydrationStatusB\x03\xe0\x41\x03\x12\x46\n\x08workload\x18\x04 \x01(\x0b\x32/.google.cloud.telcoautomation.v1.WorkloadStatusB\x03\xe0\x41\x03\"o\n\x0fHydrationStatus\x12G\n\x0csite_version\x18\x01 \x01(\x0b\x32,.google.cloud.telcoautomation.v1.SiteVersionB\x03\xe0\x41\x03\x12\x13\n\x06status\x18\x02 \x01(\tB\x03\xe0\x41\x03\"T\n\x0bSiteVersion\x12\x16\n\tnf_vendor\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07nf_type\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nnf_version\x18\x03 \x01(\tB\x03\xe0\x41\x03\"n\n\x0eWorkloadStatus\x12G\n\x0csite_version\x18\x01 \x01(\x0b\x32,.google.cloud.telcoautomation.v1.SiteVersionB\x03\xe0\x41\x03\x12\x13\n\x06status\x18\x02 \x01(\tB\x03\xe0\x41\x03*b\n\rBlueprintView\x12\x1e\n\x1a\x42LUEPRINT_VIEW_UNSPECIFIED\x10\x00\x12\x18\n\x14\x42LUEPRINT_VIEW_BASIC\x10\x01\x12\x17\n\x13\x42LUEPRINT_VIEW_FULL\x10\x02*f\n\x0e\x44\x65ploymentView\x12\x1f\n\x1b\x44\x45PLOYMENT_VIEW_UNSPECIFIED\x10\x00\x12\x19\n\x15\x44\x45PLOYMENT_VIEW_BASIC\x10\x01\x12\x18\n\x14\x44\x45PLOYMENT_VIEW_FULL\x10\x02*^\n\x0cResourceType\x12\x1d\n\x19RESOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12NF_DEPLOY_RESOURCE\x10\x01\x12\x17\n\x13\x44\x45PLOYMENT_RESOURCE\x10\x02*\xb6\x01\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x16\n\x12STATUS_IN_PROGRESS\x10\x01\x12\x11\n\rSTATUS_ACTIVE\x10\x02\x12\x11\n\rSTATUS_FAILED\x10\x03\x12\x13\n\x0fSTATUS_DELETING\x10\x04\x12\x12\n\x0eSTATUS_DELETED\x10\x05\x12\x12\n\x0eSTATUS_PEERING\x10\n\x12\x19\n\x15STATUS_NOT_APPLICABLE\x10\x0b*\x90\x01\n\x0f\x44\x65ploymentLevel\x12 \n\x1c\x44\x45PLOYMENT_LEVEL_UNSPECIFIED\x10\x00\x12\r\n\tHYDRATION\x10\x01\x12\x15\n\x11SINGLE_DEPLOYMENT\x10\x02\x12\x14\n\x10MULTI_DEPLOYMENT\x10\x03\x12\x1f\n\x1bWORKLOAD_CLUSTER_DEPLOYMENT\x10\x04\x32\xec\x43\n\x0fTelcoAutomation\x12\xee\x01\n\x19ListOrchestrationClusters\x12\x41.google.cloud.telcoautomation.v1.ListOrchestrationClustersRequest\x1a\x42.google.cloud.telcoautomation.v1.ListOrchestrationClustersResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*}/orchestrationClusters\x12\xdb\x01\n\x17GetOrchestrationCluster\x12?.google.cloud.telcoautomation.v1.GetOrchestrationClusterRequest\x1a\x35.google.cloud.telcoautomation.v1.OrchestrationCluster\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/orchestrationClusters/*}\x12\xbe\x02\n\x1a\x43reateOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.CreateOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41)\n\x14OrchestrationCluster\x12\x11OperationMetadata\xda\x41\x35parent,orchestration_cluster,orchestration_cluster_id\x82\xd3\xe4\x93\x02R\"9/v1/{parent=projects/*/locations/*}/orchestrationClusters:\x15orchestration_cluster\x12\xf6\x01\n\x1a\x44\x65leteOrchestrationCluster\x12\x42.google.cloud.telcoautomation.v1.DeleteOrchestrationClusterRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/orchestrationClusters/*}\x12\xba\x01\n\x0cListEdgeSlms\x12\x34.google.cloud.telcoautomation.v1.ListEdgeSlmsRequest\x1a\x35.google.cloud.telcoautomation.v1.ListEdgeSlmsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/edgeSlms\x12\xa7\x01\n\nGetEdgeSlm\x12\x32.google.cloud.telcoautomation.v1.GetEdgeSlmRequest\x1a(.google.cloud.telcoautomation.v1.EdgeSlm\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/edgeSlms/*}\x12\xe2\x01\n\rCreateEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.CreateEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x1c\n\x07\x45\x64geSlm\x12\x11OperationMetadata\xda\x41\x1bparent,edge_slm,edge_slm_id\x82\xd3\xe4\x93\x02\x38\",/v1/{parent=projects/*/locations/*}/edgeSlms:\x08\x65\x64ge_slm\x12\xcf\x01\n\rDeleteEdgeSlm\x12\x35.google.cloud.telcoautomation.v1.DeleteEdgeSlmRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/edgeSlms/*}\x12\xf1\x01\n\x0f\x43reateBlueprint\x12\x37.google.cloud.telcoautomation.v1.CreateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"y\xda\x41\x1dparent,blueprint,blueprint_id\x82\xd3\xe4\x93\x02S\"F/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:\tblueprint\x12\xf3\x01\n\x0fUpdateBlueprint\x12\x37.google.cloud.telcoautomation.v1.UpdateBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"{\xda\x41\x15\x62lueprint,update_mask\x82\xd3\xe4\x93\x02]2P/v1/{blueprint.name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:\tblueprint\x12\xc7\x01\n\x0cGetBlueprint\x12\x34.google.cloud.telcoautomation.v1.GetBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H\x12\x46/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\x12\xb9\x01\n\x0f\x44\x65leteBlueprint\x12\x37.google.cloud.telcoautomation.v1.DeleteBlueprintRequest\x1a\x16.google.protobuf.Empty\"U\xda\x41\x04name\x82\xd3\xe4\x93\x02H*F/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}\x12\xda\x01\n\x0eListBlueprints\x12\x36.google.cloud.telcoautomation.v1.ListBlueprintsRequest\x1a\x37.google.cloud.telcoautomation.v1.ListBlueprintsResponse\"W\xda\x41\x06parent\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints\x12\xda\x01\n\x10\x41pproveBlueprint\x12\x38.google.cloud.telcoautomation.v1.ApproveBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:approve:\x01*\x12\xda\x01\n\x10ProposeBlueprint\x12\x38.google.cloud.telcoautomation.v1.ProposeBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:propose:\x01*\x12\xd7\x01\n\x0fRejectBlueprint\x12\x37.google.cloud.telcoautomation.v1.RejectBlueprintRequest\x1a*.google.cloud.telcoautomation.v1.Blueprint\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:reject:\x01*\x12\xfe\x01\n\x16ListBlueprintRevisions\x12>.google.cloud.telcoautomation.v1.ListBlueprintRevisionsRequest\x1a?.google.cloud.telcoautomation.v1.ListBlueprintRevisionsResponse\"c\xda\x41\x04name\x82\xd3\xe4\x93\x02V\x12T/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:listRevisions\x12\x8e\x02\n\x18SearchBlueprintRevisions\x12@.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsRequest\x1a\x41.google.cloud.telcoautomation.v1.SearchBlueprintRevisionsResponse\"m\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02X\x12V/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/blueprints:searchRevisions\x12\x92\x02\n\x19SearchDeploymentRevisions\x12\x41.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsRequest\x1a\x42.google.cloud.telcoautomation.v1.SearchDeploymentRevisionsResponse\"n\xda\x41\x0cparent,query\x82\xd3\xe4\x93\x02Y\x12W/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:searchRevisions\x12\xfe\x01\n\x17\x44iscardBlueprintChanges\x12?.google.cloud.telcoautomation.v1.DiscardBlueprintChangesRequest\x1a@.google.cloud.telcoautomation.v1.DiscardBlueprintChangesResponse\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/blueprints/*}:discard:\x01*\x12\xda\x01\n\x14ListPublicBlueprints\x12<.google.cloud.telcoautomation.v1.ListPublicBlueprintsRequest\x1a=.google.cloud.telcoautomation.v1.ListPublicBlueprintsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/publicBlueprints\x12\xc7\x01\n\x12GetPublicBlueprint\x12:.google.cloud.telcoautomation.v1.GetPublicBlueprintRequest\x1a\x30.google.cloud.telcoautomation.v1.PublicBlueprint\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/publicBlueprints/*}\x12\xf8\x01\n\x10\x43reateDeployment\x12\x38.google.cloud.telcoautomation.v1.CreateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"}\xda\x41\x1fparent,deployment,deployment_id\x82\xd3\xe4\x93\x02U\"G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments:\ndeployment\x12\xfa\x01\n\x10UpdateDeployment\x12\x38.google.cloud.telcoautomation.v1.UpdateDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"\x7f\xda\x41\x16\x64\x65ployment,update_mask\x82\xd3\xe4\x93\x02`2R/v1/{deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:\ndeployment\x12\xcb\x01\n\rGetDeployment\x12\x35.google.cloud.telcoautomation.v1.GetDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"V\xda\x41\x04name\x82\xd3\xe4\x93\x02I\x12G/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}\x12\xc6\x01\n\x10RemoveDeployment\x12\x38.google.cloud.telcoautomation.v1.RemoveDeploymentRequest\x1a\x16.google.protobuf.Empty\"`\xda\x41\x04name\x82\xd3\xe4\x93\x02S\"N/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:remove:\x01*\x12\xde\x01\n\x0fListDeployments\x12\x37.google.cloud.telcoautomation.v1.ListDeploymentsRequest\x1a\x38.google.cloud.telcoautomation.v1.ListDeploymentsResponse\"X\xda\x41\x06parent\x82\xd3\xe4\x93\x02I\x12G/v1/{parent=projects/*/locations/*/orchestrationClusters/*}/deployments\x12\x82\x02\n\x17ListDeploymentRevisions\x12?.google.cloud.telcoautomation.v1.ListDeploymentRevisionsRequest\x1a@.google.cloud.telcoautomation.v1.ListDeploymentRevisionsResponse\"d\xda\x41\x04name\x82\xd3\xe4\x93\x02W\x12U/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:listRevisions\x12\x82\x02\n\x18\x44iscardDeploymentChanges\x12@.google.cloud.telcoautomation.v1.DiscardDeploymentChangesRequest\x1a\x41.google.cloud.telcoautomation.v1.DiscardDeploymentChangesResponse\"a\xda\x41\x04name\x82\xd3\xe4\x93\x02T\"O/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:discard:\x01*\x12\xd8\x01\n\x0f\x41pplyDeployment\x12\x37.google.cloud.telcoautomation.v1.ApplyDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\"M/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:apply:\x01*\x12\x8c\x02\n\x17\x43omputeDeploymentStatus\x12?.google.cloud.telcoautomation.v1.ComputeDeploymentStatusRequest\x1a@.google.cloud.telcoautomation.v1.ComputeDeploymentStatusResponse\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61\x12_/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:computeDeploymentStatus\x12\xed\x01\n\x12RollbackDeployment\x12:.google.cloud.telcoautomation.v1.RollbackDeploymentRequest\x1a+.google.cloud.telcoautomation.v1.Deployment\"n\xda\x41\x10name,revision_id\x82\xd3\xe4\x93\x02U\"P/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*}:rollback:\x01*\x12\xf9\x01\n\x15GetHydratedDeployment\x12=.google.cloud.telcoautomation.v1.GetHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"l\xda\x41\x04name\x82\xd3\xe4\x93\x02_\x12]/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}\x12\x8c\x02\n\x17ListHydratedDeployments\x12?.google.cloud.telcoautomation.v1.ListHydratedDeploymentsRequest\x1a@.google.cloud.telcoautomation.v1.ListHydratedDeploymentsResponse\"n\xda\x41\x06parent\x82\xd3\xe4\x93\x02_\x12]/v1/{parent=projects/*/locations/*/orchestrationClusters/*/deployments/*}/hydratedDeployments\x12\xc5\x02\n\x18UpdateHydratedDeployment\x12@.google.cloud.telcoautomation.v1.UpdateHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"\xb1\x01\xda\x41\x1fhydrated_deployment,update_mask\x82\xd3\xe4\x93\x02\x88\x01\x32q/v1/{hydrated_deployment.name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:\x13hydrated_deployment\x12\x86\x02\n\x17\x41pplyHydratedDeployment\x12?.google.cloud.telcoautomation.v1.ApplyHydratedDeploymentRequest\x1a\x33.google.cloud.telcoautomation.v1.HydratedDeployment\"u\xda\x41\x04name\x82\xd3\xe4\x93\x02h\"c/v1/{name=projects/*/locations/*/orchestrationClusters/*/deployments/*/hydratedDeployments/*}:apply:\x01*\x1aR\xca\x41\x1etelcoautomation.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf5\x01\n#com.google.cloud.telcoautomation.v1B\x14TelcoautomationProtoP\x01ZMcloud.google.com/go/telcoautomation/apiv1/telcoautomationpb;telcoautomationpb\xaa\x02\x1fGoogle.Cloud.TelcoAutomation.V1\xca\x02\x1fGoogle\\Cloud\\TelcoAutomation\\V1\xea\x02\"Google::Cloud::TelcoAutomation::V1b\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 TelcoAutomation - module V1 - OrchestrationCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.OrchestrationCluster").msgclass - OrchestrationCluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.OrchestrationCluster.State").enummodule - EdgeSlm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.EdgeSlm").msgclass - EdgeSlm::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.EdgeSlm.State").enummodule - EdgeSlm::WorkloadClusterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.EdgeSlm.WorkloadClusterType").enummodule - Blueprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Blueprint").msgclass - Blueprint::ApprovalState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Blueprint.ApprovalState").enummodule - PublicBlueprint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.PublicBlueprint").msgclass - Deployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Deployment").msgclass - Deployment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Deployment.State").enummodule - HydratedDeployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.HydratedDeployment").msgclass - HydratedDeployment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.HydratedDeployment.State").enummodule - ListOrchestrationClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListOrchestrationClustersRequest").msgclass - ListOrchestrationClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListOrchestrationClustersResponse").msgclass - GetOrchestrationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetOrchestrationClusterRequest").msgclass - CreateOrchestrationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateOrchestrationClusterRequest").msgclass - DeleteOrchestrationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeleteOrchestrationClusterRequest").msgclass - ListEdgeSlmsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListEdgeSlmsRequest").msgclass - ListEdgeSlmsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListEdgeSlmsResponse").msgclass - GetEdgeSlmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetEdgeSlmRequest").msgclass - CreateEdgeSlmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateEdgeSlmRequest").msgclass - DeleteEdgeSlmRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeleteEdgeSlmRequest").msgclass - CreateBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateBlueprintRequest").msgclass - UpdateBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.UpdateBlueprintRequest").msgclass - GetBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetBlueprintRequest").msgclass - DeleteBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeleteBlueprintRequest").msgclass - ListBlueprintsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintsRequest").msgclass - ListBlueprintsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintsResponse").msgclass - ApproveBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ApproveBlueprintRequest").msgclass - ProposeBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ProposeBlueprintRequest").msgclass - RejectBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.RejectBlueprintRequest").msgclass - ListBlueprintRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintRevisionsRequest").msgclass - ListBlueprintRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListBlueprintRevisionsResponse").msgclass - SearchBlueprintRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchBlueprintRevisionsRequest").msgclass - SearchBlueprintRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchBlueprintRevisionsResponse").msgclass - DiscardBlueprintChangesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardBlueprintChangesRequest").msgclass - DiscardBlueprintChangesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardBlueprintChangesResponse").msgclass - ListPublicBlueprintsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListPublicBlueprintsRequest").msgclass - ListPublicBlueprintsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListPublicBlueprintsResponse").msgclass - GetPublicBlueprintRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetPublicBlueprintRequest").msgclass - CreateDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.CreateDeploymentRequest").msgclass - UpdateDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.UpdateDeploymentRequest").msgclass - GetDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetDeploymentRequest").msgclass - RemoveDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.RemoveDeploymentRequest").msgclass - ListDeploymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentsRequest").msgclass - ListDeploymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentsResponse").msgclass - ListDeploymentRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentRevisionsRequest").msgclass - ListDeploymentRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListDeploymentRevisionsResponse").msgclass - SearchDeploymentRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchDeploymentRevisionsRequest").msgclass - SearchDeploymentRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SearchDeploymentRevisionsResponse").msgclass - DiscardDeploymentChangesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardDeploymentChangesRequest").msgclass - DiscardDeploymentChangesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DiscardDeploymentChangesResponse").msgclass - ApplyDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ApplyDeploymentRequest").msgclass - ComputeDeploymentStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ComputeDeploymentStatusRequest").msgclass - ComputeDeploymentStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ComputeDeploymentStatusResponse").msgclass - RollbackDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.RollbackDeploymentRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.OperationMetadata").msgclass - GetHydratedDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.GetHydratedDeploymentRequest").msgclass - ListHydratedDeploymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListHydratedDeploymentsRequest").msgclass - ListHydratedDeploymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ListHydratedDeploymentsResponse").msgclass - UpdateHydratedDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.UpdateHydratedDeploymentRequest").msgclass - ApplyHydratedDeploymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ApplyHydratedDeploymentRequest").msgclass - ManagementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ManagementConfig").msgclass - StandardManagementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.StandardManagementConfig").msgclass - FullManagementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.FullManagementConfig").msgclass - MasterAuthorizedNetworksConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfig").msgclass - MasterAuthorizedNetworksConfig::CidrBlock = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.MasterAuthorizedNetworksConfig.CidrBlock").msgclass - File = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.File").msgclass - ResourceStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ResourceStatus").msgclass - NFDeployStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.NFDeployStatus").msgclass - NFDeploySiteStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.NFDeploySiteStatus").msgclass - HydrationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.HydrationStatus").msgclass - SiteVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.SiteVersion").msgclass - WorkloadStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.WorkloadStatus").msgclass - BlueprintView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.BlueprintView").enummodule - DeploymentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeploymentView").enummodule - ResourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.ResourceType").enummodule - Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.Status").enummodule - DeploymentLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.telcoautomation.v1.DeploymentLevel").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb b/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb deleted file mode 100644 index bc4578b621de..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/lib/google/cloud/telcoautomation/v1/telcoautomation_services_pb.rb +++ /dev/null @@ -1,126 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/telcoautomation/v1/telcoautomation.proto for package 'Google.Cloud.TelcoAutomation.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/telcoautomation/v1/telcoautomation_pb' - -module Google - module Cloud - module TelcoAutomation - module V1 - module TelcoAutomation - # TelcoAutomation Service manages the control plane cluster a.k.a. - # Orchestration Cluster (GKE cluster with config controller) of TNA. It also - # exposes blueprint APIs which manages the lifecycle of blueprints that control - # the infrastructure setup (e.g GDCE clusters) and deployment of network - # functions. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.telcoautomation.v1.TelcoAutomation' - - # Lists OrchestrationClusters in a given project and location. - rpc :ListOrchestrationClusters, ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse - # Gets details of a single OrchestrationCluster. - rpc :GetOrchestrationCluster, ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster - # Creates a new OrchestrationCluster in a given project and location. - rpc :CreateOrchestrationCluster, ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, ::Google::Longrunning::Operation - # Deletes a single OrchestrationCluster. - rpc :DeleteOrchestrationCluster, ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, ::Google::Longrunning::Operation - # Lists EdgeSlms in a given project and location. - rpc :ListEdgeSlms, ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse - # Gets details of a single EdgeSlm. - rpc :GetEdgeSlm, ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, ::Google::Cloud::TelcoAutomation::V1::EdgeSlm - # Creates a new EdgeSlm in a given project and location. - rpc :CreateEdgeSlm, ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, ::Google::Longrunning::Operation - # Deletes a single EdgeSlm. - rpc :DeleteEdgeSlm, ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, ::Google::Longrunning::Operation - # Creates a blueprint. - rpc :CreateBlueprint, ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint - # Updates a blueprint. - rpc :UpdateBlueprint, ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint - # Returns the requested blueprint. - rpc :GetBlueprint, ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint - # Deletes a blueprint and all its revisions. - rpc :DeleteBlueprint, ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, ::Google::Protobuf::Empty - # List all blueprints. - rpc :ListBlueprints, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse - # Approves a blueprint and commits a new revision. - rpc :ApproveBlueprint, ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint - # Proposes a blueprint for approval of changes. - rpc :ProposeBlueprint, ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint - # Rejects a blueprint revision proposal and flips it back to Draft state. - rpc :RejectBlueprint, ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::Blueprint - # List blueprint revisions of a given blueprint. - rpc :ListBlueprintRevisions, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse - # Searches across blueprint revisions. - rpc :SearchBlueprintRevisions, ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse - # Searches across deployment revisions. - rpc :SearchDeploymentRevisions, ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse - # Discards the changes in a blueprint and reverts the blueprint to the last - # approved blueprint revision. No changes take place if a blueprint does not - # have revisions. - rpc :DiscardBlueprintChanges, ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse - # Lists the blueprints in TNA's public catalog. Default page size = 20, - # Max Page Size = 100. - rpc :ListPublicBlueprints, ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse - # Returns the requested public blueprint. - rpc :GetPublicBlueprint, ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint - # Creates a deployment. - rpc :CreateDeployment, ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment - # Updates a deployment. - rpc :UpdateDeployment, ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment - # Returns the requested deployment. - rpc :GetDeployment, ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment - # Removes the deployment by marking it as DELETING. Post which deployment and - # it's revisions gets deleted. - rpc :RemoveDeployment, ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, ::Google::Protobuf::Empty - # List all deployments. - rpc :ListDeployments, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse - # List deployment revisions of a given deployment. - rpc :ListDeploymentRevisions, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse - # Discards the changes in a deployment and reverts the deployment to the last - # approved deployment revision. No changes take place if a deployment does - # not have revisions. - rpc :DiscardDeploymentChanges, ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse - # Applies the deployment's YAML files to the parent orchestration cluster. - rpc :ApplyDeployment, ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment - # Returns the requested deployment status. - rpc :ComputeDeploymentStatus, ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse - # Rollback the active deployment to the given past approved deployment - # revision. - rpc :RollbackDeployment, ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::Deployment - # Returns the requested hydrated deployment. - rpc :GetHydratedDeployment, ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment - # List all hydrated deployments present under a deployment. - rpc :ListHydratedDeployments, ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse - # Updates a hydrated deployment. - rpc :UpdateHydratedDeployment, ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment - # Applies a hydrated deployment to a workload cluster. - rpc :ApplyHydratedDeployment, ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md deleted file mode 100644 index ad404433aa18..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Telco Automation V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-telco_automation-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb deleted file mode 100644 index 2386f15aacc5..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/cloud/telcoautomation/v1/telcoautomation.rb +++ /dev/null @@ -1,1551 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation - module V1 - # Orchestration cluster represents a GKE cluster with config controller and - # TNA specific components installed on it. - # @!attribute [rw] name - # @return [::String] - # Name of the orchestration cluster. The name of orchestration cluster cannot - # be more than 24 characters. - # @!attribute [rw] management_config - # @return [::Google::Cloud::TelcoAutomation::V1::ManagementConfig] - # Management configuration of the underlying GKE cluster. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create time stamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Update time stamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [r] tna_version - # @return [::String] - # Output only. Provides the TNA version installed on the cluster. - # @!attribute [r] state - # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster::State] - # Output only. State of the Orchestration Cluster. - class OrchestrationCluster - 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 - - # Possible states that the Orchestration Cluster can be in. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # OrchestrationCluster is being created. - CREATING = 1 - - # OrchestrationCluster has been created and is ready for use. - ACTIVE = 2 - - # OrchestrationCluster is being deleted. - DELETING = 3 - - # OrchestrationCluster encountered an error and is in an indeterministic - # state. User can still initiate a delete operation on this state. - FAILED = 4 - end - end - - # EdgeSlm represents an SLM instance which manages the lifecycle of edge - # components installed on Workload clusters managed by an Orchestration - # Cluster. - # @!attribute [rw] name - # @return [::String] - # Name of the EdgeSlm resource. - # @!attribute [rw] orchestration_cluster - # @return [::String] - # Immutable. Reference to the orchestration cluster on which templates for - # this resources will be applied. This should be of format - # projects/\\{project}/locations/\\{location}/orchestrationClusters/\\{orchestration_cluster}. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create time stamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Update time stamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels as key value pairs. The key and value should contain - # characters which are UTF-8 compliant and less than 50 characters. - # @!attribute [r] tna_version - # @return [::String] - # Output only. Provides the active TNA version for this resource. - # @!attribute [r] state - # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm::State] - # Output only. State of the EdgeSlm resource. - # @!attribute [rw] workload_cluster_type - # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm::WorkloadClusterType] - # Optional. Type of workload cluster for which an EdgeSLM resource is - # created. - class EdgeSlm - 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 - - # Possible states of the resource. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # EdgeSlm is being created. - CREATING = 1 - - # EdgeSlm has been created and is ready for use. - ACTIVE = 2 - - # EdgeSlm is being deleted. - DELETING = 3 - - # EdgeSlm encountered an error and is in an indeterministic - # state. User can still initiate a delete operation on this state. - FAILED = 4 - end - - # Workload clusters supported by TNA. New values will be added to the enum - # list as TNA adds supports for new workload clusters in future. - module WorkloadClusterType - # Unspecified workload cluster. - WORKLOAD_CLUSTER_TYPE_UNSPECIFIED = 0 - - # Workload cluster is a GDCE cluster. - GDCE = 1 - - # Workload cluster is a GKE cluster. - GKE = 2 - end - end - - # A Blueprint contains a collection of kubernetes resources in the form of - # YAML files. The file contents of a blueprint are collectively known as - # package. A blueprint can be - # a) imported from TNA's public catalog - # b) modified as per a user's need - # c) proposed and approved. - # On approval, a revision of blueprint is created which can be used to - # create a deployment on Orchestration or Workload Cluster. - # @!attribute [rw] name - # @return [::String] - # The name of the blueprint. If unspecified, the name will be autogenerated - # from server side. Name of the blueprint must not contain `@` character. - # @!attribute [r] revision_id - # @return [::String] - # Output only. Immutable. The revision ID of the blueprint. - # A new revision is committed whenever a blueprint is approved. - # @!attribute [rw] source_blueprint - # @return [::String] - # Required. Immutable. The public blueprint ID from which this blueprint was - # created. - # @!attribute [r] revision_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp that the revision was created. - # @!attribute [r] approval_state - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint::ApprovalState] - # Output only. Approval state of the blueprint (DRAFT, PROPOSED, APPROVED) - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human readable name of a Blueprint. - # @!attribute [r] repository - # @return [::String] - # Output only. Name of the repository where the blueprint files are stored. - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::File>] - # Optional. Files present in a blueprint. - # When invoking UpdateBlueprint API, only the modified files should be - # included in this. Files that are not included in the update of a blueprint - # will not be changed. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels are key-value attributes that can be set on a blueprint - # resource by the user. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Blueprint creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the blueprint was updated. - # @!attribute [r] source_provider - # @return [::String] - # Output only. Source provider is the author of a public blueprint, from - # which this blueprint is created. - # @!attribute [r] deployment_level - # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentLevel] - # Output only. DeploymentLevel of a blueprint signifies where the blueprint - # will be applied. e.g. [HYDRATION, SINGLE_DEPLOYMENT, MULTI_DEPLOYMENT] - # @!attribute [r] rollback_support - # @return [::Boolean] - # Output only. Indicates if the deployment created from this blueprint can be - # rolled back. - class Blueprint - 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 - - # Approval state indicates the state of a Blueprint in its approval - # lifecycle. - module ApprovalState - # Unspecified state. - APPROVAL_STATE_UNSPECIFIED = 0 - - # A blueprint starts in DRAFT state once it is created. All edits are made - # to the blueprint in DRAFT state. - DRAFT = 1 - - # When the edits are ready for review, blueprint can be proposed and moves - # to PROPOSED state. Edits cannot be made to a blueprint in PROPOSED state. - PROPOSED = 2 - - # When a proposed blueprint is approved, it moves to APPROVED state. A new - # revision is committed. The latest committed revision can be used to - # create a deployment on Orchestration or Workload Cluster. Edits to an - # APPROVED blueprint changes its state back to DRAFT. The last committed - # revision of a blueprint represents its latest APPROVED state. - APPROVED = 3 - end - end - - # A Blueprint contains a collection of kubernetes resources in the form of - # YAML files. The file contents of a blueprint are collectively known as - # package. - # Public blueprint is a TNA provided blueprint that in present in TNA's public - # catalog. A user can copy the public blueprint to their private catalog for - # further modifications. - # @!attribute [rw] name - # @return [::String] - # Name of the public blueprint. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the public blueprint. - # @!attribute [rw] description - # @return [::String] - # The description of the public blueprint. - # @!attribute [rw] deployment_level - # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentLevel] - # DeploymentLevel of a blueprint signifies where the blueprint will be - # applied. e.g. [HYDRATION, SINGLE_DEPLOYMENT, MULTI_DEPLOYMENT] - # @!attribute [rw] source_provider - # @return [::String] - # Source provider is the author of a public blueprint. e.g. Google, vendors - # @!attribute [r] rollback_support - # @return [::Boolean] - # Output only. Indicates if the deployment created from this blueprint can be - # rolled back. - class PublicBlueprint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Deployment contains a collection of YAML files (This collection is also known - # as package) that can to applied on an orchestration cluster (GKE cluster with - # TNA addons) or a workload cluster. - # @!attribute [rw] name - # @return [::String] - # The name of the deployment. - # @!attribute [r] revision_id - # @return [::String] - # Output only. Immutable. The revision ID of the deployment. - # A new revision is committed whenever a change in deployment is applied. - # @!attribute [rw] source_blueprint_revision - # @return [::String] - # Required. The blueprint revision from which this deployment was created. - # @!attribute [r] revision_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp that the revision was created. - # @!attribute [r] state - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment::State] - # Output only. State of the deployment (DRAFT, APPLIED, DELETING). - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human readable name of a Deployment. - # @!attribute [r] repository - # @return [::String] - # Output only. Name of the repository where the deployment package files are - # stored. - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::File>] - # Optional. Files present in a deployment. - # When invoking UpdateDeployment API, only the modified files should be - # included in this. Files that are not included in the update of a deployment - # will not be changed. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels are key-value attributes that can be set on a deployment - # resource by the user. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Deployment creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the deployment was updated. - # @!attribute [r] source_provider - # @return [::String] - # Output only. Source provider is the author of a public blueprint, from - # which this deployment is created. - # @!attribute [rw] workload_cluster - # @return [::String] - # Optional. Immutable. The WorkloadCluster on which to create the Deployment. - # This field should only be passed when the deployment_level of the source - # blueprint specifies deployments on workload clusters e.g. - # WORKLOAD_CLUSTER_DEPLOYMENT. - # @!attribute [r] deployment_level - # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentLevel] - # Output only. Attributes to where the deployment can inflict changes. The - # value can only be [SINGLE_DEPLOYMENT, MULTI_DEPLOYMENT]. - # @!attribute [r] rollback_support - # @return [::Boolean] - # Output only. Indicates if the deployment can be rolled back, exported from - # public blueprint. - class Deployment - 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 - - # State defines which state the current deployment is in. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # A deployment starts in DRAFT state. All edits are made in DRAFT state. A - # deployment opened for editing after applying will be in draft state, - # while its prevision revision will be its current applied version. - DRAFT = 1 - - # This state means that the contents (YAML files containing kubernetes - # resources) of the deployment have been applied to an Orchestration or - # Workload Cluster. A revision is created when a deployment is applied. - # This revision will represent the latest view of what is applied on the - # cluster until the deployment is modified and applied again, which will - # create a new revision. - APPLIED = 2 - - # A deployment in DELETING state has been marked for deletion. Its - # deletion status can be queried using `ComputeDeploymentStatus` API. No - # updates are allowed to a deployment in DELETING state. - DELETING = 3 - end - end - - # A collection of kubernetes yaml files which are deployed on a Workload - # Cluster. Hydrated Deployments are created by TNA intent based automation. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the hydrated deployment. - # @!attribute [r] state - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment::State] - # Output only. State of the hydrated deployment (DRAFT, APPLIED). - # @!attribute [rw] files - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::File>] - # Optional. File contents of a hydrated deployment. - # When invoking UpdateHydratedBlueprint API, only the modified files should - # be included in this. Files that are not included in the update of a - # hydrated deployment will not be changed. - # @!attribute [r] workload_cluster - # @return [::String] - # Output only. WorkloadCluster identifies which workload cluster will the - # hydrated deployment will be deployed on. - class HydratedDeployment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State defines which state the current hydrated deployment is in. - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # A hydrated deployment starts in DRAFT state. All edits are made in DRAFT - # state. - DRAFT = 1 - - # When the edit is applied, the hydrated deployment moves to APPLIED - # state. No changes can be made once a hydrated deployment is applied. - APPLIED = 2 - end - end - - # Message for requesting list of OrchestrationClusters. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListOrchestrationClustersRequest - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListOrchestrationClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing OrchestrationClusters. - # @!attribute [rw] orchestration_clusters - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster>] - # The list of OrchestrationCluster - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListOrchestrationClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a OrchestrationCluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class GetOrchestrationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a OrchestrationCluster. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] orchestration_cluster_id - # @return [::String] - # Required. Id of the requesting object - # If auto-generating Id server-side, remove this field and - # orchestration_cluster_id from the method_signature of Create RPC - # @!attribute [rw] orchestration_cluster - # @return [::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateOrchestrationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a OrchestrationCluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteOrchestrationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of EdgeSlms - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListEdgeSlmsRequest - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results - class ListEdgeSlmsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing EdgeSlms. - # @!attribute [rw] edge_slms - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::EdgeSlm>] - # The list of EdgeSlm - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListEdgeSlmsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a EdgeSlm. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class GetEdgeSlmRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a EdgeSlm. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] edge_slm_id - # @return [::String] - # Required. Id of the requesting object - # If auto-generating Id server-side, remove this field and - # edge_slm_id from the method_signature of Create RPC - # @!attribute [rw] edge_slm - # @return [::Google::Cloud::TelcoAutomation::V1::EdgeSlm] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateEdgeSlmRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a EdgeSlm. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteEdgeSlmRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `CreateBlueprint`. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of parent resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @!attribute [rw] blueprint_id - # @return [::String] - # Optional. The name of the blueprint. - # @!attribute [rw] blueprint - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # Required. The `Blueprint` to create. - class CreateBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `UpdateBlueprint`. - # @!attribute [rw] blueprint - # @return [::Google::Cloud::TelcoAutomation::V1::Blueprint] - # Required. The `blueprint` to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Update mask is used to specify the fields to be overwritten in - # the `blueprint` resource by the update. - class UpdateBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `GetBlueprint`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the blueprint. - # Case 1: If the name provided in the request is - # \\{blueprint_id}@\\{revision_id}, then the revision with revision_id will be - # returned. Case 2: If the name provided in the request is \\{blueprint}, then - # the current state of the blueprint is returned. - # @!attribute [rw] view - # @return [::Google::Cloud::TelcoAutomation::V1::BlueprintView] - # Optional. Defines the type of view of the blueprint. - # When field is not present BLUEPRINT_VIEW_BASIC is considered as default. - class GetBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `DeleteBlueprint`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of blueprint to delete. - # Blueprint name should be in the format \\{blueprint_id}, if - # \\{blueprint_id}@\\{revision_id} is passed then the API throws invalid - # argument. - class DeleteBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ListBlueprints`. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering only supports equality on blueprint state. - # It should be in the form: "state = DRAFT". `OR` operator can be used to - # get response for multiple states. e.g. "state = DRAFT OR state = PROPOSED". - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of blueprints to return per page. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, received from a previous ListBlueprints call. - # It can be provided to retrieve the subsequent page. - class ListBlueprintsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `ListBlueprints`. - # @!attribute [rw] blueprints - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # The list of requested blueprints. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListBlueprintsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ApproveBlueprint`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the blueprint to approve. The blueprint must be in - # Proposed state. A new revision is committed on approval. - class ApproveBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ProposeBlueprint`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the blueprint being proposed. - class ProposeBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `RejectBlueprint`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the blueprint being rejected. - class RejectBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ListBlueprintRevisions`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the blueprint to list revisions for. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of revisions to return per page. - # @!attribute [rw] page_token - # @return [::String] - # The page token, received from a previous ListBlueprintRevisions call - # It can be provided to retrieve the subsequent page. - class ListBlueprintRevisionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `ListBlueprintRevisions`. - # @!attribute [rw] blueprints - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # The revisions of the blueprint. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListBlueprintRevisionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `SearchBlueprintRevisions`. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @!attribute [rw] query - # @return [::String] - # Required. Supported queries: - # 1. "" : Lists all revisions across all blueprints. - # 2. "latest=true" : Lists latest revisions across all blueprints. - # 3. "name=\\{name}" : Lists all revisions of blueprint with name - # \\{name}. - # 4. "name=\\{name} latest=true": Lists latest revision of blueprint with name - # \\{name} - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of blueprints revisions to return per page. - # max page size = 100, default page size = 20. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, received from a previous search call. - # It can be provided to retrieve the subsequent page. - class SearchBlueprintRevisionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `SearchBlueprintRevisions`. - # @!attribute [rw] blueprints - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Blueprint>] - # The list of requested blueprint revisions. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class SearchBlueprintRevisionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `DiscardBlueprintChanges`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the blueprint of which changes are being discarded. - class DiscardBlueprintChangesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `DiscardBlueprintChanges`. - class DiscardBlueprintChangesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ListPublicBlueprints`. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value of public blueprint. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}". - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - class ListPublicBlueprintsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `ListPublicBlueprints`. - # @!attribute [rw] public_blueprints - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::PublicBlueprint>] - # The list of public blueprints to return. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token identifying a page of results the server should - # return. - class ListPublicBlueprintsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `GetPublicBlueprint`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the public blueprint. - class GetPublicBlueprintRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `CreateDeployment`. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of parent resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @!attribute [rw] deployment_id - # @return [::String] - # Optional. The name of the deployment. - # @!attribute [rw] deployment - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # Required. The `Deployment` to create. - class CreateDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `UpdateDeployment`. - # @!attribute [rw] deployment - # @return [::Google::Cloud::TelcoAutomation::V1::Deployment] - # Required. The `deployment` to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Update mask is used to specify the fields to be overwritten in - # the `deployment` resource by the update. - class UpdateDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `GetDeployment`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the deployment. - # Case 1: If the name provided in the request is - # \\{deployment_id}@\\{revision_id}, then the revision with revision_id will be - # returned. - # Case 2: If the name provided in the request is \\{deployment}, then - # the current state of the deployment is returned. - # @!attribute [rw] view - # @return [::Google::Cloud::TelcoAutomation::V1::DeploymentView] - # Optional. Defines the type of view of the deployment. - # When field is not present VIEW_BASIC is considered as default. - class GetDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `RemoveDeployment`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of deployment to initiate delete. - class RemoveDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ListDeployments`. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering only supports equality on deployment state. - # It should be in the form: "state = DRAFT". `OR` operator can be used to - # get response for multiple states. e.g. "state = DRAFT OR state = APPLIED". - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of deployments to return per page. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, received from a previous ListDeployments call. - # It can be provided to retrieve the subsequent page. - class ListDeploymentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `ListDeployments`. - # @!attribute [rw] deployments - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # The list of requested deployments. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListDeploymentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for listing all revisions of a deployment. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the deployment to list revisions for. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of revisions to return per page. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, received from a previous ListDeploymentRevisions - # call Provide this to retrieve the subsequent page. - class ListDeploymentRevisionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List of deployment revisions for a given deployment. - # @!attribute [rw] deployments - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # The revisions of the deployment. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListDeploymentRevisionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `SearchDeploymentRevisions`. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of parent orchestration cluster resource. - # Format should be - - # "projects/\\{project_id}/locations/\\{location_name}/orchestrationClusters/\\{orchestration_cluster}". - # @!attribute [rw] query - # @return [::String] - # Required. Supported queries: - # 1. "" : Lists all revisions across all deployments. - # 2. "latest=true" : Lists latest revisions across all - # deployments. - # 3. "name=\\{name}" : Lists all revisions of deployment with name - # \\{name}. - # 4. "name=\\{name} latest=true": Lists latest revision of deployment with name - # \\{name} - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of deployment revisions to return per page. - # max page size = 100, default page size = 20. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, received from a previous search call. - # It can be provided to retrieve the subsequent page. - class SearchDeploymentRevisionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `SearchDeploymentRevisions`. - # @!attribute [rw] deployments - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::Deployment>] - # The list of requested deployment revisions. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class SearchDeploymentRevisionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `DiscardDeploymentChanges`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the deployment of which changes are being discarded. - class DiscardDeploymentChangesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `DiscardDeploymentChanges`. - class DiscardDeploymentChangesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ApplyDeployment`. The resources in given deployment - # gets applied to Orchestration Cluster. A new revision is created when a - # deployment is applied. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the deployment to apply to orchestration cluster. - class ApplyDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ComputeDeploymentStatus`. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the deployment without revisionID. - class ComputeDeploymentStatusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `ComputeDeploymentStatus`. - # @!attribute [rw] name - # @return [::String] - # The name of the deployment. - # @!attribute [r] aggregated_status - # @return [::Google::Cloud::TelcoAutomation::V1::Status] - # Output only. Aggregated status of a deployment. - # @!attribute [r] resource_statuses - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::ResourceStatus>] - # Output only. Resource level status details in deployments. - class ComputeDeploymentStatusResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `RollbackDeployment`. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the deployment. - # @!attribute [rw] revision_id - # @return [::String] - # Required. The revision id of deployment to roll back to. - class RollbackDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have been cancelled successfully - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `GetHydratedDeployment`. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the hydrated deployment. - class GetHydratedDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `ListHydratedDeployments`. - # @!attribute [rw] parent - # @return [::String] - # Required. The deployment managing the hydrated deployments. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of hydrated deployments to return. The service - # may return fewer than this value. If unspecified, at most 50 hydrated - # deployments will be returned. The maximum value is 1000. Values above 1000 - # will be set to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, received from a previous ListHydratedDeployments - # call. Provide this to retrieve the subsequent page. - class ListHydratedDeploymentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response object for `ListHydratedDeployments`. - # @!attribute [rw] hydrated_deployments - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::HydratedDeployment>] - # The list of hydrated deployments. - # @!attribute [rw] next_page_token - # @return [::String] - # A token that can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListHydratedDeploymentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request object for `UpdateHydratedDeployment`. - # @!attribute [rw] hydrated_deployment - # @return [::Google::Cloud::TelcoAutomation::V1::HydratedDeployment] - # Required. The hydrated deployment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The list of fields to update. Update mask supports a special - # value `*` which fully replaces (equivalent to PUT) the resource provided. - class UpdateHydratedDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for applying a hydrated deployment. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the hydrated deployment to apply. - class ApplyHydratedDeploymentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of the cluster management - # @!attribute [rw] standard_management_config - # @return [::Google::Cloud::TelcoAutomation::V1::StandardManagementConfig] - # Configuration of the standard (GKE) cluster management - # - # Note: The following fields are mutually exclusive: `standard_management_config`, `full_management_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] full_management_config - # @return [::Google::Cloud::TelcoAutomation::V1::FullManagementConfig] - # Configuration of the full (Autopilot) cluster management. Full cluster - # management is a preview feature. - # - # Note: The following fields are mutually exclusive: `full_management_config`, `standard_management_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ManagementConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of the standard (GKE) cluster management. - # @!attribute [rw] network - # @return [::String] - # Optional. Name of the VPC Network to put the GKE cluster and nodes in. The - # VPC will be created if it doesn't exist. - # @!attribute [rw] subnet - # @return [::String] - # Optional. Specifies the subnet that the interface will be part of. Network - # key must be specified and the subnet must be a subnetwork of the specified - # network. - # @!attribute [rw] master_ipv4_cidr_block - # @return [::String] - # Optional. The /28 network that the masters will use. It should be free - # within the network. - # @!attribute [rw] cluster_cidr_block - # @return [::String] - # Optional. The IP address range for the cluster pod IPs. Set to blank to - # have a range chosen with the default size. Set to /netmask (e.g. /14) to - # have a range chosen with a specific netmask. Set to a CIDR notation - # (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, - # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - # @!attribute [rw] services_cidr_block - # @return [::String] - # Optional. The IP address range for the cluster service IPs. Set to blank to - # have a range chosen with the default size. Set to /netmask (e.g. /14) to - # have a range chosen with a specific netmask. Set to a CIDR notation (e.g. - # 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, - # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - # @!attribute [rw] cluster_named_range - # @return [::String] - # Optional. The name of the existing secondary range in the cluster's - # subnetwork to use for pod IP addresses. Alternatively, cluster_cidr_block - # can be used to automatically create a GKE-managed one. - # @!attribute [rw] services_named_range - # @return [::String] - # Optional. The name of the existing secondary range in the cluster's - # subnetwork to use for service ClusterIPs. Alternatively, - # services_cidr_block can be used to automatically create a GKE-managed one. - # @!attribute [rw] master_authorized_networks_config - # @return [::Google::Cloud::TelcoAutomation::V1::MasterAuthorizedNetworksConfig] - # Optional. Master Authorized Network that supports multiple CIDR blocks. - # Allows access to the k8s master from multiple blocks. It cannot be set at - # the same time with the field man_block. - class StandardManagementConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of the full (Autopilot) cluster management - # @!attribute [rw] network - # @return [::String] - # Optional. Name of the VPC Network to put the GKE cluster and nodes in. The - # VPC will be created if it doesn't exist. - # @!attribute [rw] subnet - # @return [::String] - # Optional. Specifies the subnet that the interface will be part of. Network - # key must be specified and the subnet must be a subnetwork of the specified - # network. - # @!attribute [rw] master_ipv4_cidr_block - # @return [::String] - # Optional. The /28 network that the masters will use. - # @!attribute [rw] cluster_cidr_block - # @return [::String] - # Optional. The IP address range for the cluster pod IPs. Set to blank to - # have a range chosen with the default size. Set to /netmask (e.g. /14) to - # have a range chosen with a specific netmask. Set to a CIDR notation - # (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, - # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - # @!attribute [rw] services_cidr_block - # @return [::String] - # Optional. The IP address range for the cluster service IPs. Set to blank to - # have a range chosen with the default size. Set to /netmask (e.g. /14) to - # have a range chosen with a specific netmask. Set to a CIDR notation (e.g. - # 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, - # 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - # @!attribute [rw] cluster_named_range - # @return [::String] - # Optional. The name of the existing secondary range in the cluster's - # subnetwork to use for pod IP addresses. Alternatively, cluster_cidr_block - # can be used to automatically create a GKE-managed one. - # @!attribute [rw] services_named_range - # @return [::String] - # Optional. The name of the existing secondary range in the cluster's - # subnetwork to use for service ClusterIPs. Alternatively, - # services_cidr_block can be used to automatically create a GKE-managed one. - # @!attribute [rw] master_authorized_networks_config - # @return [::Google::Cloud::TelcoAutomation::V1::MasterAuthorizedNetworksConfig] - # Optional. Master Authorized Network that supports multiple CIDR blocks. - # Allows access to the k8s master from multiple blocks. It cannot be set at - # the same time with the field man_block. - class FullManagementConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of the Master Authorized Network that support multiple CIDRs - # @!attribute [rw] cidr_blocks - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::MasterAuthorizedNetworksConfig::CidrBlock>] - # Optional. cidr_blocks define up to 50 external networks that could access - # Kubernetes master through HTTPS. - class MasterAuthorizedNetworksConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # CidrBlock contains an optional name and one CIDR block. - # @!attribute [rw] display_name - # @return [::String] - # Optional. display_name is an optional field for users to identify CIDR - # blocks. - # @!attribute [rw] cidr_block - # @return [::String] - # Optional. cidr_block must be specified in CIDR notation when using - # master_authorized_networks_config. Currently, the user could still use - # the deprecated man_block field, so this field is currently optional, but - # will be required in the future. - class CidrBlock - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # File represents a yaml file present in a blueprint's package. - # @!attribute [rw] path - # @return [::String] - # Required. Path of the file in package. - # e.g. `gdce/v1/cluster.yaml` - # @!attribute [rw] content - # @return [::String] - # Optional. The contents of a file in string format. - # @!attribute [rw] deleted - # @return [::Boolean] - # Optional. Signifies whether a file is marked for deletion. - # @!attribute [rw] editable - # @return [::Boolean] - # Optional. Indicates whether changes are allowed to a file. If the field is - # not set, the file cannot be edited. - class File - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Status of a deployment resource. - # @!attribute [rw] name - # @return [::String] - # Name of the resource. - # @!attribute [rw] resource_namespace - # @return [::String] - # Namespace of the resource. - # @!attribute [rw] group - # @return [::String] - # Group to which the resource belongs to. - # @!attribute [rw] version - # @return [::String] - # Version of the resource. - # @!attribute [rw] kind - # @return [::String] - # Kind of the resource. - # @!attribute [r] resource_type - # @return [::Google::Cloud::TelcoAutomation::V1::ResourceType] - # Output only. Resource type. - # @!attribute [r] status - # @return [::Google::Cloud::TelcoAutomation::V1::Status] - # Output only. Status of the resource. - # @!attribute [r] nf_deploy_status - # @return [::Google::Cloud::TelcoAutomation::V1::NFDeployStatus] - # Output only. Detailed status of NFDeploy. - class ResourceStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Deployment status of NFDeploy. - # @!attribute [r] targeted_nfs - # @return [::Integer] - # Output only. Total number of NFs targeted by this deployment - # @!attribute [r] ready_nfs - # @return [::Integer] - # Output only. Total number of NFs targeted by this deployment with a Ready - # Condition set. - # @!attribute [r] sites - # @return [::Array<::Google::Cloud::TelcoAutomation::V1::NFDeploySiteStatus>] - # Output only. Per-Site Status. - class NFDeployStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Per-Site Status. - # @!attribute [r] site - # @return [::String] - # Output only. Site id. - # @!attribute [r] pending_deletion - # @return [::Boolean] - # Output only. If true, the Site Deletion is in progress. - # @!attribute [r] hydration - # @return [::Google::Cloud::TelcoAutomation::V1::HydrationStatus] - # Output only. Hydration status. - # @!attribute [r] workload - # @return [::Google::Cloud::TelcoAutomation::V1::WorkloadStatus] - # Output only. Workload status. - class NFDeploySiteStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Hydration status. - # @!attribute [r] site_version - # @return [::Google::Cloud::TelcoAutomation::V1::SiteVersion] - # Output only. SiteVersion Hydration is targeting. - # @!attribute [r] status - # @return [::String] - # Output only. Status. - class HydrationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # SiteVersion Hydration is targeting. - # @!attribute [r] nf_vendor - # @return [::String] - # Output only. NF vendor. - # @!attribute [r] nf_type - # @return [::String] - # Output only. NF vendor type. - # @!attribute [r] nf_version - # @return [::String] - # Output only. NF version. - class SiteVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Workload status. - # @!attribute [r] site_version - # @return [::Google::Cloud::TelcoAutomation::V1::SiteVersion] - # Output only. SiteVersion running in the workload cluster. - # @!attribute [r] status - # @return [::String] - # Output only. Status. - class WorkloadStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # BlueprintView defines the type of view of the blueprint. - module BlueprintView - # Unspecified enum value. - BLUEPRINT_VIEW_UNSPECIFIED = 0 - - # View which only contains metadata. - BLUEPRINT_VIEW_BASIC = 1 - - # View which contains metadata and files it encapsulates. - BLUEPRINT_VIEW_FULL = 2 - end - - # DeploymentView defines the type of view of the deployment. - module DeploymentView - # Unspecified enum value. - DEPLOYMENT_VIEW_UNSPECIFIED = 0 - - # View which only contains metadata. - DEPLOYMENT_VIEW_BASIC = 1 - - # View which contains metadata and files it encapsulates. - DEPLOYMENT_VIEW_FULL = 2 - end - - # Represent type of CR. - module ResourceType - # Unspecified resource type. - RESOURCE_TYPE_UNSPECIFIED = 0 - - # User specified NF Deploy CR. - NF_DEPLOY_RESOURCE = 1 - - # CRs that are part of a blueprint. - DEPLOYMENT_RESOURCE = 2 - end - - # Status of an entity (resource, deployment). - module Status - # Unknown state. - STATUS_UNSPECIFIED = 0 - - # Under progress. - STATUS_IN_PROGRESS = 1 - - # Running and ready to serve traffic. - STATUS_ACTIVE = 2 - - # Failed or stalled. - STATUS_FAILED = 3 - - # Delete in progress. - STATUS_DELETING = 4 - - # Deleted deployment. - STATUS_DELETED = 5 - - # NFDeploy specific status. Peering in progress. - STATUS_PEERING = 10 - - # K8s objects such as NetworkAttachmentDefinition don't have a defined - # status. - STATUS_NOT_APPLICABLE = 11 - end - - # DeploymentLevel of a blueprint signifies where the blueprint will be - # applied. - module DeploymentLevel - # Default unspecified deployment level. - DEPLOYMENT_LEVEL_UNSPECIFIED = 0 - - # Blueprints at HYDRATION level cannot be used to create a Deployment - # (A user cannot manually initate deployment of these blueprints on - # orchestration or workload cluster). - # These blueprints stay in a user's private catalog and are configured and - # deployed by TNA automation. - HYDRATION = 1 - - # Blueprints at SINGLE_DEPLOYMENT level can be - # a) Modified in private catalog. - # b) Used to create a deployment on orchestration cluster by the user, once - # approved. - SINGLE_DEPLOYMENT = 2 - - # Blueprints at MULTI_DEPLOYMENT level can be - # a) Modified in private catalog. - # b) Used to create a deployment on orchestration cluster which will create - # further hydrated deployments. - MULTI_DEPLOYMENT = 3 - - # Blueprints at WORKLOAD_CLUSTER_DEPLOYMENT level can be - # a) Modified in private catalog. - # b) Used to create a deployment on workload cluster by the user, once - # approved. - WORKLOAD_CLUSTER_DEPLOYMENT = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-telco_automation-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile deleted file mode 100644 index 5dd146715d0e..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation-v1", path: "../" -else - gem "google-cloud-telco_automation-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-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json deleted file mode 100644 index 7a4dce2494a0..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/snippet_metadata_google.cloud.telcoautomation.v1.json +++ /dev/null @@ -1,1455 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-telco_automation-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.telcoautomation.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListOrchestrationClusters_sync", - "title": "Snippet for the list_orchestration_clusters call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_orchestration_clusters.", - "file": "telco_automation/list_orchestration_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_orchestration_clusters", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_orchestration_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListOrchestrationClusters", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListOrchestrationClusters", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetOrchestrationCluster_sync", - "title": "Snippet for the get_orchestration_cluster call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_orchestration_cluster.", - "file": "telco_automation/get_orchestration_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_orchestration_cluster", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_orchestration_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "GetOrchestrationCluster", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetOrchestrationCluster", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateOrchestrationCluster_sync", - "title": "Snippet for the create_orchestration_cluster call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_orchestration_cluster.", - "file": "telco_automation/create_orchestration_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_orchestration_cluster", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_orchestration_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "CreateOrchestrationCluster", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateOrchestrationCluster", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DeleteOrchestrationCluster_sync", - "title": "Snippet for the delete_orchestration_cluster call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_orchestration_cluster.", - "file": "telco_automation/delete_orchestration_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_orchestration_cluster", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_orchestration_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "DeleteOrchestrationCluster", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DeleteOrchestrationCluster", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListEdgeSlms_sync", - "title": "Snippet for the list_edge_slms call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_edge_slms.", - "file": "telco_automation/list_edge_slms.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_edge_slms", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_edge_slms", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListEdgeSlms", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListEdgeSlms", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetEdgeSlm_sync", - "title": "Snippet for the get_edge_slm call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_edge_slm.", - "file": "telco_automation/get_edge_slm.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_edge_slm", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_edge_slm", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::EdgeSlm", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "GetEdgeSlm", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetEdgeSlm", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateEdgeSlm_sync", - "title": "Snippet for the create_edge_slm call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_edge_slm.", - "file": "telco_automation/create_edge_slm.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_edge_slm", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_edge_slm", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "CreateEdgeSlm", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateEdgeSlm", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DeleteEdgeSlm_sync", - "title": "Snippet for the delete_edge_slm call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_edge_slm.", - "file": "telco_automation/delete_edge_slm.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_edge_slm", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_edge_slm", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "DeleteEdgeSlm", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DeleteEdgeSlm", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateBlueprint_sync", - "title": "Snippet for the create_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_blueprint.", - "file": "telco_automation/create_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "CreateBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_UpdateBlueprint_sync", - "title": "Snippet for the update_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_blueprint.", - "file": "telco_automation/update_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "UpdateBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.UpdateBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetBlueprint_sync", - "title": "Snippet for the get_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_blueprint.", - "file": "telco_automation/get_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "GetBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DeleteBlueprint_sync", - "title": "Snippet for the delete_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_blueprint.", - "file": "telco_automation/delete_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#delete_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "DeleteBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DeleteBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListBlueprints_sync", - "title": "Snippet for the list_blueprints call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprints.", - "file": "telco_automation/list_blueprints.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_blueprints", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprints", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListBlueprints", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListBlueprints", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ApproveBlueprint_sync", - "title": "Snippet for the approve_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#approve_blueprint.", - "file": "telco_automation/approve_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "approve_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#approve_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ApproveBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ApproveBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ProposeBlueprint_sync", - "title": "Snippet for the propose_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#propose_blueprint.", - "file": "telco_automation/propose_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "propose_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#propose_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ProposeBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ProposeBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_RejectBlueprint_sync", - "title": "Snippet for the reject_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#reject_blueprint.", - "file": "telco_automation/reject_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "reject_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#reject_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Blueprint", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "RejectBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.RejectBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListBlueprintRevisions_sync", - "title": "Snippet for the list_blueprint_revisions call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprint_revisions.", - "file": "telco_automation/list_blueprint_revisions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_blueprint_revisions", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprint_revisions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListBlueprintRevisions", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListBlueprintRevisions", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_SearchBlueprintRevisions_sync", - "title": "Snippet for the search_blueprint_revisions call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_blueprint_revisions.", - "file": "telco_automation/search_blueprint_revisions.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_blueprint_revisions", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_blueprint_revisions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "SearchBlueprintRevisions", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.SearchBlueprintRevisions", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_SearchDeploymentRevisions_sync", - "title": "Snippet for the search_deployment_revisions call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_deployment_revisions.", - "file": "telco_automation/search_deployment_revisions.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_deployment_revisions", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#search_deployment_revisions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "SearchDeploymentRevisions", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.SearchDeploymentRevisions", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DiscardBlueprintChanges_sync", - "title": "Snippet for the discard_blueprint_changes call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_blueprint_changes.", - "file": "telco_automation/discard_blueprint_changes.rb", - "language": "RUBY", - "client_method": { - "short_name": "discard_blueprint_changes", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_blueprint_changes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "DiscardBlueprintChanges", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DiscardBlueprintChanges", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListPublicBlueprints_sync", - "title": "Snippet for the list_public_blueprints call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_public_blueprints.", - "file": "telco_automation/list_public_blueprints.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_public_blueprints", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_public_blueprints", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListPublicBlueprints", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListPublicBlueprints", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetPublicBlueprint_sync", - "title": "Snippet for the get_public_blueprint call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_public_blueprint.", - "file": "telco_automation/get_public_blueprint.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_public_blueprint", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_public_blueprint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::PublicBlueprint", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "GetPublicBlueprint", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetPublicBlueprint", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_CreateDeployment_sync", - "title": "Snippet for the create_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_deployment.", - "file": "telco_automation/create_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#create_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "CreateDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.CreateDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_UpdateDeployment_sync", - "title": "Snippet for the update_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_deployment.", - "file": "telco_automation/update_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "UpdateDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.UpdateDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetDeployment_sync", - "title": "Snippet for the get_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_deployment.", - "file": "telco_automation/get_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "GetDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_RemoveDeployment_sync", - "title": "Snippet for the remove_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#remove_deployment.", - "file": "telco_automation/remove_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#remove_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "RemoveDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.RemoveDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListDeployments_sync", - "title": "Snippet for the list_deployments call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployments.", - "file": "telco_automation/list_deployments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_deployments", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListDeployments", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListDeployments", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListDeploymentRevisions_sync", - "title": "Snippet for the list_deployment_revisions call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployment_revisions.", - "file": "telco_automation/list_deployment_revisions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_deployment_revisions", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_deployment_revisions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListDeploymentRevisions", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListDeploymentRevisions", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_DiscardDeploymentChanges_sync", - "title": "Snippet for the discard_deployment_changes call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_deployment_changes.", - "file": "telco_automation/discard_deployment_changes.rb", - "language": "RUBY", - "client_method": { - "short_name": "discard_deployment_changes", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#discard_deployment_changes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "DiscardDeploymentChanges", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.DiscardDeploymentChanges", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ApplyDeployment_sync", - "title": "Snippet for the apply_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_deployment.", - "file": "telco_automation/apply_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "apply_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ApplyDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ApplyDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ComputeDeploymentStatus_sync", - "title": "Snippet for the compute_deployment_status call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#compute_deployment_status.", - "file": "telco_automation/compute_deployment_status.rb", - "language": "RUBY", - "client_method": { - "short_name": "compute_deployment_status", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#compute_deployment_status", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ComputeDeploymentStatus", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ComputeDeploymentStatus", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_RollbackDeployment_sync", - "title": "Snippet for the rollback_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#rollback_deployment.", - "file": "telco_automation/rollback_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "rollback_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#rollback_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::Deployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "RollbackDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.RollbackDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_GetHydratedDeployment_sync", - "title": "Snippet for the get_hydrated_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_hydrated_deployment.", - "file": "telco_automation/get_hydrated_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_hydrated_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#get_hydrated_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::HydratedDeployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "GetHydratedDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.GetHydratedDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ListHydratedDeployments_sync", - "title": "Snippet for the list_hydrated_deployments call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_hydrated_deployments.", - "file": "telco_automation/list_hydrated_deployments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_hydrated_deployments", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#list_hydrated_deployments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ListHydratedDeployments", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ListHydratedDeployments", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_UpdateHydratedDeployment_sync", - "title": "Snippet for the update_hydrated_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_hydrated_deployment.", - "file": "telco_automation/update_hydrated_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_hydrated_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#update_hydrated_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::HydratedDeployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "UpdateHydratedDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.UpdateHydratedDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "telcoautomation_v1_generated_TelcoAutomation_ApplyHydratedDeployment_sync", - "title": "Snippet for the apply_hydrated_deployment call in the TelcoAutomation service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_hydrated_deployment.", - "file": "telco_automation/apply_hydrated_deployment.rb", - "language": "RUBY", - "client_method": { - "short_name": "apply_hydrated_deployment", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client#apply_hydrated_deployment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TelcoAutomation::V1::HydratedDeployment", - "client": { - "short_name": "TelcoAutomation::Client", - "full_name": "::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client" - }, - "method": { - "short_name": "ApplyHydratedDeployment", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation.ApplyHydratedDeployment", - "service": { - "short_name": "TelcoAutomation", - "full_name": "google.cloud.telcoautomation.v1.TelcoAutomation" - } - } - }, - "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-telco_automation-v1/snippets/telco_automation/apply_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb deleted file mode 100644 index 6ef9fad80a28..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ApplyDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the apply_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#apply_deployment. -# -def apply_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new - - # Call the apply_deployment method. - result = client.apply_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_ApplyDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb deleted file mode 100644 index 2b072dc5c67e..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/apply_hydrated_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ApplyHydratedDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the apply_hydrated_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#apply_hydrated_deployment. -# -def apply_hydrated_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new - - # Call the apply_hydrated_deployment method. - result = client.apply_hydrated_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_ApplyHydratedDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb deleted file mode 100644 index f575adec66b0..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/approve_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ApproveBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the approve_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#approve_blueprint. -# -def approve_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new - - # Call the approve_blueprint method. - result = client.approve_blueprint request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_ApproveBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb deleted file mode 100644 index 649e4df861e0..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/compute_deployment_status.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ComputeDeploymentStatus_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the compute_deployment_status call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#compute_deployment_status. -# -def compute_deployment_status - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new - - # Call the compute_deployment_status method. - result = client.compute_deployment_status request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_ComputeDeploymentStatus_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb deleted file mode 100644 index fb48fce111ce..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the create_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_blueprint. -# -def create_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new - - # Call the create_blueprint method. - result = client.create_blueprint request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_CreateBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb deleted file mode 100644 index 50957be164fc..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the create_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_deployment. -# -def create_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new - - # Call the create_deployment method. - result = client.create_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_CreateDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb deleted file mode 100644 index 09483c7f6561..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_edge_slm.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateEdgeSlm_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the create_edge_slm call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_edge_slm. -# -def create_edge_slm - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new - - # Call the create_edge_slm method. - result = client.create_edge_slm 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 telcoautomation_v1_generated_TelcoAutomation_CreateEdgeSlm_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb deleted file mode 100644 index 9e819520ccbe..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/create_orchestration_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_CreateOrchestrationCluster_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the create_orchestration_cluster call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#create_orchestration_cluster. -# -def create_orchestration_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new - - # Call the create_orchestration_cluster method. - result = client.create_orchestration_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 telcoautomation_v1_generated_TelcoAutomation_CreateOrchestrationCluster_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb deleted file mode 100644 index 7d2053f3fbe9..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DeleteBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the delete_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#delete_blueprint. -# -def delete_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new - - # Call the delete_blueprint method. - result = client.delete_blueprint request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_DeleteBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb deleted file mode 100644 index 3c881a5faac3..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_edge_slm.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DeleteEdgeSlm_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the delete_edge_slm call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#delete_edge_slm. -# -def delete_edge_slm - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.new - - # Call the delete_edge_slm method. - result = client.delete_edge_slm 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 telcoautomation_v1_generated_TelcoAutomation_DeleteEdgeSlm_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb deleted file mode 100644 index ec4c90ef42c6..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/delete_orchestration_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DeleteOrchestrationCluster_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the delete_orchestration_cluster call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#delete_orchestration_cluster. -# -def delete_orchestration_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.new - - # Call the delete_orchestration_cluster method. - result = client.delete_orchestration_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 telcoautomation_v1_generated_TelcoAutomation_DeleteOrchestrationCluster_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb deleted file mode 100644 index 7a6b315bbc97..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_blueprint_changes.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DiscardBlueprintChanges_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the discard_blueprint_changes call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#discard_blueprint_changes. -# -def discard_blueprint_changes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new - - # Call the discard_blueprint_changes method. - result = client.discard_blueprint_changes request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_DiscardBlueprintChanges_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb deleted file mode 100644 index 4c200c82912b..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/discard_deployment_changes.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_DiscardDeploymentChanges_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the discard_deployment_changes call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#discard_deployment_changes. -# -def discard_deployment_changes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new - - # Call the discard_deployment_changes method. - result = client.discard_deployment_changes request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_DiscardDeploymentChanges_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb deleted file mode 100644 index f6389e7206c7..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the get_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_blueprint. -# -def get_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new - - # Call the get_blueprint method. - result = client.get_blueprint request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_GetBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb deleted file mode 100644 index d7affc180770..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the get_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_deployment. -# -def get_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new - - # Call the get_deployment method. - result = client.get_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_GetDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb deleted file mode 100644 index 028ca2b921b3..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_edge_slm.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetEdgeSlm_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the get_edge_slm call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_edge_slm. -# -def get_edge_slm - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new - - # Call the get_edge_slm method. - result = client.get_edge_slm request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::EdgeSlm. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_GetEdgeSlm_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb deleted file mode 100644 index e0fd8ecf6de2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_hydrated_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetHydratedDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the get_hydrated_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_hydrated_deployment. -# -def get_hydrated_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new - - # Call the get_hydrated_deployment method. - result = client.get_hydrated_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_GetHydratedDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb deleted file mode 100644 index 868d0765f0e5..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_orchestration_cluster.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetOrchestrationCluster_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the get_orchestration_cluster call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_orchestration_cluster. -# -def get_orchestration_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new - - # Call the get_orchestration_cluster method. - result = client.get_orchestration_cluster request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::OrchestrationCluster. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_GetOrchestrationCluster_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb deleted file mode 100644 index 042660f4b4e8..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/get_public_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_GetPublicBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the get_public_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#get_public_blueprint. -# -def get_public_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new - - # Call the get_public_blueprint method. - result = client.get_public_blueprint request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::PublicBlueprint. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_GetPublicBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb deleted file mode 100644 index 6d392a9c3b56..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprint_revisions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListBlueprintRevisions_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_blueprint_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprint_revisions. -# -def list_blueprint_revisions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new - - # Call the list_blueprint_revisions method. - result = client.list_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListBlueprintRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb deleted file mode 100644 index 3c3110dd1491..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_blueprints.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListBlueprints_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_blueprints call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_blueprints. -# -def list_blueprints - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new - - # Call the list_blueprints method. - result = client.list_blueprints 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::TelcoAutomation::V1::Blueprint. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListBlueprints_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb deleted file mode 100644 index 8135cf5b7fa2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployment_revisions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListDeploymentRevisions_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_deployment_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_deployment_revisions. -# -def list_deployment_revisions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new - - # Call the list_deployment_revisions method. - result = client.list_deployment_revisions 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::TelcoAutomation::V1::Deployment. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListDeploymentRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb deleted file mode 100644 index 4c263b609502..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_deployments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListDeployments_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_deployments call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_deployments. -# -def list_deployments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new - - # Call the list_deployments method. - result = client.list_deployments 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::TelcoAutomation::V1::Deployment. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListDeployments_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb deleted file mode 100644 index 764597f3e805..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_edge_slms.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListEdgeSlms_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_edge_slms call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_edge_slms. -# -def list_edge_slms - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.new - - # Call the list_edge_slms method. - result = client.list_edge_slms 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::TelcoAutomation::V1::EdgeSlm. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListEdgeSlms_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb deleted file mode 100644 index 5ef1508c264d..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_hydrated_deployments.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListHydratedDeployments_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_hydrated_deployments call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_hydrated_deployments. -# -def list_hydrated_deployments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.new - - # Call the list_hydrated_deployments method. - result = client.list_hydrated_deployments 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::TelcoAutomation::V1::HydratedDeployment. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListHydratedDeployments_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb deleted file mode 100644 index 8843a3d25975..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_orchestration_clusters.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListOrchestrationClusters_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_orchestration_clusters call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_orchestration_clusters. -# -def list_orchestration_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new - - # Call the list_orchestration_clusters method. - result = client.list_orchestration_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::TelcoAutomation::V1::OrchestrationCluster. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListOrchestrationClusters_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb deleted file mode 100644 index e1b5503b4efd..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/list_public_blueprints.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ListPublicBlueprints_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the list_public_blueprints call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#list_public_blueprints. -# -def list_public_blueprints - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.new - - # Call the list_public_blueprints method. - result = client.list_public_blueprints 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::TelcoAutomation::V1::PublicBlueprint. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_ListPublicBlueprints_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb deleted file mode 100644 index b7ec509c5f02..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/propose_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_ProposeBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the propose_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#propose_blueprint. -# -def propose_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new - - # Call the propose_blueprint method. - result = client.propose_blueprint request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_ProposeBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb deleted file mode 100644 index 75a4ea6ea8af..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/reject_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_RejectBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the reject_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#reject_blueprint. -# -def reject_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new - - # Call the reject_blueprint method. - result = client.reject_blueprint request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_RejectBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb deleted file mode 100644 index bb2d2295d142..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/remove_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_RemoveDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the remove_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#remove_deployment. -# -def remove_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new - - # Call the remove_deployment method. - result = client.remove_deployment request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_RemoveDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb deleted file mode 100644 index b8ca6cdd4e1e..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/rollback_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_RollbackDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the rollback_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#rollback_deployment. -# -def rollback_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new - - # Call the rollback_deployment method. - result = client.rollback_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_RollbackDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb deleted file mode 100644 index decfa6d9bc27..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_blueprint_revisions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_SearchBlueprintRevisions_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the search_blueprint_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#search_blueprint_revisions. -# -def search_blueprint_revisions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new - - # Call the search_blueprint_revisions method. - result = client.search_blueprint_revisions 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::TelcoAutomation::V1::Blueprint. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_SearchBlueprintRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb deleted file mode 100644 index a17c4de2a015..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/search_deployment_revisions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_SearchDeploymentRevisions_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the search_deployment_revisions call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#search_deployment_revisions. -# -def search_deployment_revisions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new - - # Call the search_deployment_revisions method. - result = client.search_deployment_revisions 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::TelcoAutomation::V1::Deployment. - p item - end -end -# [END telcoautomation_v1_generated_TelcoAutomation_SearchDeploymentRevisions_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb deleted file mode 100644 index 1281abedf47a..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_blueprint.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_UpdateBlueprint_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the update_blueprint call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#update_blueprint. -# -def update_blueprint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new - - # Call the update_blueprint method. - result = client.update_blueprint request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Blueprint. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_UpdateBlueprint_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb deleted file mode 100644 index 3baab957f9bb..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_UpdateDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the update_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#update_deployment. -# -def update_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new - - # Call the update_deployment method. - result = client.update_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::Deployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_UpdateDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb b/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb deleted file mode 100644 index b99b772b91c4..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/snippets/telco_automation/update_hydrated_deployment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 telcoautomation_v1_generated_TelcoAutomation_UpdateHydratedDeployment_sync] -require "google/cloud/telco_automation/v1" - -## -# Snippet for the update_hydrated_deployment call in the TelcoAutomation 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::TelcoAutomation::V1::TelcoAutomation::Client#update_hydrated_deployment. -# -def update_hydrated_deployment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new - - # Call the update_hydrated_deployment method. - result = client.update_hydrated_deployment request - - # The returned object is of type Google::Cloud::TelcoAutomation::V1::HydratedDeployment. - p result -end -# [END telcoautomation_v1_generated_TelcoAutomation_UpdateHydratedDeployment_sync] diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb deleted file mode 100644 index eedbcf1982df..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" -require "google/cloud/telcoautomation/v1/telcoautomation_services_pb" -require "google/cloud/telco_automation/v1/telco_automation" - -class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb deleted file mode 100644 index e833fcbea5eb..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_paths_test.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation/v1/telco_automation" - -class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_blueprint_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.blueprint_path project: "value0", location: "value1", orchestration_cluster: "value2", blueprint: "value3" - assert_equal "projects/value0/locations/value1/orchestrationClusters/value2/blueprints/value3", path - end - end - - def test_deployment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.deployment_path project: "value0", location: "value1", orchestration_cluster: "value2", deployment: "value3" - assert_equal "projects/value0/locations/value1/orchestrationClusters/value2/deployments/value3", path - end - end - - def test_edge_slm_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.edge_slm_path project: "value0", location: "value1", edge_slm: "value2" - assert_equal "projects/value0/locations/value1/edgeSlms/value2", path - end - end - - def test_hydrated_deployment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.hydrated_deployment_path project: "value0", location: "value1", orchestration_cluster: "value2", deployment: "value3", hydrated_deployment: "value4" - assert_equal "projects/value0/locations/value1/orchestrationClusters/value2/deployments/value3/hydratedDeployments/value4", 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::TelcoAutomation::V1::TelcoAutomation::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_orchestration_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::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.orchestration_cluster_path project: "value0", location: "value1", orchestration_cluster: "value2" - assert_equal "projects/value0/locations/value1/orchestrationClusters/value2", path - end - end - - def test_public_blueprint_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.public_blueprint_path project: "value0", location: "value1", public_lueprint: "value2" - assert_equal "projects/value0/locations/value1/publicBlueprints/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb deleted file mode 100644 index dfa385ab3434..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_rest_test.rb +++ /dev/null @@ -1,2089 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" -require "google/cloud/telco_automation/v1/telco_automation/rest" - - -class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_orchestration_clusters - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.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_orchestration_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_orchestration_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_orchestration_clusters_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_orchestration_clusters({ 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_orchestration_clusters 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_orchestration_clusters ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters({ 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_orchestration_clusters(::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters_client_stub.call_count - end - end - end - - def test_get_orchestration_cluster - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_orchestration_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_orchestration_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_orchestration_cluster_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_orchestration_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_orchestration_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_orchestration_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_orchestration_cluster_client_stub.call_count - end - end - end - - def test_create_orchestration_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. - parent = "hello world" - orchestration_cluster_id = "hello world" - orchestration_cluster = {} - request_id = "hello world" - - create_orchestration_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_orchestration_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_orchestration_cluster_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_orchestration_cluster parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_orchestration_cluster_client_stub.call_count - end - end - end - - def test_delete_orchestration_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. - name = "hello world" - request_id = "hello world" - - delete_orchestration_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_delete_orchestration_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_orchestration_cluster_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_orchestration_cluster({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_orchestration_cluster name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster({ 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster_client_stub.call_count - end - end - end - - def test_list_edge_slms - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.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_edge_slms_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_edge_slms_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_edge_slms_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_edge_slms({ 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_edge_slms 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_edge_slms ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms({ 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_edge_slms(::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms_client_stub.call_count - end - end - end - - def test_get_edge_slm - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_edge_slm_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_edge_slm_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_edge_slm_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_edge_slm({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_edge_slm name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_edge_slm ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_edge_slm({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_edge_slm(::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_edge_slm_client_stub.call_count - end - end - end - - def test_create_edge_slm - # 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" - edge_slm_id = "hello world" - edge_slm = {} - request_id = "hello world" - - create_edge_slm_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_edge_slm_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_edge_slm_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_edge_slm parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_edge_slm ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_edge_slm(::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_edge_slm_client_stub.call_count - end - end - end - - def test_delete_edge_slm - # 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_edge_slm_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_delete_edge_slm_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_edge_slm_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_edge_slm({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_edge_slm name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_edge_slm ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm({ 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm_client_stub.call_count - end - end - end - - def test_create_blueprint - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - blueprint_id = "hello world" - blueprint = {} - - create_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_blueprint parent: parent, blueprint_id: blueprint_id, blueprint: blueprint do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_blueprint ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_blueprint(::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_blueprint_client_stub.call_count - end - end - end - - def test_update_blueprint - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - blueprint = {} - update_mask = {} - - update_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_update_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_blueprint({ blueprint: blueprint, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_blueprint blueprint: blueprint, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_blueprint ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_blueprint({ blueprint: blueprint, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_blueprint(::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_blueprint_client_stub.call_count - end - end - end - - def test_get_blueprint - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :BLUEPRINT_VIEW_UNSPECIFIED - - get_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_blueprint({ name: name, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_blueprint name: name, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_blueprint ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_blueprint({ name: name, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_blueprint(::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_blueprint_client_stub.call_count - end - end - end - - def test_delete_blueprint - # 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_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_delete_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_blueprint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_blueprint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_blueprint ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_blueprint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_blueprint(::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_blueprint_client_stub.call_count - end - end - end - - def test_list_blueprints - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_blueprints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_blueprints_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_blueprints_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_blueprints({ parent: parent, 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_blueprints parent: parent, 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_blueprints ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints({ parent: parent, 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_blueprints(::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints_client_stub.call_count - end - end - end - - def test_approve_blueprint - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - approve_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_approve_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, approve_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.approve_blueprint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.approve_blueprint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.approve_blueprint ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.approve_blueprint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.approve_blueprint(::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, approve_blueprint_client_stub.call_count - end - end - end - - def test_propose_blueprint - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - propose_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_propose_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, propose_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.propose_blueprint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.propose_blueprint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.propose_blueprint ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.propose_blueprint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.propose_blueprint(::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, propose_blueprint_client_stub.call_count - end - end - end - - def test_reject_blueprint - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Blueprint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - reject_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_reject_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reject_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reject_blueprint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reject_blueprint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reject_blueprint ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reject_blueprint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reject_blueprint(::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reject_blueprint_client_stub.call_count - end - end - end - - def test_list_blueprint_revisions - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - list_blueprint_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_blueprint_revisions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_blueprint_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_blueprint_revisions({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_blueprint_revisions name: name, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions({ name: name, 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_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions_client_stub.call_count - end - end - end - - def test_search_blueprint_revisions - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_blueprint_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_search_blueprint_revisions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_blueprint_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_blueprint_revisions({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_blueprint_revisions parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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.search_blueprint_revisions({ parent: parent, query: query, 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.search_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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, search_blueprint_revisions_client_stub.call_count - end - end - end - - def test_search_deployment_revisions - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_deployment_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_search_deployment_revisions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_deployment_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_deployment_revisions({ parent: parent, query: query, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_deployment_revisions parent: parent, query: query, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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.search_deployment_revisions({ parent: parent, query: query, 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.search_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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, search_deployment_revisions_client_stub.call_count - end - end - end - - def test_discard_blueprint_changes - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - discard_blueprint_changes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_discard_blueprint_changes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, discard_blueprint_changes_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.discard_blueprint_changes({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.discard_blueprint_changes name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.discard_blueprint_changes ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.discard_blueprint_changes({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.discard_blueprint_changes(::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, discard_blueprint_changes_client_stub.call_count - end - end - end - - def test_list_public_blueprints - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.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_public_blueprints_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_public_blueprints_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_public_blueprints_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_public_blueprints({ 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_public_blueprints 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_public_blueprints ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints({ 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_public_blueprints(::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints_client_stub.call_count - end - end - end - - def test_get_public_blueprint - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_public_blueprint_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_public_blueprint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_public_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_public_blueprint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_public_blueprint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_public_blueprint ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_public_blueprint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_public_blueprint(::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_public_blueprint_client_stub.call_count - end - end - end - - def test_create_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - deployment_id = "hello world" - deployment = {} - - create_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_create_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_deployment parent: parent, deployment_id: deployment_id, deployment: deployment do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_deployment ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_deployment(::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_deployment_client_stub.call_count - end - end - end - - def test_update_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - deployment = {} - update_mask = {} - - update_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_update_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_deployment({ deployment: deployment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_deployment deployment: deployment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_deployment({ deployment: deployment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_deployment_client_stub.call_count - end - end - end - - def test_get_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :DEPLOYMENT_VIEW_UNSPECIFIED - - get_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_deployment({ name: name, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_deployment name: name, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_deployment ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_deployment({ name: name, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_deployment(::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_deployment_client_stub.call_count - end - end - end - - def test_remove_deployment - # 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" - - remove_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_remove_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_deployment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_deployment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_deployment ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_deployment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_deployment(::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_deployment_client_stub.call_count - end - end - end - - def test_list_deployments - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_deployments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_deployments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_deployments_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_deployments({ parent: parent, 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_deployments parent: parent, 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_deployments ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments({ parent: parent, 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_deployments(::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments_client_stub.call_count - end - end - end - - def test_list_deployment_revisions - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - list_deployment_revisions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_deployment_revisions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_deployment_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_deployment_revisions({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_deployment_revisions name: name, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions({ name: name, 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_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions_client_stub.call_count - end - end - end - - def test_discard_deployment_changes - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - discard_deployment_changes_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_discard_deployment_changes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, discard_deployment_changes_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.discard_deployment_changes({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.discard_deployment_changes name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.discard_deployment_changes ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.discard_deployment_changes({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.discard_deployment_changes(::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, discard_deployment_changes_client_stub.call_count - end - end - end - - def test_apply_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - apply_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_apply_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, apply_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.apply_deployment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.apply_deployment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.apply_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.apply_deployment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.apply_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, apply_deployment_client_stub.call_count - end - end - end - - def test_compute_deployment_status - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - compute_deployment_status_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_compute_deployment_status_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, compute_deployment_status_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.compute_deployment_status({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.compute_deployment_status name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.compute_deployment_status ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.compute_deployment_status({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.compute_deployment_status(::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, compute_deployment_status_client_stub.call_count - end - end - end - - def test_rollback_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::Deployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - revision_id = "hello world" - - rollback_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_rollback_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, rollback_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.rollback_deployment({ name: name, revision_id: revision_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.rollback_deployment name: name, revision_id: revision_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.rollback_deployment ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.rollback_deployment({ name: name, revision_id: revision_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.rollback_deployment(::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, rollback_deployment_client_stub.call_count - end - end - end - - def test_get_hydrated_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_hydrated_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_get_hydrated_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_hydrated_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_hydrated_deployment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_hydrated_deployment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_hydrated_deployment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_hydrated_deployment_client_stub.call_count - end - end - end - - def test_list_hydrated_deployments - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.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_hydrated_deployments_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_list_hydrated_deployments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_hydrated_deployments_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_hydrated_deployments({ 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_hydrated_deployments 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_hydrated_deployments ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments({ 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_hydrated_deployments(::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments_client_stub.call_count - end - end - end - - def test_update_hydrated_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - hydrated_deployment = {} - update_mask = {} - - update_hydrated_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_update_hydrated_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_hydrated_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_hydrated_deployment({ hydrated_deployment: hydrated_deployment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_hydrated_deployment hydrated_deployment: hydrated_deployment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_hydrated_deployment({ hydrated_deployment: hydrated_deployment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_hydrated_deployment_client_stub.call_count - end - end - end - - def test_apply_hydrated_deployment - # Create test objects. - client_result = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - apply_hydrated_deployment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TelcoAutomation::V1::TelcoAutomation::Rest::ServiceStub.stub :transcode_apply_hydrated_deployment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, apply_hydrated_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.apply_hydrated_deployment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.apply_hydrated_deployment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.apply_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.apply_hydrated_deployment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.apply_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, apply_hydrated_deployment_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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb deleted file mode 100644 index c2be48e205f0..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/google/cloud/telco_automation/v1/telco_automation_test.rb +++ /dev/null @@ -1,2368 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telcoautomation/v1/telcoautomation_pb" -require "google/cloud/telco_automation/v1/telco_automation" - -class ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_orchestration_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersResponse.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_orchestration_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_orchestration_clusters, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest, 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_orchestration_clusters_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_orchestration_clusters({ 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_orchestration_clusters 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_orchestration_clusters ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters({ 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_orchestration_clusters(::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.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_orchestration_clusters_client_stub.call_rpc_count - end - end - - def test_get_orchestration_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster.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_orchestration_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_orchestration_cluster, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_orchestration_cluster_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_orchestration_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_orchestration_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_orchestration_cluster({ 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::GetOrchestrationClusterRequest.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_orchestration_cluster_client_stub.call_rpc_count - end - end - - def test_create_orchestration_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. - parent = "hello world" - orchestration_cluster_id = "hello world" - orchestration_cluster = {} - request_id = "hello world" - - create_orchestration_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_orchestration_cluster, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["orchestration_cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::OrchestrationCluster), request["orchestration_cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_orchestration_cluster_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster({ parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::CreateOrchestrationClusterRequest.new(parent: parent, orchestration_cluster_id: orchestration_cluster_id, orchestration_cluster: orchestration_cluster, 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_orchestration_cluster_client_stub.call_rpc_count - end - end - - def test_delete_orchestration_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. - name = "hello world" - request_id = "hello world" - - delete_orchestration_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_orchestration_cluster, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_orchestration_cluster_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_orchestration_cluster({ 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_orchestration_cluster 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_orchestration_cluster ::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster({ 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_orchestration_cluster(::Google::Cloud::TelcoAutomation::V1::DeleteOrchestrationClusterRequest.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_orchestration_cluster_client_stub.call_rpc_count - end - end - - def test_list_edge_slms - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsResponse.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_edge_slms_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_edge_slms, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest, 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_edge_slms_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_edge_slms({ 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_edge_slms 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_edge_slms ::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms({ 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_edge_slms(::Google::Cloud::TelcoAutomation::V1::ListEdgeSlmsRequest.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_edge_slms_client_stub.call_rpc_count - end - end - - def test_get_edge_slm - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::EdgeSlm.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_edge_slm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_edge_slm, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_edge_slm_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_edge_slm({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_edge_slm name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_edge_slm ::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_edge_slm({ 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::GetEdgeSlmRequest.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_edge_slm_client_stub.call_rpc_count - end - end - - def test_create_edge_slm - # 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" - edge_slm_id = "hello world" - edge_slm = {} - request_id = "hello world" - - create_edge_slm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_edge_slm, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["edge_slm_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::EdgeSlm), request["edge_slm"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_edge_slm_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm ::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm({ parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::CreateEdgeSlmRequest.new(parent: parent, edge_slm_id: edge_slm_id, edge_slm: edge_slm, 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_edge_slm_client_stub.call_rpc_count - end - end - - def test_delete_edge_slm - # 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_edge_slm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_edge_slm, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_edge_slm_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_edge_slm({ 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_edge_slm 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_edge_slm ::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm({ 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_edge_slm(::Google::Cloud::TelcoAutomation::V1::DeleteEdgeSlmRequest.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_edge_slm_client_stub.call_rpc_count - end - end - - def test_create_blueprint - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" - blueprint_id = "hello world" - blueprint = {} - - create_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["blueprint_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Blueprint), request["blueprint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_blueprint parent: parent, blueprint_id: blueprint_id, blueprint: blueprint do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_blueprint ::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_blueprint({ parent: parent, blueprint_id: blueprint_id, blueprint: blueprint }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_blueprint(::Google::Cloud::TelcoAutomation::V1::CreateBlueprintRequest.new(parent: parent, blueprint_id: blueprint_id, blueprint: blueprint), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_blueprint_client_stub.call_rpc_count - end - end - - def test_update_blueprint - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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. - blueprint = {} - update_mask = {} - - update_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Blueprint), request["blueprint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_blueprint({ blueprint: blueprint, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_blueprint blueprint: blueprint, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_blueprint ::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, 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_blueprint({ blueprint: blueprint, 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_blueprint(::Google::Cloud::TelcoAutomation::V1::UpdateBlueprintRequest.new(blueprint: blueprint, 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_blueprint_client_stub.call_rpc_count - end - end - - def test_get_blueprint - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" - view = :BLUEPRINT_VIEW_UNSPECIFIED - - get_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest, request - assert_equal "hello world", request["name"] - assert_equal :BLUEPRINT_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_blueprint({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_blueprint name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_blueprint ::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_blueprint({ name: name, view: view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_blueprint(::Google::Cloud::TelcoAutomation::V1::GetBlueprintRequest.new(name: name, view: view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_blueprint_client_stub.call_rpc_count - end - end - - def test_delete_blueprint - # 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_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_blueprint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_blueprint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_blueprint ::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_blueprint({ 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_blueprint(::Google::Cloud::TelcoAutomation::V1::DeleteBlueprintRequest.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_blueprint_client_stub.call_rpc_count - end - end - - def test_list_blueprints - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_blueprints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_blueprints, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest, request - assert_equal "hello world", request["parent"] - 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_blueprints_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_blueprints({ parent: parent, 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_blueprints parent: parent, 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_blueprints ::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints({ parent: parent, 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_blueprints(::Google::Cloud::TelcoAutomation::V1::ListBlueprintsRequest.new(parent: parent, 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_blueprints_client_stub.call_rpc_count - end - end - - def test_approve_blueprint - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" - - approve_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :approve_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, approve_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.approve_blueprint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.approve_blueprint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.approve_blueprint ::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.approve_blueprint({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.approve_blueprint(::Google::Cloud::TelcoAutomation::V1::ApproveBlueprintRequest.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, approve_blueprint_client_stub.call_rpc_count - end - end - - def test_propose_blueprint - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" - - propose_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :propose_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, propose_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.propose_blueprint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.propose_blueprint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.propose_blueprint ::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.propose_blueprint({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.propose_blueprint(::Google::Cloud::TelcoAutomation::V1::ProposeBlueprintRequest.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, propose_blueprint_client_stub.call_rpc_count - end - end - - def test_reject_blueprint - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Blueprint.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" - - reject_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reject_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reject_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reject_blueprint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.reject_blueprint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.reject_blueprint ::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.reject_blueprint({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.reject_blueprint(::Google::Cloud::TelcoAutomation::V1::RejectBlueprintRequest.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, reject_blueprint_client_stub.call_rpc_count - end - end - - def test_list_blueprint_revisions - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsResponse.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" - page_size = 42 - page_token = "hello world" - - list_blueprint_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_blueprint_revisions, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_blueprint_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_blueprint_revisions({ name: name, 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_blueprint_revisions name: name, 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_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions({ name: name, 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_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::ListBlueprintRevisionsRequest.new(name: name, 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_blueprint_revisions_client_stub.call_rpc_count - end - end - - def test_search_blueprint_revisions - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsResponse.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" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_blueprint_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_blueprint_revisions, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_blueprint_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_blueprint_revisions({ parent: parent, query: query, 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.search_blueprint_revisions parent: parent, query: query, 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.search_blueprint_revisions ::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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.search_blueprint_revisions({ parent: parent, query: query, 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.search_blueprint_revisions(::Google::Cloud::TelcoAutomation::V1::SearchBlueprintRevisionsRequest.new(parent: parent, query: query, 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, search_blueprint_revisions_client_stub.call_rpc_count - end - end - - def test_search_deployment_revisions - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsResponse.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" - query = "hello world" - page_size = 42 - page_token = "hello world" - - search_deployment_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_deployment_revisions, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["query"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_deployment_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_deployment_revisions({ parent: parent, query: query, 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.search_deployment_revisions parent: parent, query: query, 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.search_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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.search_deployment_revisions({ parent: parent, query: query, 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.search_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::SearchDeploymentRevisionsRequest.new(parent: parent, query: query, 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, search_deployment_revisions_client_stub.call_rpc_count - end - end - - def test_discard_blueprint_changes - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesResponse.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" - - discard_blueprint_changes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :discard_blueprint_changes, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, discard_blueprint_changes_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.discard_blueprint_changes({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.discard_blueprint_changes name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.discard_blueprint_changes ::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.discard_blueprint_changes({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.discard_blueprint_changes(::Google::Cloud::TelcoAutomation::V1::DiscardBlueprintChangesRequest.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, discard_blueprint_changes_client_stub.call_rpc_count - end - end - - def test_list_public_blueprints - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsResponse.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_public_blueprints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_public_blueprints, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest, 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_public_blueprints_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_public_blueprints({ 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_public_blueprints 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_public_blueprints ::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints({ 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_public_blueprints(::Google::Cloud::TelcoAutomation::V1::ListPublicBlueprintsRequest.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_public_blueprints_client_stub.call_rpc_count - end - end - - def test_get_public_blueprint - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::PublicBlueprint.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_public_blueprint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_public_blueprint, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_public_blueprint_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_public_blueprint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_public_blueprint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_public_blueprint ::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_public_blueprint({ 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_public_blueprint(::Google::Cloud::TelcoAutomation::V1::GetPublicBlueprintRequest.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_public_blueprint_client_stub.call_rpc_count - end - end - - def test_create_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" - deployment_id = "hello world" - deployment = {} - - create_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["deployment_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Deployment), request["deployment"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_deployment parent: parent, deployment_id: deployment_id, deployment: deployment do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_deployment ::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_deployment({ parent: parent, deployment_id: deployment_id, deployment: deployment }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_deployment(::Google::Cloud::TelcoAutomation::V1::CreateDeploymentRequest.new(parent: parent, deployment_id: deployment_id, deployment: deployment), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_deployment_client_stub.call_rpc_count - end - end - - def test_update_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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. - deployment = {} - update_mask = {} - - update_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::Deployment), request["deployment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_deployment({ deployment: deployment, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_deployment deployment: deployment, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, 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_deployment({ deployment: deployment, 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_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateDeploymentRequest.new(deployment: deployment, 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_deployment_client_stub.call_rpc_count - end - end - - def test_get_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" - view = :DEPLOYMENT_VIEW_UNSPECIFIED - - get_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest, request - assert_equal "hello world", request["name"] - assert_equal :DEPLOYMENT_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_deployment({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_deployment name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_deployment ::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_deployment({ name: name, view: view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_deployment(::Google::Cloud::TelcoAutomation::V1::GetDeploymentRequest.new(name: name, view: view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_deployment_client_stub.call_rpc_count - end - end - - def test_remove_deployment - # 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" - - remove_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_deployment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_deployment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_deployment ::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_deployment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_deployment(::Google::Cloud::TelcoAutomation::V1::RemoveDeploymentRequest.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, remove_deployment_client_stub.call_rpc_count - end - end - - def test_list_deployments - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_deployments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_deployments, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest, request - assert_equal "hello world", request["parent"] - 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_deployments_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_deployments({ parent: parent, 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_deployments parent: parent, 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_deployments ::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments({ parent: parent, 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_deployments(::Google::Cloud::TelcoAutomation::V1::ListDeploymentsRequest.new(parent: parent, 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_deployments_client_stub.call_rpc_count - end - end - - def test_list_deployment_revisions - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsResponse.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" - page_size = 42 - page_token = "hello world" - - list_deployment_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_deployment_revisions, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_deployment_revisions_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_deployment_revisions({ name: name, 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_deployment_revisions name: name, 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_deployment_revisions ::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions({ name: name, 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_deployment_revisions(::Google::Cloud::TelcoAutomation::V1::ListDeploymentRevisionsRequest.new(name: name, 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_deployment_revisions_client_stub.call_rpc_count - end - end - - def test_discard_deployment_changes - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesResponse.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" - - discard_deployment_changes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :discard_deployment_changes, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, discard_deployment_changes_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.discard_deployment_changes({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.discard_deployment_changes name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.discard_deployment_changes ::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.discard_deployment_changes({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.discard_deployment_changes(::Google::Cloud::TelcoAutomation::V1::DiscardDeploymentChangesRequest.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, discard_deployment_changes_client_stub.call_rpc_count - end - end - - def test_apply_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" - - apply_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :apply_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, apply_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.apply_deployment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.apply_deployment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.apply_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.apply_deployment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.apply_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyDeploymentRequest.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, apply_deployment_client_stub.call_rpc_count - end - end - - def test_compute_deployment_status - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusResponse.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" - - compute_deployment_status_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :compute_deployment_status, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, compute_deployment_status_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.compute_deployment_status({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.compute_deployment_status name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.compute_deployment_status ::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.compute_deployment_status({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.compute_deployment_status(::Google::Cloud::TelcoAutomation::V1::ComputeDeploymentStatusRequest.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, compute_deployment_status_client_stub.call_rpc_count - end - end - - def test_rollback_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::Deployment.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" - revision_id = "hello world" - - rollback_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rollback_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["revision_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rollback_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rollback_deployment({ name: name, revision_id: revision_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.rollback_deployment name: name, revision_id: revision_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.rollback_deployment ::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.rollback_deployment({ name: name, revision_id: revision_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.rollback_deployment(::Google::Cloud::TelcoAutomation::V1::RollbackDeploymentRequest.new(name: name, revision_id: revision_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, rollback_deployment_client_stub.call_rpc_count - end - end - - def test_get_hydrated_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.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_hydrated_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_hydrated_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_hydrated_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_hydrated_deployment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_hydrated_deployment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_hydrated_deployment({ 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_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::GetHydratedDeploymentRequest.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_hydrated_deployment_client_stub.call_rpc_count - end - end - - def test_list_hydrated_deployments - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsResponse.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_hydrated_deployments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_hydrated_deployments, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest, 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_hydrated_deployments_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_hydrated_deployments({ 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_hydrated_deployments 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_hydrated_deployments ::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments({ 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_hydrated_deployments(::Google::Cloud::TelcoAutomation::V1::ListHydratedDeploymentsRequest.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_hydrated_deployments_client_stub.call_rpc_count - end - end - - def test_update_hydrated_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.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. - hydrated_deployment = {} - update_mask = {} - - update_hydrated_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_hydrated_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment), request["hydrated_deployment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_hydrated_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_hydrated_deployment({ hydrated_deployment: hydrated_deployment, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_hydrated_deployment hydrated_deployment: hydrated_deployment, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, 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_hydrated_deployment({ hydrated_deployment: hydrated_deployment, 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_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::UpdateHydratedDeploymentRequest.new(hydrated_deployment: hydrated_deployment, 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_hydrated_deployment_client_stub.call_rpc_count - end - end - - def test_apply_hydrated_deployment - # Create GRPC objects. - grpc_response = ::Google::Cloud::TelcoAutomation::V1::HydratedDeployment.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" - - apply_hydrated_deployment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :apply_hydrated_deployment, name - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, apply_hydrated_deployment_client_stub do - # Create client - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.apply_hydrated_deployment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.apply_hydrated_deployment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.apply_hydrated_deployment ::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.apply_hydrated_deployment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.apply_hydrated_deployment(::Google::Cloud::TelcoAutomation::V1::ApplyHydratedDeploymentRequest.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, apply_hydrated_deployment_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::TelcoAutomation::V1::TelcoAutomation::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::TelcoAutomation::V1::TelcoAutomation::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client, client - assert_equal creds, client.configure.credentials - end - 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::TelcoAutomation::V1::TelcoAutomation::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb b/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-telco_automation/.gitignore b/owl-bot-staging/google-cloud-telco_automation/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/.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-telco_automation/.repo-metadata.json b/owl-bot-staging/google-cloud-telco_automation/.repo-metadata.json deleted file mode 100644 index 3b5aab262150..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "telcoautomation.googleapis.com", - "api_shortname": "telcoautomation", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation/latest", - "distribution_name": "google-cloud-telco_automation", - "is_cloud": true, - "language": "ruby", - "name": "telcoautomation", - "name_pretty": "Telco Automation API", - "product_documentation": "https://cloud.google.com/telecom-network-automation", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "APIs to automate management of cloud infrastructure for network functions.", - "ruby-cloud-product-url": "https://cloud.google.com/telecom-network-automation", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-telco_automation/.rubocop.yml b/owl-bot-staging/google-cloud-telco_automation/.rubocop.yml deleted file mode 100644 index b24d346a0484..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-telco_automation.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-telco_automation.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-telco_automation/.toys.rb b/owl-bot-staging/google-cloud-telco_automation/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-telco_automation/.yardopts b/owl-bot-staging/google-cloud-telco_automation/.yardopts deleted file mode 100644 index 1d4c6723c005..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Telco Automation API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md b/owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md deleted file mode 100644 index 43e156d42ee2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-telco_automation 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-telco_automation 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/telco_automation" - -client = Google::Cloud::TelcoAutomation.telco_automation do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/telco_automation" - -Google::Cloud::TelcoAutomation.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::TelcoAutomation.telco_automation -``` - -### 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-telco_automation -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/telco_automation" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::TelcoAutomation.telco_automation -``` - -### 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-telco_automation/CHANGELOG.md b/owl-bot-staging/google-cloud-telco_automation/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-telco_automation/Gemfile b/owl-bot-staging/google-cloud-telco_automation/Gemfile deleted file mode 100644 index 6c1027919be5..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-telco_automation-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-telco_automation.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.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-telco_automation/LICENSE.md b/owl-bot-staging/google-cloud-telco_automation/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/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-telco_automation/README.md b/owl-bot-staging/google-cloud-telco_automation/README.md deleted file mode 100644 index 0626b489ac95..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Ruby Client for the Telco Automation API - -APIs to automate management of cloud infrastructure for network functions. - - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-telco_automation-v*`. -The gem `google-cloud-telco_automation` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation/latest) -for this library, google-cloud-telco_automation, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-telco_automation-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/telecom-network-automation) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-telco_automation -``` - -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/telcoautomation.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/telco_automation" - -client = Google::Cloud::TelcoAutomation.telco_automation -request = ::Google::Cloud::TelcoAutomation::V1::ListOrchestrationClustersRequest.new # (request fields as keyword arguments...) -response = client.list_orchestration_clusters request -``` - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-telco_automation-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -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-telco_automation`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-telco_automation-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-telco_automation`. -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-telco_automation-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-telco_automation/Rakefile b/owl-bot-staging/google-cloud-telco_automation/Rakefile deleted file mode 100644 index cfe4d2f92b8f..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true -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-telco_automation acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/telco_automation/v1/telco_automation/credentials" - ::Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-telco_automation 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-telco_automation 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-telco_automation 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-telco_automation gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-telco_automation" - header "google-cloud-telco_automation rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-telco_automation yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-telco_automation 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-telco_automation 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-telco_automation 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-telco_automation/google-cloud-telco_automation.gemspec b/owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec deleted file mode 100644 index 9bee511e0bd7..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/google-cloud-telco_automation.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/telco_automation/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-telco_automation" - gem.version = Google::Cloud::TelcoAutomation::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "APIs to automate management of cloud infrastructure for network functions." - gem.summary = "APIs to automate management of cloud infrastructure for network functions." - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-telco_automation-v1", "~> 2.0" -end diff --git a/owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb b/owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb deleted file mode 100644 index f8582c59f5b2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/lib/google-cloud-telco_automation.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/telco_automation" unless defined? Google::Cloud::TelcoAutomation::VERSION diff --git a/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb b/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb deleted file mode 100644 index 07f13a2d1fd8..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation.rb +++ /dev/null @@ -1,160 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/telco_automation/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :telco_automation do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module TelcoAutomation - ## - # Create a new client object for TelcoAutomation. - # - # By default, this returns an instance of - # [Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-telco_automation-v1/latest/Google-Cloud-TelcoAutomation-V1-TelcoAutomation-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TelcoAutomation service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TelcoAutomation service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::TelcoAutomation.telco_automation_available?}. - # - # ## About TelcoAutomation - # - # TelcoAutomation Service manages the control plane cluster a.k.a. - # Orchestration Cluster (GKE cluster with config controller) of TNA. It also - # exposes blueprint APIs which manages the lifecycle of blueprints that control - # the infrastructure setup (e.g GDCE clusters) and deployment of network - # functions. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.telco_automation version: :v1, transport: :grpc, &block - require "google/cloud/telco_automation/#{version.to_s.downcase}" - - package_name = Google::Cloud::TelcoAutomation - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::TelcoAutomation.const_get(package_name).const_get(:TelcoAutomation) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TelcoAutomation service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::TelcoAutomation.telco_automation}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TelcoAutomation service, - # or if the versioned client gem needs an update to support the TelcoAutomation service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.telco_automation_available? version: :v1, transport: :grpc - require "google/cloud/telco_automation/#{version.to_s.downcase}" - package_name = Google::Cloud::TelcoAutomation - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::TelcoAutomation.const_get package_name - return false unless service_module.const_defined? :TelcoAutomation - service_module = service_module.const_get :TelcoAutomation - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-telco_automation library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.telco_automation if block_given? - - ::Google::Cloud.configure.telco_automation - end - end - end -end - -helper_path = ::File.join __dir__, "telco_automation", "helpers.rb" -require "google/cloud/telco_automation/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb b/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb deleted file mode 100644 index 8f35f65896fc..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/lib/google/cloud/telco_automation/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TelcoAutomation - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb b/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb deleted file mode 100644 index 391875dee3c0..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/client_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/telco_automation" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::TelcoAutomation::ClientConstructionMinitest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_telco_automation_grpc - skip unless Google::Cloud::TelcoAutomation.telco_automation_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::TelcoAutomation.telco_automation transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Client, client - end - end - - def test_telco_automation_rest - skip unless Google::Cloud::TelcoAutomation.telco_automation_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::TelcoAutomation.telco_automation transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::TelcoAutomation::V1::TelcoAutomation::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb b/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb deleted file mode 100644 index dd854783785b..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/test/google/cloud/telco_automation/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/telco_automation/version" - -class Google::Cloud::TelcoAutomation::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::TelcoAutomation::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-telco_automation/test/helper.rb b/owl-bot-staging/google-cloud-telco_automation/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-telco_automation/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/.gitignore b/owl-bot-staging/google-cloud-text_to_speech-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-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-text_to_speech-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1/.repo-metadata.json deleted file mode 100644 index 0f1680fa6d2d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "texttospeech.googleapis.com", - "api_shortname": "texttospeech", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest", - "distribution_name": "google-cloud-text_to_speech-v1", - "is_cloud": true, - "language": "ruby", - "name": "texttospeech", - "name_pretty": "Cloud Text-to-Speech V1 API", - "product_documentation": "https://cloud.google.com/text-to-speech", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TEXTTOSPEECH", - "ruby-cloud-product-url": "https://cloud.google.com/text-to-speech", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml b/owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml deleted file mode 100644 index dc3e19ac0403..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-text_to_speech-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-text_to_speech-v1.rb" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/.yardopts b/owl-bot-staging/google-cloud-text_to_speech-v1/.yardopts deleted file mode 100644 index b23b0b3b07e1..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Text-to-Speech 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-text_to_speech-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-text_to_speech-v1/AUTHENTICATION.md deleted file mode 100644 index 9eb74f158a54..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-text_to_speech-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-text_to_speech-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/text_to_speech/v1" - -client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/text_to_speech/v1" - -::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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-text_to_speech-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/text_to_speech/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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-text_to_speech-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-text_to_speech-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-text_to_speech-v1/LICENSE.md b/owl-bot-staging/google-cloud-text_to_speech-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-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-text_to_speech-v1/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1/README.md deleted file mode 100644 index 27409b96177e..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Text-to-Speech V1 API - -Synthesizes natural-sounding speech by applying powerful neural network models. - -Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. - -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 Text-to-Speech V1 API. Most users should consider using -the main client gem, -[google-cloud-text_to_speech](https://rubygems.org/gems/google-cloud-text_to_speech). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-text_to_speech-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/texttospeech.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/text_to_speech/v1" - -client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new -request = ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new # (request fields as keyword arguments...) -response = client.list_voices request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/text-to-speech) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/text_to_speech/v1" -require "logger" - -client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-text_to_speech`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-text_to_speech-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-text_to_speech`. -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-text_to_speech-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-text_to_speech-v1/Rakefile b/owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile deleted file mode 100644 index 7db3ca6b5cb0..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TEXTTOSPEECH_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TEXTTOSPEECH_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TEXTTOSPEECH_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 TEXTTOSPEECH_TEST_PROJECT=test123 TEXTTOSPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/text_to_speech/v1/text_to_speech/credentials" - ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TEXTTOSPEECH_PROJECT"] = project - ENV["TEXTTOSPEECH_TEST_PROJECT"] = project - ENV["TEXTTOSPEECH_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-text_to_speech-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-text_to_speech-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-text_to_speech-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-text_to_speech-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-text_to_speech-v1" - header "google-cloud-text_to_speech-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-text_to_speech-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-text_to_speech-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-text_to_speech-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-text_to_speech-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-text_to_speech-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json deleted file mode 100644 index 16049d7c8a36..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/gapic_metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.texttospeech.v1", - "libraryPackage": "::Google::Cloud::TextToSpeech::V1", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client", - "rpcs": { - "ListVoices": { - "methods": [ - "list_voices" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesize_speech" - ] - }, - "StreamingSynthesize": { - "methods": [ - "streaming_synthesize" - ] - } - } - } - } - }, - "TextToSpeechLongAudioSynthesize": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client", - "rpcs": { - "SynthesizeLongAudio": { - "methods": [ - "synthesize_long_audio" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec b/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec deleted file mode 100644 index a031828cd206..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/google-cloud-text_to_speech-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/text_to_speech/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-text_to_speech-v1" - gem.version = Google::Cloud::TextToSpeech::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details." - gem.summary = "Synthesizes natural-sounding speech by applying powerful neural network models." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb deleted file mode 100644 index 796720aff7fd..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google-cloud-text_to_speech-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb deleted file mode 100644 index 4d6d2e5dfd49..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" -require "google/cloud/text_to_speech/v1/version" - -module Google - module Cloud - module TextToSpeech - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/text_to_speech/v1" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/text_to_speech/v1" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/text_to_speech/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb deleted file mode 100644 index 410254eba135..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech/rest" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" -require "google/cloud/text_to_speech/v1/version" - -module Google - module Cloud - module TextToSpeech - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/text_to_speech/v1/rest" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb deleted file mode 100644 index ec1fb13e094d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" - -require "google/cloud/text_to_speech/v1/text_to_speech/credentials" -require "google/cloud/text_to_speech/v1/text_to_speech/paths" -require "google/cloud/text_to_speech/v1/text_to_speech/client" -require "google/cloud/text_to_speech/v1/text_to_speech/rest" - -module Google - module Cloud - module TextToSpeech - module V1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/text_to_speech/v1/text_to_speech" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/text_to_speech/v1/text_to_speech/rest" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new - # - module TextToSpeech - end - end - end - end -end - -helper_path = ::File.join __dir__, "text_to_speech", "helpers.rb" -require "google/cloud/text_to_speech/v1/text_to_speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb deleted file mode 100644 index f538e52e5dfe..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/client.rb +++ /dev/null @@ -1,655 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeech - ## - # Client for the TextToSpeech service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_stub - - ## - # Configure the TextToSpeech Client class. - # - # See {::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeech clients - # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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", "TextToSpeech", "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.timeout = 300.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::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 - @text_to_speech_stub.universe_domain - end - - ## - # Create a new TextToSpeech client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeech 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/texttospeech/v1/cloud_tts_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 - - @text_to_speech_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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, - logger: @config.logger - ) - - @text_to_speech_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_stub.logger - end - - # Service calls - - ## - # Returns a list of Voice supported for synthesis. - # - # @overload list_voices(request, options = nil) - # Pass arguments to `list_voices` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1::ListVoicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_voices(language_code: nil) - # Pass arguments to `list_voices` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param language_code [::String] - # Optional. Recommended. - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # If not specified, the API will return all supported voices. - # If specified, the ListVoices call will only return voices that can be used - # to synthesize this language_code. For example, if you specify `"en-NZ"`, - # all `"en-NZ"` voices will be returned. If you specify `"no"`, both - # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - # returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new - # - # # Call the list_voices method. - # result = client.list_voices request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. - # p result - # - def list_voices request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest - - # Converts hash 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_voices.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::TextToSpeech::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.list_voices.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_voices.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.call_rpc :list_voices, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Synthesizes speech synchronously: receive results after all text input - # has been processed. - # - # @overload synthesize_speech(request, options = nil) - # Pass arguments to `synthesize_speech` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, advanced_voice_options: nil) - # Pass arguments to `synthesize_speech` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions, ::Hash] - # Advanced voice options. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new - # - # # Call the synthesize_speech method. - # result = client.synthesize_speech request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. - # p result - # - def synthesize_speech request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest - - # Converts hash 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.synthesize_speech.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::TextToSpeech::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.synthesize_speech.timeout, - metadata: metadata, - retry_policy: @config.rpcs.synthesize_speech.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.call_rpc :synthesize_speech, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs bidirectional streaming speech synthesis: receives audio while - # sending text. - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest, ::Hash>] - # An enumerable of {::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_synthesize method to start streaming. - # output = client.streaming_synthesize input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new - # input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_synthesize request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest - end - - # Converts hash 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.streaming_synthesize.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::TextToSpeech::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.streaming_synthesize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_synthesize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.call_rpc :streaming_synthesize, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeech API. - # - # This class represents the configuration for TextToSpeech, - # 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::TextToSpeech::V1::TextToSpeech::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_voices to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeech 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_voices` - # @return [::Gapic::Config::Method] - # - attr_reader :list_voices - ## - # RPC-specific configuration for `synthesize_speech` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_speech - ## - # RPC-specific configuration for `streaming_synthesize` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_synthesize - - # @private - def initialize parent_rpcs = nil - list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices - @list_voices = ::Gapic::Config::Method.new list_voices_config - synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech - @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config - streaming_synthesize_config = parent_rpcs.streaming_synthesize if parent_rpcs.respond_to? :streaming_synthesize - @streaming_synthesize = ::Gapic::Config::Method.new streaming_synthesize_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb deleted file mode 100644 index ae03a5f2f50e..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - module TextToSpeech - # Credentials for the TextToSpeech API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "TEXTTOSPEECH_CREDENTIALS", - "TEXTTOSPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TEXTTOSPEECH_CREDENTIALS_JSON", - "TEXTTOSPEECH_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-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb deleted file mode 100644 index 742f694939cc..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/paths.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - module TextToSpeech - # Path helper methods for the TextToSpeech API. - module Paths - ## - # Create a fully-qualified Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb deleted file mode 100644 index c624653e2965..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" - -require "google/cloud/text_to_speech/v1/text_to_speech/credentials" -require "google/cloud/text_to_speech/v1/text_to_speech/paths" -require "google/cloud/text_to_speech/v1/text_to_speech/rest/client" - -module Google - module Cloud - module TextToSpeech - module V1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/text_to_speech/v1/text_to_speech/rest" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new - # - module TextToSpeech - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/text_to_speech/v1/text_to_speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb deleted file mode 100644 index 862337249dae..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/client.rb +++ /dev/null @@ -1,528 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" -require "google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeech - module Rest - ## - # REST client for the TextToSpeech service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_stub - - ## - # Configure the TextToSpeech Client class. - # - # See {::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeech clients - # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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", "TextToSpeech", "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.timeout = 300.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::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 - @text_to_speech_stub.universe_domain - end - - ## - # Create a new TextToSpeech REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeech 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 - - @text_to_speech_stub = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @text_to_speech_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_stub.logger - end - - # Service calls - - ## - # Returns a list of Voice supported for synthesis. - # - # @overload list_voices(request, options = nil) - # Pass arguments to `list_voices` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1::ListVoicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_voices(language_code: nil) - # Pass arguments to `list_voices` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param language_code [::String] - # Optional. Recommended. - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # If not specified, the API will return all supported voices. - # If specified, the ListVoices call will only return voices that can be used - # to synthesize this language_code. For example, if you specify `"en-NZ"`, - # all `"en-NZ"` voices will be returned. If you specify `"no"`, both - # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - # returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new - # - # # Call the list_voices method. - # result = client.list_voices request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. - # p result - # - def list_voices request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest - - # Converts hash 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_voices.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::TextToSpeech::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_voices.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_voices.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.list_voices request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Synthesizes speech synchronously: receive results after all text input - # has been processed. - # - # @overload synthesize_speech(request, options = nil) - # Pass arguments to `synthesize_speech` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, advanced_voice_options: nil) - # Pass arguments to `synthesize_speech` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions, ::Hash] - # Advanced voice options. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new - # - # # Call the synthesize_speech method. - # result = client.synthesize_speech request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. - # p result - # - def synthesize_speech request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest - - # Converts hash 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.synthesize_speech.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::TextToSpeech::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.synthesize_speech.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.synthesize_speech.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.synthesize_speech request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeech REST API. - # - # This class represents the configuration for TextToSpeech 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::TextToSpeech::V1::TextToSpeech::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_voices to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeech 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_voices` - # @return [::Gapic::Config::Method] - # - attr_reader :list_voices - ## - # RPC-specific configuration for `synthesize_speech` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_speech - - # @private - def initialize parent_rpcs = nil - list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices - @list_voices = ::Gapic::Config::Method.new list_voices_config - synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech - @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb deleted file mode 100644 index 2b4b9cdd5d6d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech/rest/service_stub.rb +++ /dev/null @@ -1,200 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeech - module Rest - ## - # REST service stub for the TextToSpeech service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_voices REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest] - # 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::TextToSpeech::V1::ListVoicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1::ListVoicesResponse] - # A result object deserialized from the server's reply - def list_voices request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_voices_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, - method_name: "list_voices", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the synthesize_speech REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest] - # 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::TextToSpeech::V1::SynthesizeSpeechResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse] - # A result object deserialized from the server's reply - def synthesize_speech request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_speech_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, - method_name: "synthesize_speech", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_voices REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1::ListVoicesRequest] - # 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_voices_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/voices", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the synthesize_speech REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_synthesize_speech_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/text:synthesize", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb deleted file mode 100644 index 5ac749d808a7..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" - -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" - -module Google - module Cloud - module TextToSpeech - module V1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - module TextToSpeechLongAudioSynthesize - end - end - end - end -end - -helper_path = ::File.join __dir__, "text_to_speech_long_audio_synthesize", "helpers.rb" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb deleted file mode 100644 index c0e39e1b0936..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/client.rb +++ /dev/null @@ -1,510 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - ## - # Client for the TextToSpeechLongAudioSynthesize service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_long_audio_synthesize_stub - - ## - # Configure the TextToSpeechLongAudioSynthesize Client class. - # - # See {::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients - # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "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.synthesize_long_audio.timeout = 5000.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 - @text_to_speech_long_audio_synthesize_stub.universe_domain - end - - ## - # Create a new TextToSpeechLongAudioSynthesize client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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/texttospeech/v1/cloud_tts_lrs_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 - - @text_to_speech_long_audio_synthesize_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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, - logger: @config.logger - ) - - @text_to_speech_long_audio_synthesize_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_long_audio_synthesize_stub.logger - end - - # Service calls - - ## - # Synthesizes long form text asynchronously. - # - # @overload synthesize_long_audio(request, options = nil) - # Pass arguments to `synthesize_long_audio` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) - # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at - # least one keyword argument is 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] - # The resource states of the request in the form of - # `projects/*/locations/*`. - # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param output_gcs_uri [::String] - # Required. Specifies a Cloud Storage URI for the synthesis results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # - # @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/text_to_speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new - # - # # Call the synthesize_long_audio method. - # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest - - # Converts hash 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.synthesize_long_audio.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::TextToSpeech::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.synthesize_long_audio.timeout, - metadata: metadata, - retry_policy: @config.rpcs.synthesize_long_audio.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_long_audio_synthesize_stub.call_rpc :synthesize_long_audio, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeechLongAudioSynthesize API. - # - # This class represents the configuration for TextToSpeechLongAudioSynthesize, - # 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 - # # synthesize_long_audio to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_long_audio - - # @private - def initialize parent_rpcs = nil - synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio - @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb deleted file mode 100644 index df1224d64357..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - # Credentials for the TextToSpeechLongAudioSynthesize API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "TEXTTOSPEECH_CREDENTIALS", - "TEXTTOSPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TEXTTOSPEECH_CREDENTIALS_JSON", - "TEXTTOSPEECH_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-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb deleted file mode 100644 index fadf9ad19fb8..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::TextToSpeech::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? - throw :response, 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::TextToSpeech::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? - throw :response, 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::TextToSpeech::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? - 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::TextToSpeech::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? - 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::TextToSpeech::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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb deleted file mode 100644 index 3632788fa392..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - # Path helper methods for the TextToSpeechLongAudioSynthesize API. - module Paths - ## - # Create a fully-qualified Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb deleted file mode 100644 index eb8a249fb23a..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/version" - -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/credentials" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/paths" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client" - -module Google - module Cloud - module TextToSpeech - module V1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - module TextToSpeechLongAudioSynthesize - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb deleted file mode 100644 index 06c4eb02a0f9..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/client.rb +++ /dev/null @@ -1,460 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - module Rest - ## - # REST client for the TextToSpeechLongAudioSynthesize service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_long_audio_synthesize_stub - - ## - # Configure the TextToSpeechLongAudioSynthesize Client class. - # - # See {::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients - # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "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.synthesize_long_audio.timeout = 5000.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 - @text_to_speech_long_audio_synthesize_stub.universe_domain - end - - ## - # Create a new TextToSpeechLongAudioSynthesize REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 - - @text_to_speech_long_audio_synthesize_stub = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @text_to_speech_long_audio_synthesize_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_long_audio_synthesize_stub.logger - end - - # Service calls - - ## - # Synthesizes long form text asynchronously. - # - # @overload synthesize_long_audio(request, options = nil) - # Pass arguments to `synthesize_long_audio` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) - # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at - # least one keyword argument is 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] - # The resource states of the request in the form of - # `projects/*/locations/*`. - # @param input [::Google::Cloud::TextToSpeech::V1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param audio_config [::Google::Cloud::TextToSpeech::V1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param output_gcs_uri [::String] - # Required. Specifies a Cloud Storage URI for the synthesis results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - # @param voice [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # @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/text_to_speech/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new - # - # # Call the synthesize_long_audio method. - # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest - - # Converts hash 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.synthesize_long_audio.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::TextToSpeech::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.synthesize_long_audio.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.synthesize_long_audio.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_long_audio_synthesize_stub.synthesize_long_audio request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeechLongAudioSynthesize REST API. - # - # This class represents the configuration for TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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 - # # synthesize_long_audio to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_long_audio - - # @private - def initialize parent_rpcs = nil - synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio - @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb deleted file mode 100644 index 166fbb391f2b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/operations.rb +++ /dev/null @@ -1,925 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @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::TextToSpeech::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? - throw :response, 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::TextToSpeech::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? - throw :response, 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::TextToSpeech::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? - 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::TextToSpeech::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? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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/[^/]+/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{^operations(?:/.*)?$}, true] - ] - ) - 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", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb deleted file mode 100644 index 865f7c9fc35b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest/service_stub.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - module Rest - ## - # REST service stub for the TextToSpeechLongAudioSynthesize service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the synthesize_long_audio REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest] - # 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 synthesize_long_audio request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_long_audio_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, - method_name: "synthesize_long_audio", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the synthesize_long_audio REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_synthesize_long_audio_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:synthesizeLongAudio", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb deleted file mode 100644 index bac4947af0ac..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/text_to_speech/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb deleted file mode 100644 index a03e80c06d34..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/texttospeech/v1/cloud_tts_lrs.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/cloud/texttospeech/v1/cloud_tts_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/texttospeech/v1/cloud_tts_lrs.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/texttospeech/v1/cloud_tts.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\x02\n\x1aSynthesizeLongAudioRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12@\n\x05input\x18\x02 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02\x12\x1b\n\x0eoutput_gcs_uri\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x05 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\"\x1d\n\x1bSynthesizeLongAudioResponse\"\xa4\x01\n\x1bSynthesizeLongAudioMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01\x12\x1b\n\x13progress_percentage\x18\x03 \x01(\x01\x32\x9f\x03\n\x1fTextToSpeechLongAudioSynthesize\x12\xaa\x02\n\x13SynthesizeLongAudio\x12\x38.google.cloud.texttospeech.v1.SynthesizeLongAudioRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41t\n8google.cloud.texttospeech.v1.SynthesizeLongAudioResponse\x12\x38google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata\x82\xd3\xe4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:synthesizeLongAudio:\x01*\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xef\x01\n com.google.cloud.texttospeech.v1B#TextToSpeechLongAudioSynthesisProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1\xea\x02\x1fGoogle::Cloud::TextToSpeech::V1b\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.texttospeech.v1.SynthesisInput", "google/cloud/texttospeech/v1/cloud_tts.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 TextToSpeech - module V1 - SynthesizeLongAudioRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeLongAudioRequest").msgclass - SynthesizeLongAudioResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeLongAudioResponse").msgclass - SynthesizeLongAudioMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeLongAudioMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb deleted file mode 100644 index a814fd22032f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/texttospeech/v1/cloud_tts_lrs.proto for package 'Google.Cloud.TextToSpeech.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/texttospeech/v1/cloud_tts_lrs_pb' - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeechLongAudioSynthesize - # Service that implements Google Cloud Text-to-Speech API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize' - - # Synthesizes long form text asynchronously. - rpc :SynthesizeLongAudio, ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb deleted file mode 100644 index 37ce8855607f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/texttospeech/v1/cloud_tts.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' - - -descriptor_data = "\n,google/cloud/texttospeech/v1/cloud_tts.proto\x12\x1cgoogle.cloud.texttospeech.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"/\n\x11ListVoicesRequest\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\"I\n\x12ListVoicesResponse\x12\x33\n\x06voices\x18\x01 \x03(\x0b\x32#.google.cloud.texttospeech.v1.Voice\"\x94\x01\n\x05Voice\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12!\n\x19natural_sample_rate_hertz\x18\x04 \x01(\x05\"\x8a\x01\n\x14\x41\x64vancedVoiceOptions\x12*\n\x1dlow_latency_journey_synthesis\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12$\n\x14relax_safety_filters\x18\x08 \x01(\x08\x42\x06\xe0\x41\x04\xe0\x41\x01\x42 \n\x1e_low_latency_journey_synthesis\"\xdd\x02\n\x17SynthesizeSpeechRequest\x12@\n\x05input\x18\x01 \x01(\x0b\x32,.google.cloud.texttospeech.v1.SynthesisInputB\x03\xe0\x41\x02\x12\x46\n\x05voice\x18\x02 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\x44\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32).google.cloud.texttospeech.v1.AudioConfigB\x03\xe0\x41\x02\x12W\n\x16\x61\x64vanced_voice_options\x18\x08 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.AdvancedVoiceOptionsH\x00\x88\x01\x01\x42\x19\n\x17_advanced_voice_options\"\xa2\x03\n\x19\x43ustomPronunciationParams\x12\x13\n\x06phrase\x18\x01 \x01(\tH\x00\x88\x01\x01\x12h\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32H.google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1a\n\rpronunciation\x18\x03 \x01(\tH\x02\x88\x01\x01\"\xb6\x01\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12\'\n#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1c\n\x18PHONETIC_ENCODING_PINYIN\x10\x04\x42\t\n\x07_phraseB\x14\n\x12_phonetic_encodingB\x10\n\x0e_pronunciation\"g\n\x14\x43ustomPronunciations\x12O\n\x0epronunciations\x18\x01 \x03(\x0b\x32\x37.google.cloud.texttospeech.v1.CustomPronunciationParams\"\x90\x01\n\x12MultiSpeakerMarkup\x12I\n\x05turns\x18\x01 \x03(\x0b\x32\x35.google.cloud.texttospeech.v1.MultiSpeakerMarkup.TurnB\x03\xe0\x41\x02\x1a/\n\x04Turn\x12\x14\n\x07speaker\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x02\"P\n\x19MultispeakerPrebuiltVoice\x12\x1a\n\rspeaker_alias\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nspeaker_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"v\n\x17MultiSpeakerVoiceConfig\x12[\n\x15speaker_voice_configs\x18\x02 \x03(\x0b\x32\x37.google.cloud.texttospeech.v1.MultispeakerPrebuiltVoiceB\x03\xe0\x41\x02\"\x9c\x02\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12P\n\x14multi_speaker_markup\x18\x04 \x01(\x0b\x32\x30.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x12V\n\x15\x63ustom_pronunciations\x18\x03 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xe0\x41\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\x8e\x03\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x42\n\x0bssml_gender\x18\x03 \x01(\x0e\x32-.google.cloud.texttospeech.v1.SsmlVoiceGender\x12\x45\n\x0c\x63ustom_voice\x18\x04 \x01(\x0b\x32/.google.cloud.texttospeech.v1.CustomVoiceParams\x12H\n\x0bvoice_clone\x18\x05 \x01(\x0b\x32..google.cloud.texttospeech.v1.VoiceCloneParamsB\x03\xe0\x41\x01\x12\x17\n\nmodel_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12^\n\x1amulti_speaker_voice_config\x18\x07 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1.MultiSpeakerVoiceConfigB\x03\xe0\x41\x01\"\xf1\x01\n\x0b\x41udioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01\"\xf1\x01\n\x11\x43ustomVoiceParams\x12\x32\n\x05model\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\\\n\x0ereported_usage\x18\x03 \x01(\x0e\x32=.google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xe0\x41\x01\"J\n\rReportedUsage\x12\x1e\n\x1aREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REALTIME\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\"2\n\x10VoiceCloneParams\x12\x1e\n\x11voice_cloning_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\"1\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c\"\x9f\x01\n\x14StreamingAudioConfig\x12H\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32+.google.cloud.texttospeech.v1.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\rspeaking_rate\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\"\x94\x02\n\x19StreamingSynthesizeConfig\x12\x46\n\x05voice\x18\x01 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12W\n\x16streaming_audio_config\x18\x04 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.StreamingAudioConfigB\x03\xe0\x41\x01\x12V\n\x15\x63ustom_pronunciations\x18\x05 \x01(\x0b\x32\x32.google.cloud.texttospeech.v1.CustomPronunciationsB\x03\xe0\x41\x01\"\xbd\x01\n\x17StreamingSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12P\n\x14multi_speaker_markup\x18\x07 \x01(\x0b\x32\x30.google.cloud.texttospeech.v1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\xce\x01\n\x1aStreamingSynthesizeRequest\x12S\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1.StreamingSynthesizeConfigH\x00\x12\x46\n\x05input\x18\x02 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1.StreamingSynthesisInputH\x00\x42\x13\n\x11streaming_request\"4\n\x1bStreamingSynthesizeResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*{\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0c\n\x08OGG_OPUS\x10\x03\x12\t\n\x05MULAW\x10\x05\x12\x08\n\x04\x41LAW\x10\x06\x12\x07\n\x03PCM\x10\x07\x12\x07\n\x03M4A\x10\x08\x32\xc7\x04\n\x0cTextToSpeech\x12\x93\x01\n\nListVoices\x12/.google.cloud.texttospeech.v1.ListVoicesRequest\x1a\x30.google.cloud.texttospeech.v1.ListVoicesResponse\"\"\xda\x41\rlanguage_code\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/voices\x12\xbc\x01\n\x10SynthesizeSpeech\x12\x35.google.cloud.texttospeech.v1.SynthesizeSpeechRequest\x1a\x36.google.cloud.texttospeech.v1.SynthesizeSpeechResponse\"9\xda\x41\x18input,voice,audio_config\x82\xd3\xe4\x93\x02\x18\"\x13/v1/text:synthesize:\x01*\x12\x90\x01\n\x13StreamingSynthesize\x12\x38.google.cloud.texttospeech.v1.StreamingSynthesizeRequest\x1a\x39.google.cloud.texttospeech.v1.StreamingSynthesizeResponse\"\x00(\x01\x30\x01\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbc\x02\n com.google.cloud.texttospeech.v1B\x11TextToSpeechProtoP\x01ZDcloud.google.com/go/texttospeech/apiv1/texttospeechpb;texttospeechpb\xa2\x02\x04\x43TTS\xaa\x02\x1cGoogle.Cloud.TextToSpeech.V1\xca\x02\x1cGoogle\\Cloud\\TextToSpeech\\V1\xea\x02\x1fGoogle::Cloud::TextToSpeech::V1\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}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 = [ - ] - 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 TextToSpeech - module V1 - ListVoicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.ListVoicesRequest").msgclass - ListVoicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.ListVoicesResponse").msgclass - Voice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.Voice").msgclass - AdvancedVoiceOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.AdvancedVoiceOptions").msgclass - SynthesizeSpeechRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechRequest").msgclass - CustomPronunciationParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomPronunciationParams").msgclass - CustomPronunciationParams::PhoneticEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding").enummodule - CustomPronunciations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomPronunciations").msgclass - MultiSpeakerMarkup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultiSpeakerMarkup").msgclass - MultiSpeakerMarkup::Turn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultiSpeakerMarkup.Turn").msgclass - MultispeakerPrebuiltVoice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultispeakerPrebuiltVoice").msgclass - MultiSpeakerVoiceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.MultiSpeakerVoiceConfig").msgclass - SynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesisInput").msgclass - VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.VoiceSelectionParams").msgclass - AudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.AudioConfig").msgclass - CustomVoiceParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomVoiceParams").msgclass - CustomVoiceParams::ReportedUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.CustomVoiceParams.ReportedUsage").enummodule - VoiceCloneParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.VoiceCloneParams").msgclass - SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SynthesizeSpeechResponse").msgclass - StreamingAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingAudioConfig").msgclass - StreamingSynthesizeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeConfig").msgclass - StreamingSynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesisInput").msgclass - StreamingSynthesizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeRequest").msgclass - StreamingSynthesizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.StreamingSynthesizeResponse").msgclass - SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.SsmlVoiceGender").enummodule - AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1.AudioEncoding").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb deleted file mode 100644 index 45222db99258..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/texttospeech/v1/cloud_tts.proto for package 'Google.Cloud.TextToSpeech.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/texttospeech/v1/cloud_tts_pb' - -module Google - module Cloud - module TextToSpeech - module V1 - module TextToSpeech - # Service that implements Google Cloud Text-to-Speech API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.texttospeech.v1.TextToSpeech' - - # Returns a list of Voice supported for synthesis. - rpc :ListVoices, ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse - # Synthesizes speech synchronously: receive results after all text input - # has been processed. - rpc :SynthesizeSpeech, ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse - # Performs bidirectional streaming speech synthesis: receives audio while - # sending text. - rpc :StreamingSynthesize, stream(::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest), stream(::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse) - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md deleted file mode 100644 index ccb07287720d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Text-to-Speech V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-text_to_speech-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb deleted file mode 100644 index 957a73931130..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb +++ /dev/null @@ -1,583 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - # The top-level message sent by the client for the `ListVoices` method. - # @!attribute [rw] language_code - # @return [::String] - # Optional. Recommended. - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # If not specified, the API will return all supported voices. - # If specified, the ListVoices call will only return voices that can be used - # to synthesize this language_code. For example, if you specify `"en-NZ"`, - # all `"en-NZ"` voices will be returned. If you specify `"no"`, both - # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - # returned. - class ListVoicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message returned to the client by the `ListVoices` method. - # @!attribute [rw] voices - # @return [::Array<::Google::Cloud::TextToSpeech::V1::Voice>] - # The list of voices. - class ListVoicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of a voice supported by the TTS service. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # The languages that this voice supports, expressed as - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - # "en-US", "es-419", "cmn-tw"). - # @!attribute [rw] name - # @return [::String] - # The name of this voice. Each distinct voice has a unique name. - # @!attribute [rw] ssml_gender - # @return [::Google::Cloud::TextToSpeech::V1::SsmlVoiceGender] - # The gender of this voice. - # @!attribute [rw] natural_sample_rate_hertz - # @return [::Integer] - # The natural sample rate (in hertz) for this voice. - class Voice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Used for advanced voice options. - # @!attribute [rw] low_latency_journey_synthesis - # @return [::Boolean] - # Only for Journey voices. If false, the synthesis is context aware - # and has a higher latency. - # @!attribute [rw] relax_safety_filters - # @return [::Boolean] - # Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - # supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - # Otherwise, will return result - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - class AdvancedVoiceOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client for the `SynthesizeSpeech` method. - # @!attribute [rw] input - # @return [::Google::Cloud::TextToSpeech::V1::SynthesisInput] - # Required. The Synthesizer requires either plain text or SSML as input. - # @!attribute [rw] voice - # @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams] - # Required. The desired voice of the synthesized audio. - # @!attribute [rw] audio_config - # @return [::Google::Cloud::TextToSpeech::V1::AudioConfig] - # Required. The configuration of the synthesized audio. - # @!attribute [rw] advanced_voice_options - # @return [::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions] - # Advanced voice options. - class SynthesizeSpeechRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pronunciation customization for a phrase. - # @!attribute [rw] phrase - # @return [::String] - # The phrase to which the customization is applied. - # The phrase can be multiple words, such as proper nouns, but shouldn't span - # the length of the sentence. - # @!attribute [rw] phonetic_encoding - # @return [::Google::Cloud::TextToSpeech::V1::CustomPronunciationParams::PhoneticEncoding] - # The phonetic encoding of the phrase. - # @!attribute [rw] pronunciation - # @return [::String] - # The pronunciation of the phrase. This must be in the phonetic encoding - # specified above. - class CustomPronunciationParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The phonetic encoding of the phrase. - module PhoneticEncoding - # Not specified. - PHONETIC_ENCODING_UNSPECIFIED = 0 - - # IPA, such as apple -> ˈæpəl. - # https://en.wikipedia.org/wiki/International_Phonetic_Alphabet - PHONETIC_ENCODING_IPA = 1 - - # X-SAMPA, such as apple -> "{p@l". - # https://en.wikipedia.org/wiki/X-SAMPA - PHONETIC_ENCODING_X_SAMPA = 2 - - # For reading-to-pron conversion to work well, the `pronunciation` field - # should only contain Kanji, Hiragana, and Katakana. - # - # The pronunciation can also contain pitch accents. - # The start of a pitch phrase is specified with `^` and the down-pitch - # position is specified with `!`, for example: - # - # phrase:端 pronunciation:^はし - # phrase:箸 pronunciation:^は!し - # phrase:橋 pronunciation:^はし! - # - # We currently only support the Tokyo dialect, which allows at most one - # down-pitch per phrase (i.e. at most one `!` between `^`). - PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3 - - # Used to specify pronunciations for Mandarin words. See - # https://en.wikipedia.org/wiki/Pinyin. - # - # For example: 朝阳, the pronunciation is "chao2 yang2". The number - # represents the tone, and there is a space between syllables. Neutral - # tones are represented by 5, for example 孩子 "hai2 zi5". - PHONETIC_ENCODING_PINYIN = 4 - end - end - - # A collection of pronunciation customizations. - # @!attribute [rw] pronunciations - # @return [::Array<::Google::Cloud::TextToSpeech::V1::CustomPronunciationParams>] - # The pronunciation customizations are applied. - class CustomPronunciations - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of turns for multi-speaker synthesis. - # @!attribute [rw] turns - # @return [::Array<::Google::Cloud::TextToSpeech::V1::MultiSpeakerMarkup::Turn>] - # Required. Speaker turns. - class MultiSpeakerMarkup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A multi-speaker turn. - # @!attribute [rw] speaker - # @return [::String] - # Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - # to documentation for available speakers. - # @!attribute [rw] text - # @return [::String] - # Required. The text to speak. - class Turn - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Configuration for a single speaker in a Gemini TTS multi-speaker setup. - # Enables dialogue between two speakers. - # @!attribute [rw] speaker_alias - # @return [::String] - # Required. The speaker alias of the voice. This is the user-chosen speaker - # name that is used in the multispeaker text input, such as "Speaker1". - # @!attribute [rw] speaker_id - # @return [::String] - # Required. The speaker ID of the voice. See - # https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - # for available values. - class MultispeakerPrebuiltVoice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for a multi-speaker text-to-speech setup. Enables the use of up - # to two distinct voices in a single synthesis request. - # @!attribute [rw] speaker_voice_configs - # @return [::Array<::Google::Cloud::TextToSpeech::V1::MultispeakerPrebuiltVoice>] - # Required. A list of configurations for the voices of the speakers. Exactly - # two speaker voice configurations must be provided. - class MultiSpeakerVoiceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains text input to be synthesized. Either `text` or `ssml` must be - # supplied. Supplying both or neither returns - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The - # input size is limited to 5000 bytes. - # @!attribute [rw] text - # @return [::String] - # The raw text to be synthesized. - # - # Note: The following fields are mutually exclusive: `text`, `markup`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] markup - # @return [::String] - # Markup for HD voices specifically. This field may not be used with any - # other voices. - # - # Note: The following fields are mutually exclusive: `markup`, `text`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ssml - # @return [::String] - # The SSML document to be synthesized. The SSML document must be valid - # and well-formed. Otherwise the RPC will fail and return - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - # more information, see - # [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - # - # Note: The following fields are mutually exclusive: `ssml`, `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] multi_speaker_markup - # @return [::Google::Cloud::TextToSpeech::V1::MultiSpeakerMarkup] - # The multi-speaker input to be synthesized. Only applicable for - # multi-speaker synthesis. - # - # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`, `ssml`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] prompt - # @return [::String] - # This system instruction is supported only for controllable/promptable voice - # models. If this system instruction is used, we pass the unedited text to - # Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - # calls this system instruction, Style Instructions. - # @!attribute [rw] custom_pronunciations - # @return [::Google::Cloud::TextToSpeech::V1::CustomPronunciations] - # Optional. The pronunciation customizations are applied to the input. If - # this is set, the input is synthesized using the given pronunciation - # customizations. - # - # The initial support is for en-us, with plans to expand to other locales in - # the future. Instant Clone voices aren't supported. - # - # In order to customize the pronunciation of a phrase, there must be an exact - # match of the phrase in the input types. If using SSML, the phrase must not - # be inside a phoneme tag. - class SynthesisInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of which voice to use for a synthesis request. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language (and potentially also the region) of the voice - # expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag, e.g. "en-US". This should not include a script tag (e.g. use - # "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - # from the input provided in the SynthesisInput. The TTS service - # will use this parameter to help choose an appropriate voice. Note that - # the TTS service may choose a voice with a slightly different language code - # than the one selected; it may substitute a different region - # (e.g. using en-US rather than en-CA if there isn't a Canadian voice - # available), or even a different language, e.g. using "nb" (Norwegian - # Bokmal) instead of "no" (Norwegian)". - # @!attribute [rw] name - # @return [::String] - # The name of the voice. If both the name and the gender are not set, - # the service will choose a voice based on the other parameters such as - # language_code. - # @!attribute [rw] ssml_gender - # @return [::Google::Cloud::TextToSpeech::V1::SsmlVoiceGender] - # The preferred gender of the voice. If not set, the service will - # choose a voice based on the other parameters such as language_code and - # name. Note that this is only a preference, not requirement; if a - # voice of the appropriate gender is not available, the synthesizer should - # substitute a voice with a different gender rather than failing the request. - # @!attribute [rw] custom_voice - # @return [::Google::Cloud::TextToSpeech::V1::CustomVoiceParams] - # The configuration for a custom voice. If [CustomVoiceParams.model] is set, - # the service will choose the custom voice matching the specified - # configuration. - # @!attribute [rw] voice_clone - # @return [::Google::Cloud::TextToSpeech::V1::VoiceCloneParams] - # Optional. The configuration for a voice clone. If - # [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - # clone matching the specified configuration. - # @!attribute [rw] model_name - # @return [::String] - # Optional. The name of the model. If set, the service will choose the model - # matching the specified configuration. - # @!attribute [rw] multi_speaker_voice_config - # @return [::Google::Cloud::TextToSpeech::V1::MultiSpeakerVoiceConfig] - # Optional. The configuration for a Gemini multi-speaker text-to-speech - # setup. Enables the use of two distinct voices in a single synthesis - # request. - class VoiceSelectionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of audio data to be synthesized. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::TextToSpeech::V1::AudioEncoding] - # Required. The format of the audio byte stream. - # @!attribute [rw] speaking_rate - # @return [::Float] - # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - # the normal native speed supported by the specific voice. 2.0 is twice as - # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - # speed. Any other values < 0.25 or > 2.0 will return an error. - # @!attribute [rw] pitch - # @return [::Float] - # Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - # increase 20 semitones from the original pitch. -20 means decrease 20 - # semitones from the original pitch. - # @!attribute [rw] volume_gain_db - # @return [::Float] - # Optional. Input only. Volume gain (in dB) of the normal native volume - # supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - # set to a value of 0.0 (dB), will play at normal native signal amplitude. A - # value of -6.0 (dB) will play at approximately half the amplitude of the - # normal native signal amplitude. A value of +6.0 (dB) will play at - # approximately twice the amplitude of the normal native signal amplitude. - # Strongly recommend not to exceed +10 (dB) as there's usually no effective - # increase in loudness for any value greater than that. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Optional. The synthesis sample rate (in hertz) for this audio. When this is - # specified in SynthesizeSpeechRequest, if this is different from the voice's - # natural sample rate, then the synthesizer will honor this request by - # converting to the desired sample rate (which might result in worse audio - # quality), unless the specified sample rate is not supported for the - # encoding chosen, in which case it will fail the request and return - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - # @!attribute [rw] effects_profile_id - # @return [::Array<::String>] - # Optional. Input only. An identifier which selects 'audio effects' profiles - # that are applied on (post synthesized) text to speech. Effects are applied - # on top of each other in the order they are given. See - # [audio - # profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - # current supported profile ids. - class AudioConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of the custom voice to be synthesized. - # @!attribute [rw] model - # @return [::String] - # Required. The name of the AutoML model that synthesizes the custom voice. - # @!attribute [rw] reported_usage - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::TextToSpeech::V1::CustomVoiceParams::ReportedUsage] - # Optional. Deprecated. The usage of the synthesized audio to be reported. - class CustomVoiceParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Deprecated. The usage of the synthesized audio. Usage does not affect - # billing. - module ReportedUsage - # Request with reported usage unspecified will be rejected. - REPORTED_USAGE_UNSPECIFIED = 0 - - # For scenarios where the synthesized audio is not downloadable and can - # only be used once. For example, real-time request in IVR system. - REALTIME = 1 - - # For scenarios where the synthesized audio is downloadable and can be - # reused. For example, the synthesized audio is downloaded, stored in - # customer service system and played repeatedly. - OFFLINE = 2 - end - end - - # The configuration of Voice Clone feature. - # @!attribute [rw] voice_cloning_key - # @return [::String] - # Required. Created by GenerateVoiceCloningKey. - class VoiceCloneParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message returned to the client by the `SynthesizeSpeech` method. - # @!attribute [rw] audio_content - # @return [::String] - # The audio data bytes encoded as specified in the request, including the - # header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - # For LINEAR16 audio, we include the WAV header. Note: as - # with all bytes fields, protobuffers use a pure binary representation, - # whereas JSON representations use base64. - class SynthesizeSpeechResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of the desired output audio data. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::TextToSpeech::V1::AudioEncoding] - # Required. The format of the audio byte stream. - # Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - # return an error. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Optional. The synthesis sample rate (in hertz) for this audio. - # @!attribute [rw] speaking_rate - # @return [::Float] - # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - # the normal native speed supported by the specific voice. 2.0 is twice as - # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - # speed. Any other values < 0.25 or > 2.0 will return an error. - class StreamingAudioConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides configuration information for the StreamingSynthesize request. - # @!attribute [rw] voice - # @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams] - # Required. The desired voice of the synthesized audio. - # @!attribute [rw] streaming_audio_config - # @return [::Google::Cloud::TextToSpeech::V1::StreamingAudioConfig] - # Optional. The configuration of the synthesized audio. - # @!attribute [rw] custom_pronunciations - # @return [::Google::Cloud::TextToSpeech::V1::CustomPronunciations] - # Optional. The pronunciation customizations are applied to the input. If - # this is set, the input is synthesized using the given pronunciation - # customizations. - # - # The initial support is for en-us, with plans to expand to other locales in - # the future. Instant Clone voices aren't supported. - # - # In order to customize the pronunciation of a phrase, there must be an exact - # match of the phrase in the input types. If using SSML, the phrase must not - # be inside a phoneme tag. - class StreamingSynthesizeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input to be synthesized. - # @!attribute [rw] text - # @return [::String] - # The raw text to be synthesized. It is recommended that each input - # contains complete, terminating sentences, which results in better prosody - # in the output audio. - # - # Note: The following fields are mutually exclusive: `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] markup - # @return [::String] - # Markup for HD voices specifically. This field may not be used with any - # other voices. - # - # Note: The following fields are mutually exclusive: `markup`, `text`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] multi_speaker_markup - # @return [::Google::Cloud::TextToSpeech::V1::MultiSpeakerMarkup] - # Multi-speaker markup for Gemini TTS. This field may not - # be used with any other voices. - # - # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] prompt - # @return [::String] - # This is system instruction supported only for controllable voice models. - class StreamingSynthesisInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `StreamingSynthesize` method. Multiple - # `StreamingSynthesizeRequest` messages are sent in one call. - # The first message must contain a `streaming_config` that - # fully specifies the request configuration and must not contain `input`. All - # subsequent messages must only have `input` set. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeConfig] - # StreamingSynthesizeConfig to be used in this streaming attempt. Only - # specified in the first message sent in a `StreamingSynthesize` call. - # - # Note: The following fields are mutually exclusive: `streaming_config`, `input`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] input - # @return [::Google::Cloud::TextToSpeech::V1::StreamingSynthesisInput] - # Input to synthesize. Specified in all messages but the first in a - # `StreamingSynthesize` call. - # - # Note: The following fields are mutually exclusive: `input`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class StreamingSynthesizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StreamingSynthesizeResponse` is the only message returned to the - # client by `StreamingSynthesize` method. A series of zero or more - # `StreamingSynthesizeResponse` messages are streamed back to the client. - # @!attribute [rw] audio_content - # @return [::String] - # The audio data bytes encoded as specified in the request. This is - # headerless LINEAR16 audio with a sample rate of 24000. - class StreamingSynthesizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Gender of the voice as described in - # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). - module SsmlVoiceGender - # An unspecified gender. - # In VoiceSelectionParams, this means that the client doesn't care which - # gender the selected voice will have. In the Voice field of - # ListVoicesResponse, this may mean that the voice doesn't fit any of the - # other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0 - - # A male voice. - MALE = 1 - - # A female voice. - FEMALE = 2 - - # A gender-neutral voice. This voice is not yet supported. - NEUTRAL = 3 - end - - # Configuration to set up audio encoder. The encoding determines the output - # audio format that we'd like. - module AudioEncoding - # Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return - # result - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - AUDIO_ENCODING_UNSPECIFIED = 0 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - # Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1 - - # MP3 audio at 32kbps. - MP3 = 2 - - # Opus encoded audio wrapped in an ogg container. The result is a - # file which can be played natively on Android, and in browsers (at least - # Chrome and Firefox). The quality of the encoding is considerably higher - # than MP3 while using approximately the same bitrate. - OGG_OPUS = 3 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - # Audio content returned as MULAW also contains a WAV header. - MULAW = 5 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. - # Audio content returned as ALAW also contains a WAV header. - ALAW = 6 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - # Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or - # any other) header. - PCM = 7 - - # M4A audio. - M4A = 8 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb deleted file mode 100644 index 661006f03010..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/cloud/texttospeech/v1/cloud_tts_lrs.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1 - # The top-level message sent by the client for the - # `SynthesizeLongAudio` method. - # @!attribute [rw] parent - # @return [::String] - # The resource states of the request in the form of - # `projects/*/locations/*`. - # @!attribute [rw] input - # @return [::Google::Cloud::TextToSpeech::V1::SynthesisInput] - # Required. The Synthesizer requires either plain text or SSML as input. - # @!attribute [rw] audio_config - # @return [::Google::Cloud::TextToSpeech::V1::AudioConfig] - # Required. The configuration of the synthesized audio. - # @!attribute [rw] output_gcs_uri - # @return [::String] - # Required. Specifies a Cloud Storage URI for the synthesis results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - # @!attribute [rw] voice - # @return [::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams] - # Required. The desired voice of the synthesized audio. - class SynthesizeLongAudioRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message returned to the client by the `SynthesizeLongAudio` method. - class SynthesizeLongAudioResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for response returned by the `SynthesizeLongAudio` method. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time when the request was received. - # @!attribute [rw] last_update_time - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Protobuf::Timestamp] - # Deprecated. Do not use. - # @!attribute [rw] progress_percentage - # @return [::Float] - # The progress of the most recent processing update in percentage, ie. 70.0%. - class SynthesizeLongAudioMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-text_to_speech-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile deleted file mode 100644 index 7976a33d4ee6..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1", path: "../" -else - gem "google-cloud-text_to_speech-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-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json deleted file mode 100644 index 69310b5a3978..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-text_to_speech-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.texttospeech.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "texttospeech_v1_generated_TextToSpeech_ListVoices_sync", - "title": "Snippet for the list_voices call in the TextToSpeech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#list_voices.", - "file": "text_to_speech/list_voices.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_voices", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#list_voices", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1::ListVoicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TextToSpeech::V1::ListVoicesResponse", - "client": { - "short_name": "TextToSpeech::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client" - }, - "method": { - "short_name": "ListVoices", - "full_name": "google.cloud.texttospeech.v1.TextToSpeech.ListVoices", - "service": { - "short_name": "TextToSpeech", - "full_name": "google.cloud.texttospeech.v1.TextToSpeech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync", - "title": "Snippet for the synthesize_speech call in the TextToSpeech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech.", - "file": "text_to_speech/synthesize_speech.rb", - "language": "RUBY", - "client_method": { - "short_name": "synthesize_speech", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse", - "client": { - "short_name": "TextToSpeech::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client" - }, - "method": { - "short_name": "SynthesizeSpeech", - "full_name": "google.cloud.texttospeech.v1.TextToSpeech.SynthesizeSpeech", - "service": { - "short_name": "TextToSpeech", - "full_name": "google.cloud.texttospeech.v1.TextToSpeech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync", - "title": "Snippet for the streaming_synthesize call in the TextToSpeech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#streaming_synthesize.", - "file": "text_to_speech/streaming_synthesize.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_synthesize", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#streaming_synthesize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse", - "client": { - "short_name": "TextToSpeech::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client" - }, - "method": { - "short_name": "StreamingSynthesize", - "full_name": "google.cloud.texttospeech.v1.TextToSpeech.StreamingSynthesize", - "service": { - "short_name": "TextToSpeech", - "full_name": "google.cloud.texttospeech.v1.TextToSpeech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync", - "title": "Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio.", - "file": "text_to_speech_long_audio_synthesize/synthesize_long_audio.rb", - "language": "RUBY", - "client_method": { - "short_name": "synthesize_long_audio", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TextToSpeechLongAudioSynthesize::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client" - }, - "method": { - "short_name": "SynthesizeLongAudio", - "full_name": "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize.SynthesizeLongAudio", - "service": { - "short_name": "TextToSpeechLongAudioSynthesize", - "full_name": "google.cloud.texttospeech.v1.TextToSpeechLongAudioSynthesize" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb deleted file mode 100644 index dcedec6e5a0c..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeech_ListVoices_sync] -require "google/cloud/text_to_speech/v1" - -## -# Snippet for the list_voices call in the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::Client#list_voices. -# -def list_voices - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new - - # Call the list_voices method. - result = client.list_voices request - - # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. - p result -end -# [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb deleted file mode 100644 index 12502cdb1184..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/streaming_synthesize.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] -require "google/cloud/text_to_speech/v1" - -## -# Snippet for the streaming_synthesize call in the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::Client#streaming_synthesize. -# -def streaming_synthesize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_synthesize method to start streaming. - output = client.streaming_synthesize input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new - input << Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse - output.each do |current_response| - p current_response - end -end -# [END texttospeech_v1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb deleted file mode 100644 index 47f43d5a430b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] -require "google/cloud/text_to_speech/v1" - -## -# Snippet for the synthesize_speech call in the TextToSpeech 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::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech. -# -def synthesize_speech - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new - - # Call the synthesize_speech method. - result = client.synthesize_speech request - - # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. - p result -end -# [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb deleted file mode 100644 index 735a14416d4b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] -require "google/cloud/text_to_speech/v1" - -## -# Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio. -# -def synthesize_long_audio - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new - - # Call the synthesize_long_audio method. - result = client.synthesize_long_audio 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 texttospeech_v1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb deleted file mode 100644 index db4bf31d4508..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" -require "google/cloud/texttospeech/v1/cloud_tts_lrs_services_pb" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb deleted file mode 100644 index 7b3d9ca4c355..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", model: "value2" - assert_equal "projects/value0/locations/value1/models/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb deleted file mode 100644 index 9163bb0d1bf4..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_rest_test.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize/rest" - - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_synthesize_long_audio - # 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" - input = {} - audio_config = {} - output_gcs_uri = "hello world" - voice = {} - - synthesize_long_audio_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.stub :transcode_synthesize_long_audio_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, synthesize_long_audio_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, synthesize_long_audio_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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb deleted file mode 100644 index 43ec433e106d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize_test.rb +++ /dev/null @@ -1,189 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_lrs_pb" -require "google/cloud/text_to_speech/v1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_synthesize_long_audio - # 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" - input = {} - audio_config = {} - output_gcs_uri = "hello world" - voice = {} - - synthesize_long_audio_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :synthesize_long_audio, name - assert_kind_of ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::SynthesisInput), request["input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::AudioConfig), request["audio_config"] - assert_equal "hello world", request["output_gcs_uri"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams), request["voice"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, synthesize_long_audio_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) 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.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice 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.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) 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.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, 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.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), 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, synthesize_long_audio_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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client, client - assert_equal creds, client.configure.credentials - end - 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::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb deleted file mode 100644 index 9a2c35e6af4b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1/text_to_speech" - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", model: "value2" - assert_equal "projects/value0/locations/value1/models/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb deleted file mode 100644 index a521af9545c2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_rest_test.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" -require "google/cloud/text_to_speech/v1/text_to_speech/rest" - - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_voices - # Create test objects. - client_result = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - language_code = "hello world" - - list_voices_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TextToSpeech::V1::TextToSpeech::Rest::ServiceStub.stub :transcode_list_voices_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_voices_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_voices({ language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_voices language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_voices ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_voices({ language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_voices(::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_voices_client_stub.call_count - end - end - end - - def test_synthesize_speech - # Create test objects. - client_result = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - input = {} - voice = {} - audio_config = {} - advanced_voice_options = {} - - synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TextToSpeech::V1::TextToSpeech::Rest::ServiceStub.stub :transcode_synthesize_speech_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, synthesize_speech_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.synthesize_speech input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.synthesize_speech ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.synthesize_speech(::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, synthesize_speech_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::TextToSpeech::V1::TextToSpeech::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::TextToSpeech::V1::TextToSpeech::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb deleted file mode 100644 index ccce604bf027..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/google/cloud/text_to_speech/v1/text_to_speech_test.rb +++ /dev/null @@ -1,316 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1/cloud_tts_pb" -require "google/cloud/text_to_speech/v1/text_to_speech" - -class ::Google::Cloud::TextToSpeech::V1::TextToSpeech::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_voices - # Create GRPC objects. - grpc_response = ::Google::Cloud::TextToSpeech::V1::ListVoicesResponse.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. - language_code = "hello world" - - list_voices_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_voices, name - assert_kind_of ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest, request - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_voices_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_voices({ language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_voices language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_voices ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_voices({ language_code: language_code }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_voices(::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new(language_code: language_code), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_voices_client_stub.call_rpc_count - end - end - - def test_synthesize_speech - # Create GRPC objects. - grpc_response = ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse.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. - input = {} - voice = {} - audio_config = {} - advanced_voice_options = {} - - synthesize_speech_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :synthesize_speech, name - assert_kind_of ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::SynthesisInput), request["input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::VoiceSelectionParams), request["voice"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::AudioConfig), request["audio_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::AdvancedVoiceOptions), request["advanced_voice_options"] - assert request.has_advanced_voice_options? - refute_nil options - end - - Gapic::ServiceStub.stub :new, synthesize_speech_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.synthesize_speech input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.synthesize_speech ::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.synthesize_speech(::Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, advanced_voice_options: advanced_voice_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, synthesize_speech_client_stub.call_rpc_count - end - end - - def test_streaming_synthesize - # Create GRPC objects. - grpc_response = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse.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 bidi streaming method. - streaming_config = {} - - streaming_synthesize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_synthesize, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_synthesize_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_synthesize enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_synthesize stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_synthesize enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_synthesize stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, streaming_synthesize_client_stub.call_rpc_count - streaming_synthesize_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1::StreamingSynthesizeConfig), r["streaming_config"] - assert_equal :streaming_config, r.streaming_request - end - end - 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::TextToSpeech::V1::TextToSpeech::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::TextToSpeech::V1::TextToSpeech::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb b/owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.gitignore b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.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-text_to_speech-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.repo-metadata.json deleted file mode 100644 index 62505f56579f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "texttospeech.googleapis.com", - "api_shortname": "texttospeech", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1beta1/latest", - "distribution_name": "google-cloud-text_to_speech-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "texttospeech", - "name_pretty": "Cloud Text-to-Speech V1beta1 API", - "product_documentation": "https://cloud.google.com/text-to-speech", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TEXTTOSPEECH", - "ruby-cloud-product-url": "https://cloud.google.com/text-to-speech", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml deleted file mode 100644 index 1902584e3617..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-text_to_speech-v1beta1.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-text_to_speech-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/.yardopts b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.yardopts deleted file mode 100644 index e1ca395542bf..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Text-to-Speech V1beta1 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-text_to_speech-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md deleted file mode 100644 index b8cf76c40475..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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/text_to_speech/v1beta1" - -client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/text_to_speech/v1beta1" - -::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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-text_to_speech-v1beta1 -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/text_to_speech/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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-text_to_speech-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-text_to_speech-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/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-text_to_speech-v1beta1/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md deleted file mode 100644 index 164b19d0e5ab..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Text-to-Speech V1beta1 API - -Synthesizes natural-sounding speech by applying powerful neural network models. - -Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. - -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 Text-to-Speech V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-text_to_speech](https://rubygems.org/gems/google-cloud-text_to_speech). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-text_to_speech-v1beta1 -``` - -## 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/texttospeech.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/text_to_speech/v1beta1" - -client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new -request = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new # (request fields as keyword arguments...) -response = client.list_voices request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/text-to-speech) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/text_to_speech/v1beta1" -require "logger" - -client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-text_to_speech`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-text_to_speech-v1beta1`. -_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-text_to_speech`. -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-text_to_speech-v1beta1`. - -### 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-text_to_speech-v1beta1/Rakefile b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile deleted file mode 100644 index d2ce03364134..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TEXTTOSPEECH_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TEXTTOSPEECH_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TEXTTOSPEECH_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 TEXTTOSPEECH_TEST_PROJECT=test123 TEXTTOSPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/text_to_speech/v1beta1/text_to_speech/credentials" - ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TEXTTOSPEECH_PROJECT"] = project - ENV["TEXTTOSPEECH_TEST_PROJECT"] = project - ENV["TEXTTOSPEECH_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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-text_to_speech-v1beta1" - header "google-cloud-text_to_speech-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-text_to_speech-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1 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-text_to_speech-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json deleted file mode 100644 index ad2335193dfe..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.texttospeech.v1beta1", - "libraryPackage": "::Google::Cloud::TextToSpeech::V1beta1", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client", - "rpcs": { - "ListVoices": { - "methods": [ - "list_voices" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesize_speech" - ] - }, - "StreamingSynthesize": { - "methods": [ - "streaming_synthesize" - ] - } - } - } - } - }, - "TextToSpeechLongAudioSynthesize": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client", - "rpcs": { - "SynthesizeLongAudio": { - "methods": [ - "synthesize_long_audio" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec deleted file mode 100644 index 7e1ef7e87ddf..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/google-cloud-text_to_speech-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/text_to_speech/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-text_to_speech-v1beta1" - gem.version = Google::Cloud::TextToSpeech::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. Note that google-cloud-text_to_speech-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-text_to_speech instead. See the readme for more details." - gem.summary = "Synthesizes natural-sounding speech by applying powerful neural network models." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb deleted file mode 100644 index 0d9b902cd048..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google-cloud-text_to_speech-v1beta1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1" diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb deleted file mode 100644 index 5e90ad3198ba..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" -require "google/cloud/text_to_speech/v1beta1/version" - -module Google - module Cloud - module TextToSpeech - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/text_to_speech/v1beta1" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/text_to_speech/v1beta1" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/text_to_speech/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb deleted file mode 100644 index e5fbca0fbb22..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech/rest" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" -require "google/cloud/text_to_speech/v1beta1/version" - -module Google - module Cloud - module TextToSpeech - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/text_to_speech/v1beta1/rest" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb deleted file mode 100644 index b1bcd5fb1511..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" - -require "google/cloud/text_to_speech/v1beta1/text_to_speech/credentials" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/paths" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/client" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/text_to_speech/v1beta1/text_to_speech" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new - # - module TextToSpeech - end - end - end - end -end - -helper_path = ::File.join __dir__, "text_to_speech", "helpers.rb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb deleted file mode 100644 index c6f42a492766..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/client.rb +++ /dev/null @@ -1,657 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeech - ## - # Client for the TextToSpeech service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_stub - - ## - # Configure the TextToSpeech Client class. - # - # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeech clients - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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", "TextToSpeech", "V1beta1"] - 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.timeout = 300.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::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 - @text_to_speech_stub.universe_domain - end - - ## - # Create a new TextToSpeech client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeech 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/texttospeech/v1beta1/cloud_tts_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 - - @text_to_speech_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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, - logger: @config.logger - ) - - @text_to_speech_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_stub.logger - end - - # Service calls - - ## - # Returns a list of Voice supported for synthesis. - # - # @overload list_voices(request, options = nil) - # Pass arguments to `list_voices` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_voices(language_code: nil) - # Pass arguments to `list_voices` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param language_code [::String] - # Optional. Recommended. - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # If not specified, the API will return all supported voices. - # If specified, the ListVoices call will only return voices that can be used - # to synthesize this language_code. For example, if you specify `"en-NZ"`, - # all `"en-NZ"` voices will be returned. If you specify `"no"`, both - # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - # returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new - # - # # Call the list_voices method. - # result = client.list_voices request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. - # p result - # - def list_voices request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest - - # Converts hash 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_voices.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::TextToSpeech::V1beta1::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.list_voices.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_voices.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.call_rpc :list_voices, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Synthesizes speech synchronously: receive results after all text input - # has been processed. - # - # @overload synthesize_speech(request, options = nil) - # Pass arguments to `synthesize_speech` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, enable_time_pointing: nil, advanced_voice_options: nil) - # Pass arguments to `synthesize_speech` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param enable_time_pointing [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>] - # Whether and what timepoints are returned in the response. - # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions, ::Hash] - # Advanced voice options. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new - # - # # Call the synthesize_speech method. - # result = client.synthesize_speech request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. - # p result - # - def synthesize_speech request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest - - # Converts hash 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.synthesize_speech.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::TextToSpeech::V1beta1::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.synthesize_speech.timeout, - metadata: metadata, - retry_policy: @config.rpcs.synthesize_speech.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.call_rpc :synthesize_speech, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Performs bidirectional streaming speech synthesis: receives audio while - # sending text. - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest, ::Hash>] - # An enumerable of {::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_synthesize method to start streaming. - # output = client.streaming_synthesize input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new - # input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_synthesize request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest - end - - # Converts hash 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.streaming_synthesize.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::TextToSpeech::V1beta1::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.streaming_synthesize.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_synthesize.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.call_rpc :streaming_synthesize, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeech API. - # - # This class represents the configuration for TextToSpeech, - # 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::TextToSpeech::V1beta1::TextToSpeech::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_voices to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeech 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_voices` - # @return [::Gapic::Config::Method] - # - attr_reader :list_voices - ## - # RPC-specific configuration for `synthesize_speech` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_speech - ## - # RPC-specific configuration for `streaming_synthesize` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_synthesize - - # @private - def initialize parent_rpcs = nil - list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices - @list_voices = ::Gapic::Config::Method.new list_voices_config - synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech - @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config - streaming_synthesize_config = parent_rpcs.streaming_synthesize if parent_rpcs.respond_to? :streaming_synthesize - @streaming_synthesize = ::Gapic::Config::Method.new streaming_synthesize_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb deleted file mode 100644 index 20cb9a5a0f32..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - module TextToSpeech - # Credentials for the TextToSpeech API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "TEXTTOSPEECH_CREDENTIALS", - "TEXTTOSPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TEXTTOSPEECH_CREDENTIALS_JSON", - "TEXTTOSPEECH_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-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb deleted file mode 100644 index 8d480777bee8..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/paths.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - module TextToSpeech - # Path helper methods for the TextToSpeech API. - module Paths - ## - # Create a fully-qualified Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb deleted file mode 100644 index f01222022b03..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" - -require "google/cloud/text_to_speech/v1beta1/text_to_speech/credentials" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/paths" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new - # - module TextToSpeech - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb deleted file mode 100644 index 75ecc2cb5a4f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/client.rb +++ /dev/null @@ -1,530 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeech - module Rest - ## - # REST client for the TextToSpeech service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_stub - - ## - # Configure the TextToSpeech Client class. - # - # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeech clients - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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", "TextToSpeech", "V1beta1"] - 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.timeout = 300.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::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 - @text_to_speech_stub.universe_domain - end - - ## - # Create a new TextToSpeech REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeech 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 - - @text_to_speech_stub = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @text_to_speech_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_stub.logger - end - - # Service calls - - ## - # Returns a list of Voice supported for synthesis. - # - # @overload list_voices(request, options = nil) - # Pass arguments to `list_voices` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_voices(language_code: nil) - # Pass arguments to `list_voices` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param language_code [::String] - # Optional. Recommended. - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # If not specified, the API will return all supported voices. - # If specified, the ListVoices call will only return voices that can be used - # to synthesize this language_code. For example, if you specify `"en-NZ"`, - # all `"en-NZ"` voices will be returned. If you specify `"no"`, both - # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - # returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new - # - # # Call the list_voices method. - # result = client.list_voices request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. - # p result - # - def list_voices request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest - - # Converts hash 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_voices.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::TextToSpeech::V1beta1::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_voices.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_voices.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.list_voices request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Synthesizes speech synchronously: receive results after all text input - # has been processed. - # - # @overload synthesize_speech(request, options = nil) - # Pass arguments to `synthesize_speech` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload synthesize_speech(input: nil, voice: nil, audio_config: nil, enable_time_pointing: nil, advanced_voice_options: nil) - # Pass arguments to `synthesize_speech` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param enable_time_pointing [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>] - # Whether and what timepoints are returned in the response. - # @param advanced_voice_options [::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions, ::Hash] - # Advanced voice options. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/text_to_speech/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new - # - # # Call the synthesize_speech method. - # result = client.synthesize_speech request - # - # # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. - # p result - # - def synthesize_speech request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest - - # Converts hash 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.synthesize_speech.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::TextToSpeech::V1beta1::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.synthesize_speech.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.synthesize_speech.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_stub.synthesize_speech request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeech REST API. - # - # This class represents the configuration for TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::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_voices to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_voices.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeech 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_voices` - # @return [::Gapic::Config::Method] - # - attr_reader :list_voices - ## - # RPC-specific configuration for `synthesize_speech` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_speech - - # @private - def initialize parent_rpcs = nil - list_voices_config = parent_rpcs.list_voices if parent_rpcs.respond_to? :list_voices - @list_voices = ::Gapic::Config::Method.new list_voices_config - synthesize_speech_config = parent_rpcs.synthesize_speech if parent_rpcs.respond_to? :synthesize_speech - @synthesize_speech = ::Gapic::Config::Method.new synthesize_speech_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb deleted file mode 100644 index 649d72d8ea28..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech/rest/service_stub.rb +++ /dev/null @@ -1,200 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeech - module Rest - ## - # REST service stub for the TextToSpeech service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_voices REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest] - # 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::TextToSpeech::V1beta1::ListVoicesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse] - # A result object deserialized from the server's reply - def list_voices request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_voices_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, - method_name: "list_voices", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the synthesize_speech REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest] - # 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::TextToSpeech::V1beta1::SynthesizeSpeechResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse] - # A result object deserialized from the server's reply - def synthesize_speech request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_speech_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, - method_name: "synthesize_speech", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_voices REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest] - # 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_voices_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/voices", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the synthesize_speech REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_synthesize_speech_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/text:synthesize", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb deleted file mode 100644 index 9e9b19a683b1..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" - -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - module TextToSpeechLongAudioSynthesize - end - end - end - end -end - -helper_path = ::File.join __dir__, "text_to_speech_long_audio_synthesize", "helpers.rb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb deleted file mode 100644 index dd7cf39daa54..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb +++ /dev/null @@ -1,510 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - ## - # Client for the TextToSpeechLongAudioSynthesize service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_long_audio_synthesize_stub - - ## - # Configure the TextToSpeechLongAudioSynthesize Client class. - # - # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "V1beta1"] - 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.synthesize_long_audio.timeout = 5000.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 - @text_to_speech_long_audio_synthesize_stub.universe_domain - end - - ## - # Create a new TextToSpeechLongAudioSynthesize client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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/texttospeech/v1beta1/cloud_tts_lrs_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 - - @text_to_speech_long_audio_synthesize_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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, - logger: @config.logger - ) - - @text_to_speech_long_audio_synthesize_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_long_audio_synthesize_stub.logger - end - - # Service calls - - ## - # Synthesizes long form text asynchronously. - # - # @overload synthesize_long_audio(request, options = nil) - # Pass arguments to `synthesize_long_audio` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) - # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at - # least one keyword argument is 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] - # The resource states of the request in the form of - # `projects/*/locations/*`. - # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param output_gcs_uri [::String] - # Required. Specifies a Cloud Storage URI for the synthesis results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # - # @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/text_to_speech/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new - # - # # Call the synthesize_long_audio method. - # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest - - # Converts hash 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.synthesize_long_audio.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::TextToSpeech::V1beta1::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.synthesize_long_audio.timeout, - metadata: metadata, - retry_policy: @config.rpcs.synthesize_long_audio.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_long_audio_synthesize_stub.call_rpc :synthesize_long_audio, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeechLongAudioSynthesize API. - # - # This class represents the configuration for TextToSpeechLongAudioSynthesize, - # 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 - # # synthesize_long_audio to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_long_audio - - # @private - def initialize parent_rpcs = nil - synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio - @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb deleted file mode 100644 index 73270e7cae0f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - # Credentials for the TextToSpeechLongAudioSynthesize API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "TEXTTOSPEECH_CREDENTIALS", - "TEXTTOSPEECH_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TEXTTOSPEECH_CREDENTIALS_JSON", - "TEXTTOSPEECH_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-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb deleted file mode 100644 index 088a5688cb57..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::TextToSpeech::V1beta1::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? - throw :response, 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::TextToSpeech::V1beta1::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? - throw :response, 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::TextToSpeech::V1beta1::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? - 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::TextToSpeech::V1beta1::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? - 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::TextToSpeech::V1beta1::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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb deleted file mode 100644 index b964dee446f0..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - # Path helper methods for the TextToSpeechLongAudioSynthesize API. - module Paths - ## - # Create a fully-qualified Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb deleted file mode 100644 index 8ecb924df3d1..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/version" - -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - ## - # Service that implements Google Cloud Text-to-Speech API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - module TextToSpeechLongAudioSynthesize - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb deleted file mode 100644 index 7d208e743c42..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/client.rb +++ /dev/null @@ -1,460 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - module Rest - ## - # REST client for the TextToSpeechLongAudioSynthesize service. - # - # Service that implements Google Cloud Text-to-Speech API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :text_to_speech_long_audio_synthesize_stub - - ## - # Configure the TextToSpeechLongAudioSynthesize Client class. - # - # See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TextToSpeechLongAudioSynthesize clients - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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", "TextToSpeech", "V1beta1"] - 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.synthesize_long_audio.timeout = 5000.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 - @text_to_speech_long_audio_synthesize_stub.universe_domain - end - - ## - # Create a new TextToSpeechLongAudioSynthesize REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 - - @text_to_speech_long_audio_synthesize_stub = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @text_to_speech_long_audio_synthesize_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @text_to_speech_long_audio_synthesize_stub.logger - end - - # Service calls - - ## - # Synthesizes long form text asynchronously. - # - # @overload synthesize_long_audio(request, options = nil) - # Pass arguments to `synthesize_long_audio` via a request object, either of type - # {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil) - # Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at - # least one keyword argument is 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] - # The resource states of the request in the form of - # `projects/*/locations/*`. - # @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash] - # Required. The Synthesizer requires either plain text or SSML as input. - # @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash] - # Required. The configuration of the synthesized audio. - # @param output_gcs_uri [::String] - # Required. Specifies a Cloud Storage URI for the synthesis results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - # @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash] - # Required. The desired voice of the synthesized audio. - # @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/text_to_speech/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new - # - # # Call the synthesize_long_audio method. - # result = client.synthesize_long_audio 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 synthesize_long_audio request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest - - # Converts hash 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.synthesize_long_audio.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::TextToSpeech::V1beta1::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.synthesize_long_audio.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.synthesize_long_audio.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @text_to_speech_long_audio_synthesize_stub.synthesize_long_audio request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TextToSpeechLongAudioSynthesize REST API. - # - # This class represents the configuration for TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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 - # # synthesize_long_audio to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.synthesize_long_audio.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TextToSpeechLongAudioSynthesize 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 `synthesize_long_audio` - # @return [::Gapic::Config::Method] - # - attr_reader :synthesize_long_audio - - # @private - def initialize parent_rpcs = nil - synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio - @synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb deleted file mode 100644 index 8250012f372b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/operations.rb +++ /dev/null @@ -1,925 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "texttospeech.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TextToSpeechLongAudioSynthesize 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 TextToSpeechLongAudioSynthesize 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @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::TextToSpeech::V1beta1::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? - throw :response, 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::TextToSpeech::V1beta1::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? - throw :response, 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::TextToSpeech::V1beta1::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? - 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::TextToSpeech::V1beta1::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? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "texttospeech.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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: "/v1beta1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v1beta1/{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{^operations(?:/.*)?$}, true] - ] - ) - 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", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb deleted file mode 100644 index bd08eb3a2f11..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest/service_stub.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeechLongAudioSynthesize - module Rest - ## - # REST service stub for the TextToSpeechLongAudioSynthesize service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the synthesize_long_audio REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest] - # 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 synthesize_long_audio request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_synthesize_long_audio_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, - method_name: "synthesize_long_audio", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the synthesize_long_audio REST call - # - # @param request_pb [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_synthesize_long_audio_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta1/{parent}:synthesizeLongAudio", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb deleted file mode 100644 index e867e4eac333..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/text_to_speech/v1beta1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb deleted file mode 100644 index a43e4e7dc031..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/cloud/texttospeech/v1beta1/cloud_tts_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/texttospeech/v1beta1/cloud_tts_lrs.proto\x12!google.cloud.texttospeech.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x31google/cloud/texttospeech/v1beta1/cloud_tts.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa8\x02\n\x1aSynthesizeLongAudioRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x45\n\x05input\x18\x02 \x01(\x0b\x32\x31.google.cloud.texttospeech.v1beta1.SynthesisInputB\x03\xe0\x41\x02\x12I\n\x0c\x61udio_config\x18\x03 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfigB\x03\xe0\x41\x02\x12\x1b\n\x0eoutput_gcs_uri\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12K\n\x05voice\x18\x05 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\"\x1d\n\x1bSynthesizeLongAudioResponse\"\xa4\x01\n\x1bSynthesizeLongAudioMetadata\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x02\x18\x01\x12\x1b\n\x13progress_percentage\x18\x03 \x01(\x01\x32\xb3\x03\n\x1fTextToSpeechLongAudioSynthesize\x12\xbe\x02\n\x13SynthesizeLongAudio\x12=.google.cloud.texttospeech.v1beta1.SynthesizeLongAudioRequest\x1a\x1d.google.longrunning.Operation\"\xc8\x01\xca\x41~\n=google.cloud.texttospeech.v1beta1.SynthesizeLongAudioResponse\x12=google.cloud.texttospeech.v1beta1.SynthesizeLongAudioMetadata\x82\xd3\xe4\x93\x02\x41\"\n\rTimepointType\x12\x1e\n\x1aTIMEPOINT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSSML_MARK\x10\x01\x42\x19\n\x17_advanced_voice_options\"\xa7\x03\n\x19\x43ustomPronunciationParams\x12\x13\n\x06phrase\x18\x01 \x01(\tH\x00\x88\x01\x01\x12m\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32M.google.cloud.texttospeech.v1beta1.CustomPronunciationParams.PhoneticEncodingH\x01\x88\x01\x01\x12\x1a\n\rpronunciation\x18\x03 \x01(\tH\x02\x88\x01\x01\"\xb6\x01\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\x12\'\n#PHONETIC_ENCODING_JAPANESE_YOMIGANA\x10\x03\x12\x1c\n\x18PHONETIC_ENCODING_PINYIN\x10\x04\x42\t\n\x07_phraseB\x14\n\x12_phonetic_encodingB\x10\n\x0e_pronunciation\"l\n\x14\x43ustomPronunciations\x12T\n\x0epronunciations\x18\x01 \x03(\x0b\x32<.google.cloud.texttospeech.v1beta1.CustomPronunciationParams\"\x95\x01\n\x12MultiSpeakerMarkup\x12N\n\x05turns\x18\x01 \x03(\x0b\x32:.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.TurnB\x03\xe0\x41\x02\x1a/\n\x04Turn\x12\x14\n\x07speaker\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x02\"P\n\x19MultispeakerPrebuiltVoice\x12\x1a\n\rspeaker_alias\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nspeaker_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"{\n\x17MultiSpeakerVoiceConfig\x12`\n\x15speaker_voice_configs\x18\x02 \x03(\x0b\x32<.google.cloud.texttospeech.v1beta1.MultispeakerPrebuiltVoiceB\x03\xe0\x41\x02\"\xa6\x02\n\x0eSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12\x0e\n\x04ssml\x18\x02 \x01(\tH\x00\x12U\n\x14multi_speaker_markup\x18\x04 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x12[\n\x15\x63ustom_pronunciations\x18\x03 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.CustomPronunciationsB\x03\xe0\x41\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\xa2\x03\n\x14VoiceSelectionParams\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0c\n\x04name\x18\x02 \x01(\t\x12G\n\x0bssml_gender\x18\x03 \x01(\x0e\x32\x32.google.cloud.texttospeech.v1beta1.SsmlVoiceGender\x12J\n\x0c\x63ustom_voice\x18\x04 \x01(\x0b\x32\x34.google.cloud.texttospeech.v1beta1.CustomVoiceParams\x12M\n\x0bvoice_clone\x18\x05 \x01(\x0b\x32\x33.google.cloud.texttospeech.v1beta1.VoiceCloneParamsB\x03\xe0\x41\x01\x12\x17\n\nmodel_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x63\n\x1amulti_speaker_voice_config\x18\x07 \x01(\x0b\x32:.google.cloud.texttospeech.v1beta1.MultiSpeakerVoiceConfigB\x03\xe0\x41\x01\"\xf6\x01\n\x0b\x41udioConfig\x12M\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x30.google.cloud.texttospeech.v1beta1.AudioEncodingB\x03\xe0\x41\x02\x12\x1d\n\rspeaking_rate\x18\x02 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x15\n\x05pitch\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x0evolume_gain_db\x18\x04 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\x12\x1e\n\x11sample_rate_hertz\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\"\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x06 \x03(\tB\x06\xe0\x41\x04\xe0\x41\x01\"\xf6\x01\n\x11\x43ustomVoiceParams\x12\x32\n\x05model\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61utoml.googleapis.com/Model\x12\x61\n\x0ereported_usage\x18\x03 \x01(\x0e\x32\x42.google.cloud.texttospeech.v1beta1.CustomVoiceParams.ReportedUsageB\x05\x18\x01\xe0\x41\x01\"J\n\rReportedUsage\x12\x1e\n\x1aREPORTED_USAGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08REALTIME\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\"2\n\x10VoiceCloneParams\x12\x1e\n\x11voice_cloning_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xb9\x01\n\x18SynthesizeSpeechResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c\x12@\n\ntimepoints\x18\x02 \x03(\x0b\x32,.google.cloud.texttospeech.v1beta1.Timepoint\x12\x44\n\x0c\x61udio_config\x18\x04 \x01(\x0b\x32..google.cloud.texttospeech.v1beta1.AudioConfig\"4\n\tTimepoint\x12\x11\n\tmark_name\x18\x04 \x01(\t\x12\x14\n\x0ctime_seconds\x18\x03 \x01(\x01\"\xa4\x01\n\x14StreamingAudioConfig\x12M\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32\x30.google.cloud.texttospeech.v1beta1.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\rspeaking_rate\x18\x03 \x01(\x01\x42\x06\xe0\x41\x04\xe0\x41\x01\"\xa3\x02\n\x19StreamingSynthesizeConfig\x12K\n\x05voice\x18\x01 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.VoiceSelectionParamsB\x03\xe0\x41\x02\x12\\\n\x16streaming_audio_config\x18\x04 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.StreamingAudioConfigB\x03\xe0\x41\x01\x12[\n\x15\x63ustom_pronunciations\x18\x05 \x01(\x0b\x32\x37.google.cloud.texttospeech.v1beta1.CustomPronunciationsB\x03\xe0\x41\x01\"\xc2\x01\n\x17StreamingSynthesisInput\x12\x0e\n\x04text\x18\x01 \x01(\tH\x00\x12\x10\n\x06markup\x18\x05 \x01(\tH\x00\x12U\n\x14multi_speaker_markup\x18\x07 \x01(\x0b\x32\x35.google.cloud.texttospeech.v1beta1.MultiSpeakerMarkupH\x00\x12\x13\n\x06prompt\x18\x06 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0cinput_sourceB\t\n\x07_prompt\"\xd8\x01\n\x1aStreamingSynthesizeRequest\x12X\n\x10streaming_config\x18\x01 \x01(\x0b\x32<.google.cloud.texttospeech.v1beta1.StreamingSynthesizeConfigH\x00\x12K\n\x05input\x18\x02 \x01(\x0b\x32:.google.cloud.texttospeech.v1beta1.StreamingSynthesisInputH\x00\x42\x13\n\x11streaming_request\"4\n\x1bStreamingSynthesizeResponse\x12\x15\n\raudio_content\x18\x01 \x01(\x0c*W\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x08\n\x04MALE\x10\x01\x12\n\n\x06\x46\x45MALE\x10\x02\x12\x0b\n\x07NEUTRAL\x10\x03*\x8c\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x07\n\x03MP3\x10\x02\x12\x0f\n\x0bMP3_64_KBPS\x10\x04\x12\x0c\n\x08OGG_OPUS\x10\x03\x12\t\n\x05MULAW\x10\x05\x12\x08\n\x04\x41LAW\x10\x06\x12\x07\n\x03PCM\x10\x07\x12\x07\n\x03M4A\x10\x08\x32\xef\x04\n\x0cTextToSpeech\x12\xa2\x01\n\nListVoices\x12\x34.google.cloud.texttospeech.v1beta1.ListVoicesRequest\x1a\x35.google.cloud.texttospeech.v1beta1.ListVoicesResponse\"\'\xda\x41\rlanguage_code\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1beta1/voices\x12\xcb\x01\n\x10SynthesizeSpeech\x12:.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest\x1a;.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse\">\xda\x41\x18input,voice,audio_config\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/text:synthesize:\x01*\x12\x9a\x01\n\x13StreamingSynthesize\x12=.google.cloud.texttospeech.v1beta1.StreamingSynthesizeRequest\x1a>.google.cloud.texttospeech.v1beta1.StreamingSynthesizeResponse\"\x00(\x01\x30\x01\x1aO\xca\x41\x1btexttospeech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd5\x02\n%com.google.cloud.texttospeech.v1beta1B\x11TextToSpeechProtoP\x01ZIcloud.google.com/go/texttospeech/apiv1beta1/texttospeechpb;texttospeechpb\xa2\x02\x04\x43TTS\xaa\x02!Google.Cloud.TextToSpeech.V1Beta1\xca\x02!Google\\Cloud\\TextToSpeech\\V1beta1\xea\x02$Google::Cloud::TextToSpeech::V1beta1\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}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 = [ - ] - 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 TextToSpeech - module V1beta1 - ListVoicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.ListVoicesRequest").msgclass - ListVoicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.ListVoicesResponse").msgclass - Voice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.Voice").msgclass - AdvancedVoiceOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AdvancedVoiceOptions").msgclass - SynthesizeSpeechRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest").msgclass - SynthesizeSpeechRequest::TimepointType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest.TimepointType").enummodule - CustomPronunciationParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomPronunciationParams").msgclass - CustomPronunciationParams::PhoneticEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomPronunciationParams.PhoneticEncoding").enummodule - CustomPronunciations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomPronunciations").msgclass - MultiSpeakerMarkup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup").msgclass - MultiSpeakerMarkup::Turn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultiSpeakerMarkup.Turn").msgclass - MultispeakerPrebuiltVoice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultispeakerPrebuiltVoice").msgclass - MultiSpeakerVoiceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.MultiSpeakerVoiceConfig").msgclass - SynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesisInput").msgclass - VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.VoiceSelectionParams").msgclass - AudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AudioConfig").msgclass - CustomVoiceParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomVoiceParams").msgclass - CustomVoiceParams::ReportedUsage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.CustomVoiceParams.ReportedUsage").enummodule - VoiceCloneParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.VoiceCloneParams").msgclass - SynthesizeSpeechResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse").msgclass - Timepoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.Timepoint").msgclass - StreamingAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingAudioConfig").msgclass - StreamingSynthesizeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesizeConfig").msgclass - StreamingSynthesisInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesisInput").msgclass - StreamingSynthesizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesizeRequest").msgclass - StreamingSynthesizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.StreamingSynthesizeResponse").msgclass - SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.SsmlVoiceGender").enummodule - AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.texttospeech.v1beta1.AudioEncoding").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb deleted file mode 100644 index cd9155f58667..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/texttospeech/v1beta1/cloud_tts.proto for package 'Google.Cloud.TextToSpeech.V1beta1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/texttospeech/v1beta1/cloud_tts_pb' - -module Google - module Cloud - module TextToSpeech - module V1beta1 - module TextToSpeech - # Service that implements Google Cloud Text-to-Speech API. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.texttospeech.v1beta1.TextToSpeech' - - # Returns a list of Voice supported for synthesis. - rpc :ListVoices, ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse - # Synthesizes speech synchronously: receive results after all text input - # has been processed. - rpc :SynthesizeSpeech, ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse - # Performs bidirectional streaming speech synthesis: receives audio while - # sending text. - rpc :StreamingSynthesize, stream(::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest), stream(::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse) - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md deleted file mode 100644 index 86ce92848b79..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Text-to-Speech V1beta1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb deleted file mode 100644 index 030e04028192..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb +++ /dev/null @@ -1,618 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - # The top-level message sent by the client for the `ListVoices` method. - # @!attribute [rw] language_code - # @return [::String] - # Optional. Recommended. - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - # If not specified, the API will return all supported voices. - # If specified, the ListVoices call will only return voices that can be used - # to synthesize this language_code. For example, if you specify `"en-NZ"`, - # all `"en-NZ"` voices will be returned. If you specify `"no"`, both - # `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be - # returned. - class ListVoicesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message returned to the client by the `ListVoices` method. - # @!attribute [rw] voices - # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::Voice>] - # The list of voices. - class ListVoicesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of a voice supported by the TTS service. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # The languages that this voice supports, expressed as - # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - # "en-US", "es-419", "cmn-tw"). - # @!attribute [rw] name - # @return [::String] - # The name of this voice. Each distinct voice has a unique name. - # @!attribute [rw] ssml_gender - # @return [::Google::Cloud::TextToSpeech::V1beta1::SsmlVoiceGender] - # The gender of this voice. - # @!attribute [rw] natural_sample_rate_hertz - # @return [::Integer] - # The natural sample rate (in hertz) for this voice. - class Voice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Used for advanced voice options. - # @!attribute [rw] low_latency_journey_synthesis - # @return [::Boolean] - # Only for Journey voices. If false, the synthesis is context aware - # and has a higher latency. - # @!attribute [rw] relax_safety_filters - # @return [::Boolean] - # Optional. Input only. If true, relaxes safety filters for Gemini TTS. Only - # supported for accounts linked to Invoiced (Offline) Cloud billing accounts. - # Otherwise, will return result - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - class AdvancedVoiceOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client for the `SynthesizeSpeech` method. - # @!attribute [rw] input - # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput] - # Required. The Synthesizer requires either plain text or SSML as input. - # @!attribute [rw] voice - # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams] - # Required. The desired voice of the synthesized audio. - # @!attribute [rw] audio_config - # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig] - # Required. The configuration of the synthesized audio. - # @!attribute [rw] enable_time_pointing - # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest::TimepointType>] - # Whether and what timepoints are returned in the response. - # @!attribute [rw] advanced_voice_options - # @return [::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions] - # Advanced voice options. - class SynthesizeSpeechRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of timepoint information that is returned in the response. - module TimepointType - # Not specified. No timepoint information will be returned. - TIMEPOINT_TYPE_UNSPECIFIED = 0 - - # Timepoint information of `` tags in SSML input will be returned. - SSML_MARK = 1 - end - end - - # Pronunciation customization for a phrase. - # @!attribute [rw] phrase - # @return [::String] - # The phrase to which the customization is applied. - # The phrase can be multiple words, such as proper nouns, but shouldn't span - # the length of the sentence. - # @!attribute [rw] phonetic_encoding - # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciationParams::PhoneticEncoding] - # The phonetic encoding of the phrase. - # @!attribute [rw] pronunciation - # @return [::String] - # The pronunciation of the phrase. This must be in the phonetic encoding - # specified above. - class CustomPronunciationParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The phonetic encoding of the phrase. - module PhoneticEncoding - # Not specified. - PHONETIC_ENCODING_UNSPECIFIED = 0 - - # IPA, such as apple -> ˈæpəl. - # https://en.wikipedia.org/wiki/International_Phonetic_Alphabet - PHONETIC_ENCODING_IPA = 1 - - # X-SAMPA, such as apple -> "{p@l". - # https://en.wikipedia.org/wiki/X-SAMPA - PHONETIC_ENCODING_X_SAMPA = 2 - - # For reading-to-pron conversion to work well, the `pronunciation` field - # should only contain Kanji, Hiragana, and Katakana. - # - # The pronunciation can also contain pitch accents. - # The start of a pitch phrase is specified with `^` and the down-pitch - # position is specified with `!`, for example: - # - # phrase:端 pronunciation:^はし - # phrase:箸 pronunciation:^は!し - # phrase:橋 pronunciation:^はし! - # - # We currently only support the Tokyo dialect, which allows at most one - # down-pitch per phrase (i.e. at most one `!` between `^`). - PHONETIC_ENCODING_JAPANESE_YOMIGANA = 3 - - # Used to specify pronunciations for Mandarin words. See - # https://en.wikipedia.org/wiki/Pinyin. - # - # For example: 朝阳, the pronunciation is "chao2 yang2". The number - # represents the tone, and there is a space between syllables. Neutral - # tones are represented by 5, for example 孩子 "hai2 zi5". - PHONETIC_ENCODING_PINYIN = 4 - end - end - - # A collection of pronunciation customizations. - # @!attribute [rw] pronunciations - # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciationParams>] - # The pronunciation customizations are applied. - class CustomPronunciations - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of turns for multi-speaker synthesis. - # @!attribute [rw] turns - # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerMarkup::Turn>] - # Required. Speaker turns. - class MultiSpeakerMarkup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A multi-speaker turn. - # @!attribute [rw] speaker - # @return [::String] - # Required. The speaker of the turn, for example, 'O' or 'Q'. Please refer - # to documentation for available speakers. - # @!attribute [rw] text - # @return [::String] - # Required. The text to speak. - class Turn - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Configuration for a single speaker in a Gemini TTS multi-speaker setup. - # Enables dialogue between two speakers. - # @!attribute [rw] speaker_alias - # @return [::String] - # Required. The speaker alias of the voice. This is the user-chosen speaker - # name that is used in the multispeaker text input, such as "Speaker1". - # @!attribute [rw] speaker_id - # @return [::String] - # Required. The speaker ID of the voice. See - # https://cloud.google.com/text-to-speech/docs/gemini-tts#voice_options - # for available values. - class MultispeakerPrebuiltVoice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for a multi-speaker text-to-speech setup. Enables the use of up - # to two distinct voices in a single synthesis request. - # @!attribute [rw] speaker_voice_configs - # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::MultispeakerPrebuiltVoice>] - # Required. A list of configurations for the voices of the speakers. Exactly - # two speaker voice configurations must be provided. - class MultiSpeakerVoiceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains text input to be synthesized. Either `text` or `ssml` must be - # supplied. Supplying both or neither returns - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. The - # input size is limited to 5000 bytes. - # @!attribute [rw] text - # @return [::String] - # The raw text to be synthesized. - # - # Note: The following fields are mutually exclusive: `text`, `markup`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] markup - # @return [::String] - # Markup for HD voices specifically. This field may not be used with any - # other voices. - # - # Note: The following fields are mutually exclusive: `markup`, `text`, `ssml`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ssml - # @return [::String] - # The SSML document to be synthesized. The SSML document must be valid - # and well-formed. Otherwise the RPC will fail and return - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. For - # more information, see - # [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - # - # Note: The following fields are mutually exclusive: `ssml`, `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] multi_speaker_markup - # @return [::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerMarkup] - # The multi-speaker input to be synthesized. Only applicable for - # multi-speaker synthesis. - # - # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`, `ssml`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] prompt - # @return [::String] - # This system instruction is supported only for controllable/promptable voice - # models. If this system instruction is used, we pass the unedited text to - # Gemini-TTS. Otherwise, a default system instruction is used. AI Studio - # calls this system instruction, Style Instructions. - # @!attribute [rw] custom_pronunciations - # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciations] - # Optional. The pronunciation customizations are applied to the input. If - # this is set, the input is synthesized using the given pronunciation - # customizations. - # - # The initial support is for en-us, with plans to expand to other locales in - # the future. Instant Clone voices aren't supported. - # - # In order to customize the pronunciation of a phrase, there must be an exact - # match of the phrase in the input types. If using SSML, the phrase must not - # be inside a phoneme tag. - class SynthesisInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of which voice to use for a synthesis request. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language (and potentially also the region) of the voice - # expressed as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag, e.g. "en-US". This should not include a script tag (e.g. use - # "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - # from the input provided in the SynthesisInput. The TTS service - # will use this parameter to help choose an appropriate voice. Note that - # the TTS service may choose a voice with a slightly different language code - # than the one selected; it may substitute a different region - # (e.g. using en-US rather than en-CA if there isn't a Canadian voice - # available), or even a different language, e.g. using "nb" (Norwegian - # Bokmal) instead of "no" (Norwegian)". - # @!attribute [rw] name - # @return [::String] - # The name of the voice. If both the name and the gender are not set, - # the service will choose a voice based on the other parameters such as - # language_code. - # @!attribute [rw] ssml_gender - # @return [::Google::Cloud::TextToSpeech::V1beta1::SsmlVoiceGender] - # The preferred gender of the voice. If not set, the service will - # choose a voice based on the other parameters such as language_code and - # name. Note that this is only a preference, not requirement; if a - # voice of the appropriate gender is not available, the synthesizer should - # substitute a voice with a different gender rather than failing the request. - # @!attribute [rw] custom_voice - # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomVoiceParams] - # The configuration for a custom voice. If [CustomVoiceParams.model] is set, - # the service will choose the custom voice matching the specified - # configuration. - # @!attribute [rw] voice_clone - # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceCloneParams] - # Optional. The configuration for a voice clone. If - # [VoiceCloneParams.voice_clone_key] is set, the service chooses the voice - # clone matching the specified configuration. - # @!attribute [rw] model_name - # @return [::String] - # Optional. The name of the model. If set, the service will choose the model - # matching the specified configuration. - # @!attribute [rw] multi_speaker_voice_config - # @return [::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerVoiceConfig] - # Optional. The configuration for a Gemini multi-speaker text-to-speech - # setup. Enables the use of two distinct voices in a single synthesis - # request. - class VoiceSelectionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of audio data to be synthesized. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioEncoding] - # Required. The format of the audio byte stream. - # @!attribute [rw] speaking_rate - # @return [::Float] - # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - # the normal native speed supported by the specific voice. 2.0 is twice as - # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - # speed. Any other values < 0.25 or > 2.0 will return an error. - # @!attribute [rw] pitch - # @return [::Float] - # Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - # increase 20 semitones from the original pitch. -20 means decrease 20 - # semitones from the original pitch. - # @!attribute [rw] volume_gain_db - # @return [::Float] - # Optional. Input only. Volume gain (in dB) of the normal native volume - # supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - # set to a value of 0.0 (dB), will play at normal native signal amplitude. A - # value of -6.0 (dB) will play at approximately half the amplitude of the - # normal native signal amplitude. A value of +6.0 (dB) will play at - # approximately twice the amplitude of the normal native signal amplitude. - # Strongly recommend not to exceed +10 (dB) as there's usually no effective - # increase in loudness for any value greater than that. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Optional. The synthesis sample rate (in hertz) for this audio. When this is - # specified in SynthesizeSpeechRequest, if this is different from the voice's - # natural sample rate, then the synthesizer will honor this request by - # converting to the desired sample rate (which might result in worse audio - # quality), unless the specified sample rate is not supported for the - # encoding chosen, in which case it will fail the request and return - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - # @!attribute [rw] effects_profile_id - # @return [::Array<::String>] - # Optional. Input only. An identifier which selects 'audio effects' profiles - # that are applied on (post synthesized) text to speech. Effects are applied - # on top of each other in the order they are given. See - # [audio - # profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - # current supported profile ids. - class AudioConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of the custom voice to be synthesized. - # @!attribute [rw] model - # @return [::String] - # Required. The name of the AutoML model that synthesizes the custom voice. - # @!attribute [rw] reported_usage - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomVoiceParams::ReportedUsage] - # Optional. Deprecated. The usage of the synthesized audio to be reported. - class CustomVoiceParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Deprecated. The usage of the synthesized audio. Usage does not affect - # billing. - module ReportedUsage - # Request with reported usage unspecified will be rejected. - REPORTED_USAGE_UNSPECIFIED = 0 - - # For scenarios where the synthesized audio is not downloadable and can - # only be used once. For example, real-time request in IVR system. - REALTIME = 1 - - # For scenarios where the synthesized audio is downloadable and can be - # reused. For example, the synthesized audio is downloaded, stored in - # customer service system and played repeatedly. - OFFLINE = 2 - end - end - - # The configuration of Voice Clone feature. - # @!attribute [rw] voice_cloning_key - # @return [::String] - # Required. Created by GenerateVoiceCloningKey. - class VoiceCloneParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message returned to the client by the `SynthesizeSpeech` method. - # @!attribute [rw] audio_content - # @return [::String] - # The audio data bytes encoded as specified in the request, including the - # header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - # For LINEAR16 audio, we include the WAV header. Note: as - # with all bytes fields, protobuffers use a pure binary representation, - # whereas JSON representations use base64. - # @!attribute [rw] timepoints - # @return [::Array<::Google::Cloud::TextToSpeech::V1beta1::Timepoint>] - # A link between a position in the original request input and a corresponding - # time in the output audio. It's only supported via `` of SSML input. - # @!attribute [rw] audio_config - # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig] - # The audio metadata of `audio_content`. - class SynthesizeSpeechResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This contains a mapping between a certain point in the input text and a - # corresponding time in the output audio. - # @!attribute [rw] mark_name - # @return [::String] - # Timepoint name as received from the client within `` tag. - # @!attribute [rw] time_seconds - # @return [::Float] - # Time offset in seconds from the start of the synthesized audio. - class Timepoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of the desired output audio data. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioEncoding] - # Required. The format of the audio byte stream. - # Streaming supports PCM, ALAW, MULAW and OGG_OPUS. All other encodings - # return an error. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Optional. The synthesis sample rate (in hertz) for this audio. - # @!attribute [rw] speaking_rate - # @return [::Float] - # Optional. Input only. Speaking rate/speed, in the range [0.25, 2.0]. 1.0 is - # the normal native speed supported by the specific voice. 2.0 is twice as - # fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - # speed. Any other values < 0.25 or > 2.0 will return an error. - class StreamingAudioConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides configuration information for the StreamingSynthesize request. - # @!attribute [rw] voice - # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams] - # Required. The desired voice of the synthesized audio. - # @!attribute [rw] streaming_audio_config - # @return [::Google::Cloud::TextToSpeech::V1beta1::StreamingAudioConfig] - # Optional. The configuration of the synthesized audio. - # @!attribute [rw] custom_pronunciations - # @return [::Google::Cloud::TextToSpeech::V1beta1::CustomPronunciations] - # Optional. The pronunciation customizations are applied to the input. If - # this is set, the input is synthesized using the given pronunciation - # customizations. - # - # The initial support is for en-us, with plans to expand to other locales in - # the future. Instant Clone voices aren't supported. - # - # In order to customize the pronunciation of a phrase, there must be an exact - # match of the phrase in the input types. If using SSML, the phrase must not - # be inside a phoneme tag. - class StreamingSynthesizeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input to be synthesized. - # @!attribute [rw] text - # @return [::String] - # The raw text to be synthesized. It is recommended that each input - # contains complete, terminating sentences, which results in better prosody - # in the output audio. - # - # Note: The following fields are mutually exclusive: `text`, `markup`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] markup - # @return [::String] - # Markup for HD voices specifically. This field may not be used with any - # other voices. - # - # Note: The following fields are mutually exclusive: `markup`, `text`, `multi_speaker_markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] multi_speaker_markup - # @return [::Google::Cloud::TextToSpeech::V1beta1::MultiSpeakerMarkup] - # Multi-speaker markup for Gemini TTS. This field may not - # be used with any other voices. - # - # Note: The following fields are mutually exclusive: `multi_speaker_markup`, `text`, `markup`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] prompt - # @return [::String] - # This is system instruction supported only for controllable voice models. - class StreamingSynthesisInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `StreamingSynthesize` method. Multiple - # `StreamingSynthesizeRequest` messages are sent in one call. - # The first message must contain a `streaming_config` that - # fully specifies the request configuration and must not contain `input`. All - # subsequent messages must only have `input` set. - # @!attribute [rw] streaming_config - # @return [::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeConfig] - # StreamingSynthesizeConfig to be used in this streaming attempt. Only - # specified in the first message sent in a `StreamingSynthesize` call. - # - # Note: The following fields are mutually exclusive: `streaming_config`, `input`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] input - # @return [::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesisInput] - # Input to synthesize. Specified in all messages but the first in a - # `StreamingSynthesize` call. - # - # Note: The following fields are mutually exclusive: `input`, `streaming_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class StreamingSynthesizeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `StreamingSynthesizeResponse` is the only message returned to the - # client by `StreamingSynthesize` method. A series of zero or more - # `StreamingSynthesizeResponse` messages are streamed back to the client. - # @!attribute [rw] audio_content - # @return [::String] - # The audio data bytes encoded as specified in the request. This is - # headerless LINEAR16 audio with a sample rate of 24000. - class StreamingSynthesizeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Gender of the voice as described in - # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). - module SsmlVoiceGender - # An unspecified gender. - # In VoiceSelectionParams, this means that the client doesn't care which - # gender the selected voice will have. In the Voice field of - # ListVoicesResponse, this may mean that the voice doesn't fit any of the - # other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0 - - # A male voice. - MALE = 1 - - # A female voice. - FEMALE = 2 - - # A gender-neutral voice. This voice is not yet supported. - NEUTRAL = 3 - end - - # Configuration to set up audio encoder. The encoding determines the output - # audio format that we'd like. - module AudioEncoding - # Not specified. Only used by GenerateVoiceCloningKey. Otherwise, will return - # result - # [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. - AUDIO_ENCODING_UNSPECIFIED = 0 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - # Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1 - - # MP3 audio at 32kbps. - MP3 = 2 - - # MP3 at 64kbps. - MP3_64_KBPS = 4 - - # Opus encoded audio wrapped in an ogg container. The result is a - # file which can be played natively on Android, and in browsers (at least - # Chrome and Firefox). The quality of the encoding is considerably higher - # than MP3 while using approximately the same bitrate. - OGG_OPUS = 3 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - # Audio content returned as MULAW also contains a WAV header. - MULAW = 5 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. - # Audio content returned as ALAW also contains a WAV header. - ALAW = 6 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - # Note that as opposed to LINEAR16, audio won't be wrapped in a WAV (or - # any other) header. - PCM = 7 - - # M4A audio. - M4A = 8 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb deleted file mode 100644 index c155bf275945..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - module V1beta1 - # The top-level message sent by the client for the - # `SynthesizeLongAudio` method. - # @!attribute [rw] parent - # @return [::String] - # The resource states of the request in the form of - # `projects/*/locations/*`. - # @!attribute [rw] input - # @return [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput] - # Required. The Synthesizer requires either plain text or SSML as input. - # @!attribute [rw] audio_config - # @return [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig] - # Required. The configuration of the synthesized audio. - # @!attribute [rw] output_gcs_uri - # @return [::String] - # Required. Specifies a Cloud Storage URI for the synthesis results. Must be - # specified in the format: `gs://bucket_name/object_name`, and the bucket - # must already exist. - # @!attribute [rw] voice - # @return [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams] - # Required. The desired voice of the synthesized audio. - class SynthesizeLongAudioRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message returned to the client by the `SynthesizeLongAudio` method. - class SynthesizeLongAudioResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for response returned by the `SynthesizeLongAudio` method. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Time when the request was received. - # @!attribute [rw] last_update_time - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Protobuf::Timestamp] - # Deprecated. Do not use. - # @!attribute [rw] progress_percentage - # @return [::Float] - # The progress of the most recent processing update in percentage, ie. 70.0%. - class SynthesizeLongAudioMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile deleted file mode 100644 index d5f0f822f878..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech-v1beta1", path: "../" -else - gem "google-cloud-text_to_speech-v1beta1" -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-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json deleted file mode 100644 index 37611738d746..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-text_to_speech-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.texttospeech.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync", - "title": "Snippet for the list_voices call in the TextToSpeech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices.", - "file": "text_to_speech/list_voices.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_voices", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse", - "client": { - "short_name": "TextToSpeech::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client" - }, - "method": { - "short_name": "ListVoices", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech.ListVoices", - "service": { - "short_name": "TextToSpeech", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync", - "title": "Snippet for the synthesize_speech call in the TextToSpeech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#synthesize_speech.", - "file": "text_to_speech/synthesize_speech.rb", - "language": "RUBY", - "client_method": { - "short_name": "synthesize_speech", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#synthesize_speech", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse", - "client": { - "short_name": "TextToSpeech::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client" - }, - "method": { - "short_name": "SynthesizeSpeech", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech.SynthesizeSpeech", - "service": { - "short_name": "TextToSpeech", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "texttospeech_v1beta1_generated_TextToSpeech_StreamingSynthesize_sync", - "title": "Snippet for the streaming_synthesize call in the TextToSpeech service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#streaming_synthesize.", - "file": "text_to_speech/streaming_synthesize.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_synthesize", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#streaming_synthesize", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse", - "client": { - "short_name": "TextToSpeech::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client" - }, - "method": { - "short_name": "StreamingSynthesize", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech.StreamingSynthesize", - "service": { - "short_name": "TextToSpeech", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeech" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync", - "title": "Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio.", - "file": "text_to_speech_long_audio_synthesize/synthesize_long_audio.rb", - "language": "RUBY", - "client_method": { - "short_name": "synthesize_long_audio", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TextToSpeechLongAudioSynthesize::Client", - "full_name": "::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client" - }, - "method": { - "short_name": "SynthesizeLongAudio", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeechLongAudioSynthesize.SynthesizeLongAudio", - "service": { - "short_name": "TextToSpeechLongAudioSynthesize", - "full_name": "google.cloud.texttospeech.v1beta1.TextToSpeechLongAudioSynthesize" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb deleted file mode 100644 index 72a6f7d574e4..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync] -require "google/cloud/text_to_speech/v1beta1" - -## -# Snippet for the list_voices call in the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices. -# -def list_voices - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new - - # Call the list_voices method. - result = client.list_voices request - - # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. - p result -end -# [END texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb deleted file mode 100644 index 69970b81486e..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/streaming_synthesize.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeech_StreamingSynthesize_sync] -require "google/cloud/text_to_speech/v1beta1" - -## -# Snippet for the streaming_synthesize call in the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::Client#streaming_synthesize. -# -def streaming_synthesize - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_synthesize method to start streaming. - output = client.streaming_synthesize input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new - input << Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse - output.each do |current_response| - p current_response - end -end -# [END texttospeech_v1beta1_generated_TextToSpeech_StreamingSynthesize_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb deleted file mode 100644 index 9ec83074902f..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync] -require "google/cloud/text_to_speech/v1beta1" - -## -# Snippet for the synthesize_speech call in the TextToSpeech 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::TextToSpeech::V1beta1::TextToSpeech::Client#synthesize_speech. -# -def synthesize_speech - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new - - # Call the synthesize_speech method. - result = client.synthesize_speech request - - # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. - p result -end -# [END texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb deleted file mode 100644 index ea7685188b99..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech_long_audio_synthesize/synthesize_long_audio.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] -require "google/cloud/text_to_speech/v1beta1" - -## -# Snippet for the synthesize_long_audio call in the TextToSpeechLongAudioSynthesize 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client#synthesize_long_audio. -# -def synthesize_long_audio - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new - - # Call the synthesize_long_audio method. - result = client.synthesize_long_audio 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 texttospeech_v1beta1_generated_TextToSpeechLongAudioSynthesize_SynthesizeLongAudio_sync] diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb deleted file mode 100644 index 9f679ded2226..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" -require "google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb deleted file mode 100644 index 434f49ebc8f3..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", model: "value2" - assert_equal "projects/value0/locations/value1/models/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb deleted file mode 100644 index 8cc355c8b862..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_rest_test.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/rest" - - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_synthesize_long_audio - # 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" - input = {} - audio_config = {} - output_gcs_uri = "hello world" - voice = {} - - synthesize_long_audio_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::ServiceStub.stub :transcode_synthesize_long_audio_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, synthesize_long_audio_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, synthesize_long_audio_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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb deleted file mode 100644 index 5671468e58a9..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize_test.rb +++ /dev/null @@ -1,189 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_lrs_pb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize" - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_synthesize_long_audio - # 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" - input = {} - audio_config = {} - output_gcs_uri = "hello world" - voice = {} - - synthesize_long_audio_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :synthesize_long_audio, name - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput), request["input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::AudioConfig), request["audio_config"] - assert_equal "hello world", request["output_gcs_uri"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams), request["voice"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, synthesize_long_audio_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }) 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.synthesize_long_audio parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice 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.synthesize_long_audio ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice) 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.synthesize_long_audio({ parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice }, 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.synthesize_long_audio(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new(parent: parent, input: input, audio_config: audio_config, output_gcs_uri: output_gcs_uri, voice: voice), 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, synthesize_long_audio_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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client, client - assert_equal creds, client.configure.credentials - end - 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::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb deleted file mode 100644 index 0dd55bde46da..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_paths_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech/v1beta1/text_to_speech" - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", model: "value2" - assert_equal "projects/value0/locations/value1/models/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb deleted file mode 100644 index acb908987e5e..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_rest_test.rb +++ /dev/null @@ -1,211 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech/rest" - - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_voices - # Create test objects. - client_result = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - language_code = "hello world" - - list_voices_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TextToSpeech::V1beta1::TextToSpeech::Rest::ServiceStub.stub :transcode_list_voices_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_voices_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_voices({ language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_voices language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_voices ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_voices({ language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_voices(::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_voices_client_stub.call_count - end - end - end - - def test_synthesize_speech - # Create test objects. - client_result = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - input = {} - voice = {} - audio_config = {} - enable_time_pointing = [:TIMEPOINT_TYPE_UNSPECIFIED] - advanced_voice_options = {} - - synthesize_speech_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::TextToSpeech::V1beta1::TextToSpeech::Rest::ServiceStub.stub :transcode_synthesize_speech_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, synthesize_speech_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.synthesize_speech input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.synthesize_speech ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.synthesize_speech(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, synthesize_speech_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::TextToSpeech::V1beta1::TextToSpeech::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::TextToSpeech::V1beta1::TextToSpeech::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb deleted file mode 100644 index b789760fe045..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/google/cloud/text_to_speech/v1beta1/text_to_speech_test.rb +++ /dev/null @@ -1,318 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/texttospeech/v1beta1/cloud_tts_pb" -require "google/cloud/text_to_speech/v1beta1/text_to_speech" - -class ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_voices - # Create GRPC objects. - grpc_response = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse.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. - language_code = "hello world" - - list_voices_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_voices, name - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest, request - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_voices_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_voices({ language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_voices language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_voices ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_voices({ language_code: language_code }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_voices(::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new(language_code: language_code), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_voices_client_stub.call_rpc_count - end - end - - def test_synthesize_speech - # Create GRPC objects. - grpc_response = ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse.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. - input = {} - voice = {} - audio_config = {} - enable_time_pointing = [:TIMEPOINT_TYPE_UNSPECIFIED] - advanced_voice_options = {} - - synthesize_speech_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :synthesize_speech, name - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput), request["input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams), request["voice"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::AudioConfig), request["audio_config"] - assert_equal [:TIMEPOINT_TYPE_UNSPECIFIED], request["enable_time_pointing"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::AdvancedVoiceOptions), request["advanced_voice_options"] - assert request.has_advanced_voice_options? - refute_nil options - end - - Gapic::ServiceStub.stub :new, synthesize_speech_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.synthesize_speech input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.synthesize_speech ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.synthesize_speech({ input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.synthesize_speech(::Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new(input: input, voice: voice, audio_config: audio_config, enable_time_pointing: enable_time_pointing, advanced_voice_options: advanced_voice_options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, synthesize_speech_client_stub.call_rpc_count - end - end - - def test_streaming_synthesize - # Create GRPC objects. - grpc_response = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse.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 bidi streaming method. - streaming_config = {} - - streaming_synthesize_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_synthesize, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_synthesize_client_stub do - # Create client - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_synthesize enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_synthesize stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config - enum_input = [request_hash, request_proto].to_enum - client.streaming_synthesize enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { streaming_config: streaming_config } - request_proto = ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest.new streaming_config: streaming_config - stream_input = Gapic::StreamInput.new - client.streaming_synthesize stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, streaming_synthesize_client_stub.call_rpc_count - streaming_synthesize_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::TextToSpeech::V1beta1::StreamingSynthesizeConfig), r["streaming_config"] - assert_equal :streaming_config, r.streaming_request - end - end - 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::TextToSpeech::V1beta1::TextToSpeech::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::TextToSpeech::V1beta1::TextToSpeech::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech-v1beta1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-text_to_speech/.gitignore b/owl-bot-staging/google-cloud-text_to_speech/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/.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-text_to_speech/.repo-metadata.json b/owl-bot-staging/google-cloud-text_to_speech/.repo-metadata.json deleted file mode 100644 index abbe64afe0b2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "texttospeech.googleapis.com", - "api_shortname": "texttospeech", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech/latest", - "distribution_name": "google-cloud-text_to_speech", - "is_cloud": true, - "language": "ruby", - "name": "texttospeech", - "name_pretty": "Cloud Text-to-Speech API", - "product_documentation": "https://cloud.google.com/text-to-speech", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech.", - "ruby-cloud-env-prefix": "TEXTTOSPEECH", - "ruby-cloud-product-url": "https://cloud.google.com/text-to-speech", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml b/owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml deleted file mode 100644 index cafff93bab73..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-text_to_speech.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-text_to_speech.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-text_to_speech/.toys.rb b/owl-bot-staging/google-cloud-text_to_speech/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-text_to_speech/.yardopts b/owl-bot-staging/google-cloud-text_to_speech/.yardopts deleted file mode 100644 index 242e929248cf..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Cloud Text-to-Speech API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md b/owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md deleted file mode 100644 index 3ad04e2be21e..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-text_to_speech 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-text_to_speech 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/text_to_speech" - -client = Google::Cloud::TextToSpeech.text_to_speech do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/text_to_speech" - -Google::Cloud::TextToSpeech.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::TextToSpeech.text_to_speech -``` - -### 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-text_to_speech -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/text_to_speech" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::TextToSpeech.text_to_speech -``` - -### 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-text_to_speech/CHANGELOG.md b/owl-bot-staging/google-cloud-text_to_speech/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-text_to_speech/Gemfile b/owl-bot-staging/google-cloud-text_to_speech/Gemfile deleted file mode 100644 index a053f1c8c52b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-text_to_speech-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-text_to_speech.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.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-text_to_speech/LICENSE.md b/owl-bot-staging/google-cloud-text_to_speech/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/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-text_to_speech/README.md b/owl-bot-staging/google-cloud-text_to_speech/README.md deleted file mode 100644 index 0ccf0430d37c..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Cloud Text-to-Speech API - -API Client library for the Cloud Text-to-Speech API - -Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-text_to_speech-v*`. -The gem `google-cloud-text_to_speech` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech/latest) -for this library, google-cloud-text_to_speech, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-text_to_speech-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/text-to-speech) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-text_to_speech -``` - -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/texttospeech.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/text_to_speech" - -client = Google::Cloud::TextToSpeech.text_to_speech -request = ::Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new # (request fields as keyword arguments...) -response = client.list_voices request -``` - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-text_to_speech-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -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-text_to_speech`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-text_to_speech-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-text_to_speech`. -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-text_to_speech-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-text_to_speech/Rakefile b/owl-bot-staging/google-cloud-text_to_speech/Rakefile deleted file mode 100644 index a2f1fe8dede2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true -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-text_to_speech acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TEXTTOSPEECH_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TEXTTOSPEECH_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TEXTTOSPEECH_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 TEXTTOSPEECH_TEST_PROJECT=test123 TEXTTOSPEECH_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/text_to_speech/v1/text_to_speech/credentials" - ::Google::Cloud::TextToSpeech::V1::TextToSpeech::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TEXTTOSPEECH_PROJECT"] = project - ENV["TEXTTOSPEECH_TEST_PROJECT"] = project - ENV["TEXTTOSPEECH_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-text_to_speech 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-text_to_speech 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-text_to_speech 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-text_to_speech gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-text_to_speech" - header "google-cloud-text_to_speech rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-text_to_speech yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-text_to_speech 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-text_to_speech 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-text_to_speech 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-text_to_speech/google-cloud-text_to_speech.gemspec b/owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec deleted file mode 100644 index 963a39356e3c..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/google-cloud-text_to_speech.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/text_to_speech/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-text_to_speech" - gem.version = Google::Cloud::TextToSpeech::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Text-to-Speech converts text or Speech Synthesis Markup Language (SSML) input into audio data of natural human speech." - gem.summary = "API Client library for the Cloud Text-to-Speech API" - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-text_to_speech-v1", "~> 1.7" -end diff --git a/owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb deleted file mode 100644 index c281c6815fb7..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/lib/google-cloud-text_to_speech.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/text_to_speech" unless defined? Google::Cloud::TextToSpeech::VERSION diff --git a/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb b/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb deleted file mode 100644 index bd6292b6eb1d..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech.rb +++ /dev/null @@ -1,226 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/text_to_speech/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :text_to_speech do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module TextToSpeech - ## - # Create a new client object for TextToSpeech. - # - # By default, this returns an instance of - # [Google::Cloud::TextToSpeech::V1::TextToSpeech::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest/Google-Cloud-TextToSpeech-V1-TextToSpeech-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TextToSpeech service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TextToSpeech service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::TextToSpeech.text_to_speech_available?}. - # - # ## About TextToSpeech - # - # Service that implements Google Cloud Text-to-Speech API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.text_to_speech version: :v1, transport: :grpc, &block - require "google/cloud/text_to_speech/#{version.to_s.downcase}" - - package_name = Google::Cloud::TextToSpeech - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::TextToSpeech.const_get(package_name).const_get(:TextToSpeech) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TextToSpeech service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::TextToSpeech.text_to_speech}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TextToSpeech service, - # or if the versioned client gem needs an update to support the TextToSpeech service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.text_to_speech_available? version: :v1, transport: :grpc - require "google/cloud/text_to_speech/#{version.to_s.downcase}" - package_name = Google::Cloud::TextToSpeech - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::TextToSpeech.const_get package_name - return false unless service_module.const_defined? :TextToSpeech - service_module = service_module.const_get :TextToSpeech - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Create a new client object for TextToSpeechLongAudioSynthesize. - # - # By default, this returns an instance of - # [Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1/latest/Google-Cloud-TextToSpeech-V1-TextToSpeechLongAudioSynthesize-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TextToSpeechLongAudioSynthesize service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TextToSpeechLongAudioSynthesize service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize_available?}. - # - # ## About TextToSpeechLongAudioSynthesize - # - # Service that implements Google Cloud Text-to-Speech API. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.text_to_speech_long_audio_synthesize version: :v1, transport: :grpc, &block - require "google/cloud/text_to_speech/#{version.to_s.downcase}" - - package_name = Google::Cloud::TextToSpeech - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::TextToSpeech.const_get(package_name).const_get(:TextToSpeechLongAudioSynthesize) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TextToSpeechLongAudioSynthesize service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TextToSpeechLongAudioSynthesize service, - # or if the versioned client gem needs an update to support the TextToSpeechLongAudioSynthesize service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.text_to_speech_long_audio_synthesize_available? version: :v1, transport: :grpc - require "google/cloud/text_to_speech/#{version.to_s.downcase}" - package_name = Google::Cloud::TextToSpeech - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::TextToSpeech.const_get package_name - return false unless service_module.const_defined? :TextToSpeechLongAudioSynthesize - service_module = service_module.const_get :TextToSpeechLongAudioSynthesize - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-text_to_speech library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.text_to_speech if block_given? - - ::Google::Cloud.configure.text_to_speech - end - end - end -end - -helper_path = ::File.join __dir__, "text_to_speech", "helpers.rb" -require "google/cloud/text_to_speech/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb b/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb deleted file mode 100644 index 06eb4f49462b..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/lib/google/cloud/text_to_speech/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 TextToSpeech - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb b/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb deleted file mode 100644 index 4306c2398264..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/client_test.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/text_to_speech" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::TextToSpeech::ClientConstructionMinitest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_text_to_speech_grpc - skip unless Google::Cloud::TextToSpeech.text_to_speech_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::TextToSpeech.text_to_speech transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeech::Client, client - end - end - - def test_text_to_speech_rest - skip unless Google::Cloud::TextToSpeech.text_to_speech_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::TextToSpeech.text_to_speech transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeech::Rest::Client, client - end - end - - def test_text_to_speech_long_audio_synthesize_grpc - skip unless Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Client, client - end - end - - def test_text_to_speech_long_audio_synthesize_rest - skip unless Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::TextToSpeech.text_to_speech_long_audio_synthesize transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::TextToSpeech::V1::TextToSpeechLongAudioSynthesize::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb b/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb deleted file mode 100644 index 12c50a24d6d6..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/test/google/cloud/text_to_speech/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/text_to_speech/version" - -class Google::Cloud::TextToSpeech::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::TextToSpeech::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb b/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-text_to_speech/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tpu-v1/.gitignore b/owl-bot-staging/google-cloud-tpu-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-tpu-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-tpu-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-tpu-v1/.repo-metadata.json deleted file mode 100644 index 382bdf22eb6e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "tpu.googleapis.com", - "api_shortname": "tpu", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest", - "distribution_name": "google-cloud-tpu-v1", - "is_cloud": true, - "language": "ruby", - "name": "tpu", - "name_pretty": "Cloud TPU V1 API", - "product_documentation": "https://cloud.google.com/tpu/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform. Note that google-cloud-tpu-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tpu instead. See the readme for more details.", - "ruby-cloud-env-prefix": "CLOUD_TPU", - "ruby-cloud-product-url": "https://cloud.google.com/tpu/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml b/owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml deleted file mode 100644 index 0db23e57cdbd..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-tpu-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-tpu-v1.rb" diff --git a/owl-bot-staging/google-cloud-tpu-v1/.toys.rb b/owl-bot-staging/google-cloud-tpu-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/.yardopts b/owl-bot-staging/google-cloud-tpu-v1/.yardopts deleted file mode 100644 index f2c8ec30b07e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud TPU 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-tpu-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tpu-v1/AUTHENTICATION.md deleted file mode 100644 index dcd3772bc00e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-tpu-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-tpu-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/tpu/v1" - -client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/tpu/v1" - -::Google::Cloud::Tpu::V1::Tpu::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Tpu::V1::Tpu::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-tpu-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/tpu/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Tpu::V1::Tpu::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-tpu-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-tpu-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-tpu-v1/Gemfile b/owl-bot-staging/google-cloud-tpu-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-tpu-v1/LICENSE.md b/owl-bot-staging/google-cloud-tpu-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-tpu-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-tpu-v1/README.md b/owl-bot-staging/google-cloud-tpu-v1/README.md deleted file mode 100644 index 8e5f3796c7e1..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud TPU V1 API - -TPU API provides customers with access to Google TPU technology. - -Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI 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 TPU V1 API. Most users should consider using -the main client gem, -[google-cloud-tpu](https://rubygems.org/gems/google-cloud-tpu). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-tpu-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/tpu.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/tpu/v1" - -client = ::Google::Cloud::Tpu::V1::Tpu::Client.new -request = ::Google::Cloud::Tpu::V1::ListNodesRequest.new # (request fields as keyword arguments...) -response = client.list_nodes request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/tpu/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/tpu/v1" -require "logger" - -client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-tpu`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-tpu-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-tpu`. -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-tpu-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-tpu-v1/Rakefile b/owl-bot-staging/google-cloud-tpu-v1/Rakefile deleted file mode 100644 index 6973baaa474a..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["CLOUD_TPU_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["CLOUD_TPU_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["CLOUD_TPU_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 CLOUD_TPU_TEST_PROJECT=test123 CLOUD_TPU_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/tpu/v1/tpu/credentials" - ::Google::Cloud::Tpu::V1::Tpu::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["CLOUD_TPU_PROJECT"] = project - ENV["CLOUD_TPU_TEST_PROJECT"] = project - ENV["CLOUD_TPU_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-tpu-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-tpu-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-tpu-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-tpu-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-tpu-v1" - header "google-cloud-tpu-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-tpu-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-tpu-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-tpu-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-tpu-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-tpu-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-tpu-v1/gapic_metadata.json deleted file mode 100644 index d3485f86c0f6..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/gapic_metadata.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.tpu.v1", - "libraryPackage": "::Google::Cloud::Tpu::V1", - "services": { - "Tpu": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Tpu::V1::Tpu::Client", - "rpcs": { - "ListNodes": { - "methods": [ - "list_nodes" - ] - }, - "GetNode": { - "methods": [ - "get_node" - ] - }, - "CreateNode": { - "methods": [ - "create_node" - ] - }, - "DeleteNode": { - "methods": [ - "delete_node" - ] - }, - "ReimageNode": { - "methods": [ - "reimage_node" - ] - }, - "StopNode": { - "methods": [ - "stop_node" - ] - }, - "StartNode": { - "methods": [ - "start_node" - ] - }, - "ListTensorFlowVersions": { - "methods": [ - "list_tensor_flow_versions" - ] - }, - "GetTensorFlowVersion": { - "methods": [ - "get_tensor_flow_version" - ] - }, - "ListAcceleratorTypes": { - "methods": [ - "list_accelerator_types" - ] - }, - "GetAcceleratorType": { - "methods": [ - "get_accelerator_type" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec b/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec deleted file mode 100644 index 0e02f2aa9292..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/google-cloud-tpu-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/tpu/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-tpu-v1" - gem.version = Google::Cloud::Tpu::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform. Note that google-cloud-tpu-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-tpu instead. See the readme for more details." - gem.summary = "TPU API provides customers with access to Google TPU technology." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb deleted file mode 100644 index feffd3cd43da..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google-cloud-tpu-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1" diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb deleted file mode 100644 index 04462f2cc2c2..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/tpu" -require "google/cloud/tpu/v1/version" - -module Google - module Cloud - module Tpu - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/tpu/v1" - # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/tpu/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb deleted file mode 100644 index 005205cdd0ac..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_pb.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/tpu/v1/cloud_tpu.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/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n#google/cloud/tpu/v1/cloud_tpu.proto\x12\x13google.cloud.tpu.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"9\n\x10SchedulingConfig\x12\x13\n\x0bpreemptible\x18\x01 \x01(\x08\x12\x10\n\x08reserved\x18\x02 \x01(\x08\"3\n\x0fNetworkEndpoint\x12\x12\n\nip_address\x18\x01 \x01(\t\x12\x0c\n\x04port\x18\x02 \x01(\x05\"\xc1\n\n\x04Node\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x10\x61\x63\x63\x65lerator_type\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\nip_address\x18\x08 \x01(\tB\x02\x18\x01\x12\x10\n\x04port\x18\x0e \x01(\tB\x02\x18\x01\x12\x33\n\x05state\x18\t \x01(\x0e\x32\x1f.google.cloud.tpu.v1.Node.StateB\x03\xe0\x41\x03\x12\x1f\n\x12health_description\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12tensorflow_version\x18\x0b \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07network\x18\x0c \x01(\t\x12\x12\n\ncidr_block\x18\r \x01(\t\x12\x1c\n\x0fservice_account\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x11scheduling_config\x18\x11 \x01(\x0b\x32%.google.cloud.tpu.v1.SchedulingConfig\x12\x44\n\x11network_endpoints\x18\x15 \x03(\x0b\x32$.google.cloud.tpu.v1.NetworkEndpointB\x03\xe0\x41\x03\x12\x30\n\x06health\x18\x16 \x01(\x0e\x32 .google.cloud.tpu.v1.Node.Health\x12\x35\n\x06labels\x18\x18 \x03(\x0b\x32%.google.cloud.tpu.v1.Node.LabelsEntry\x12\x1e\n\x16use_service_networking\x18\x1b \x01(\x08\x12>\n\x0b\x61pi_version\x18& \x01(\x0e\x32$.google.cloud.tpu.v1.Node.ApiVersionB\x03\xe0\x41\x03\x12\x33\n\x08symptoms\x18\' \x03(\x0b\x32\x1c.google.cloud.tpu.v1.SymptomB\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\"\xee\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0e\n\nRESTARTING\x10\x03\x12\r\n\tREIMAGING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05\x12\r\n\tREPAIRING\x10\x06\x12\x0b\n\x07STOPPED\x10\x08\x12\x0c\n\x08STOPPING\x10\t\x12\x0c\n\x08STARTING\x10\n\x12\r\n\tPREEMPTED\x10\x0b\x12\x0e\n\nTERMINATED\x10\x0c\x12\n\n\x06HIDING\x10\r\x12\n\n\x06HIDDEN\x10\x0e\x12\x0c\n\x08UNHIDING\x10\x0f\x12\x0b\n\x07UNKNOWN\x10\x10\"\x89\x01\n\x06Health\x12\x16\n\x12HEALTH_UNSPECIFIED\x10\x00\x12\x0b\n\x07HEALTHY\x10\x01\x12\x18\n\x14\x44\x45PRECATED_UNHEALTHY\x10\x02\x12\x0b\n\x07TIMEOUT\x10\x03\x12\x18\n\x14UNHEALTHY_TENSORFLOW\x10\x04\x12\x19\n\x15UNHEALTHY_MAINTENANCE\x10\x05\"O\n\nApiVersion\x12\x1b\n\x17\x41PI_VERSION_UNSPECIFIED\x10\x00\x12\r\n\tV1_ALPHA1\x10\x01\x12\x06\n\x02V1\x10\x02\x12\r\n\tV2_ALPHA1\x10\x03:R\xea\x41O\n\x17tpu.googleapis.com/Node\x12\x34projects/{project}/locations/{location}/nodes/{node}\"j\n\x10ListNodesRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17tpu.googleapis.com/Node\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"k\n\x11ListNodesResponse\x12(\n\x05nodes\x18\x01 \x03(\x0b\x32\x19.google.cloud.tpu.v1.Node\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"?\n\x0eGetNodeRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17tpu.googleapis.com/Node\"\x83\x01\n\x11\x43reateNodeRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17tpu.googleapis.com/Node\x12\x0f\n\x07node_id\x18\x02 \x01(\t\x12,\n\x04node\x18\x03 \x01(\x0b\x32\x19.google.cloud.tpu.v1.NodeB\x03\xe0\x41\x02\"B\n\x11\x44\x65leteNodeRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17tpu.googleapis.com/Node\">\n\x12ReimageNodeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1a\n\x12tensorflow_version\x18\x02 \x01(\t\"\x1f\n\x0fStopNodeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\" \n\x10StartNodeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\xaf\x01\n\x11TensorFlowVersion\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t:{\xea\x41x\n$tpu.googleapis.com/TensorFlowVersion\x12Pprojects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}\"Y\n\x1bGetTensorFlowVersionRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$tpu.googleapis.com/TensorFlowVersion\"\xa6\x01\n\x1dListTensorFlowVersionsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$tpu.googleapis.com/TensorFlowVersion\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x10\n\x08order_by\x18\x06 \x01(\t\"\x93\x01\n\x1eListTensorFlowVersionsResponse\x12\x43\n\x13tensorflow_versions\x18\x01 \x03(\x0b\x32&.google.cloud.tpu.v1.TensorFlowVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xa3\x01\n\x0f\x41\x63\x63\x65leratorType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t:t\xea\x41q\n\"tpu.googleapis.com/AcceleratorType\x12Kprojects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}\"U\n\x19GetAcceleratorTypeRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"tpu.googleapis.com/AcceleratorType\"\xa2\x01\n\x1bListAcceleratorTypesRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"tpu.googleapis.com/AcceleratorType\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x10\n\x08order_by\x18\x06 \x01(\t\"\x8d\x01\n\x1cListAcceleratorTypesResponse\x12?\n\x11\x61\x63\x63\x65lerator_types\x18\x01 \x03(\x0b\x32$.google.cloud.tpu.v1.AcceleratorType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xd6\x01\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06target\x18\x03 \x01(\t\x12\x0c\n\x04verb\x18\x04 \x01(\t\x12\x15\n\rstatus_detail\x18\x05 \x01(\t\x12\x18\n\x10\x63\x61ncel_requested\x18\x06 \x01(\x08\x12\x13\n\x0b\x61pi_version\x18\x07 \x01(\t\"\xc5\x02\n\x07Symptom\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12>\n\x0csymptom_type\x18\x02 \x01(\x0e\x32(.google.cloud.tpu.v1.Symptom.SymptomType\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\x12\x11\n\tworker_id\x18\x04 \x01(\t\"\xa4\x01\n\x0bSymptomType\x12\x1c\n\x18SYMPTOM_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nLOW_MEMORY\x10\x01\x12\x11\n\rOUT_OF_MEMORY\x10\x02\x12\x15\n\x11\x45XECUTE_TIMED_OUT\x10\x03\x12\x13\n\x0fMESH_BUILD_FAIL\x10\x04\x12\x15\n\x11HBM_OUT_OF_MEMORY\x10\x05\x12\x11\n\rPROJECT_ABUSE\x10\x06\x32\xde\x0f\n\x03Tpu\x12\x96\x01\n\tListNodes\x12%.google.cloud.tpu.v1.ListNodesRequest\x1a&.google.cloud.tpu.v1.ListNodesResponse\":\xda\x41\x06parent\x82\xd3\xe4\x93\x02+\x12)/v1/{parent=projects/*/locations/*}/nodes\x12\x83\x01\n\x07GetNode\x12#.google.cloud.tpu.v1.GetNodeRequest\x1a\x19.google.cloud.tpu.v1.Node\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/nodes/*}\x12\xbe\x01\n\nCreateNode\x12&.google.cloud.tpu.v1.CreateNodeRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\xda\x41\x13parent,node,node_id\x82\xd3\xe4\x93\x02\x31\")/v1/{parent=projects/*/locations/*}/nodes:\x04node\x12\xa9\x01\n\nDeleteNode\x12&.google.cloud.tpu.v1.DeleteNodeRequest\x1a\x1d.google.longrunning.Operation\"T\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02+*)/v1/{name=projects/*/locations/*/nodes/*}\x12\xaf\x01\n\x0bReimageNode\x12\'.google.cloud.tpu.v1.ReimageNodeRequest\x1a\x1d.google.longrunning.Operation\"X\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/nodes/*}:reimage:\x01*\x12\xa6\x01\n\x08StopNode\x12$.google.cloud.tpu.v1.StopNodeRequest\x1a\x1d.google.longrunning.Operation\"U\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x33\"./v1/{name=projects/*/locations/*/nodes/*}:stop:\x01*\x12\xa9\x01\n\tStartNode\x12%.google.cloud.tpu.v1.StartNodeRequest\x1a\x1d.google.longrunning.Operation\"V\xca\x41\x19\n\x04Node\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/nodes/*}:start:\x01*\x12\xca\x01\n\x16ListTensorFlowVersions\x12\x32.google.cloud.tpu.v1.ListTensorFlowVersionsRequest\x1a\x33.google.cloud.tpu.v1.ListTensorFlowVersionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*}/tensorflowVersions\x12\xb7\x01\n\x14GetTensorFlowVersion\x12\x30.google.cloud.tpu.v1.GetTensorFlowVersionRequest\x1a&.google.cloud.tpu.v1.TensorFlowVersion\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/tensorflowVersions/*}\x12\xc2\x01\n\x14ListAcceleratorTypes\x12\x30.google.cloud.tpu.v1.ListAcceleratorTypesRequest\x1a\x31.google.cloud.tpu.v1.ListAcceleratorTypesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/acceleratorTypes\x12\xaf\x01\n\x12GetAcceleratorType\x12..google.cloud.tpu.v1.GetAcceleratorTypeRequest\x1a$.google.cloud.tpu.v1.AcceleratorType\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/acceleratorTypes/*}\x1a\x46\xca\x41\x12tpu.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBU\n\x17\x63om.google.cloud.tpu.v1B\rCloudTpuProtoP\x01Z)cloud.google.com/go/tpu/apiv1/tpupb;tpupbb\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 Tpu - module V1 - SchedulingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.SchedulingConfig").msgclass - NetworkEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.NetworkEndpoint").msgclass - Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node").msgclass - Node::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node.State").enummodule - Node::Health = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node.Health").enummodule - Node::ApiVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Node.ApiVersion").enummodule - ListNodesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListNodesRequest").msgclass - ListNodesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListNodesResponse").msgclass - GetNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.GetNodeRequest").msgclass - CreateNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.CreateNodeRequest").msgclass - DeleteNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.DeleteNodeRequest").msgclass - ReimageNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ReimageNodeRequest").msgclass - StopNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.StopNodeRequest").msgclass - StartNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.StartNodeRequest").msgclass - TensorFlowVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.TensorFlowVersion").msgclass - GetTensorFlowVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.GetTensorFlowVersionRequest").msgclass - ListTensorFlowVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListTensorFlowVersionsRequest").msgclass - ListTensorFlowVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListTensorFlowVersionsResponse").msgclass - AcceleratorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.AcceleratorType").msgclass - GetAcceleratorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.GetAcceleratorTypeRequest").msgclass - ListAcceleratorTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListAcceleratorTypesRequest").msgclass - ListAcceleratorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.ListAcceleratorTypesResponse").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.OperationMetadata").msgclass - Symptom = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Symptom").msgclass - Symptom::SymptomType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tpu.v1.Symptom.SymptomType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb deleted file mode 100644 index 2aafa9ceccbb..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/cloud_tpu_services_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/tpu/v1/cloud_tpu.proto for package 'google.cloud.tpu.v1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/tpu/v1/cloud_tpu_pb' - -module Google - module Cloud - module Tpu - module V1 - module Tpu - # Manages TPU nodes and other resources - # - # TPU API v1 - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.tpu.v1.Tpu' - - # Lists nodes. - rpc :ListNodes, ::Google::Cloud::Tpu::V1::ListNodesRequest, ::Google::Cloud::Tpu::V1::ListNodesResponse - # Gets the details of a node. - rpc :GetNode, ::Google::Cloud::Tpu::V1::GetNodeRequest, ::Google::Cloud::Tpu::V1::Node - # Creates a node. - rpc :CreateNode, ::Google::Cloud::Tpu::V1::CreateNodeRequest, ::Google::Longrunning::Operation - # Deletes a node. - rpc :DeleteNode, ::Google::Cloud::Tpu::V1::DeleteNodeRequest, ::Google::Longrunning::Operation - # Reimages a node's OS. - rpc :ReimageNode, ::Google::Cloud::Tpu::V1::ReimageNodeRequest, ::Google::Longrunning::Operation - # Stops a node, this operation is only available with single TPU nodes. - rpc :StopNode, ::Google::Cloud::Tpu::V1::StopNodeRequest, ::Google::Longrunning::Operation - # Starts a node. - rpc :StartNode, ::Google::Cloud::Tpu::V1::StartNodeRequest, ::Google::Longrunning::Operation - # List TensorFlow versions supported by this API. - rpc :ListTensorFlowVersions, ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest, ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsResponse - # Gets TensorFlow Version. - rpc :GetTensorFlowVersion, ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest, ::Google::Cloud::Tpu::V1::TensorFlowVersion - # Lists accelerator types supported by this API. - rpc :ListAcceleratorTypes, ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest, ::Google::Cloud::Tpu::V1::ListAcceleratorTypesResponse - # Gets AcceleratorType. - rpc :GetAcceleratorType, ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest, ::Google::Cloud::Tpu::V1::AcceleratorType - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb deleted file mode 100644 index 30ee70ee9626..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/version" - -require "google/cloud/tpu/v1/tpu/credentials" -require "google/cloud/tpu/v1/tpu/paths" -require "google/cloud/tpu/v1/tpu/operations" -require "google/cloud/tpu/v1/tpu/client" - -module Google - module Cloud - module Tpu - module V1 - ## - # Manages TPU nodes and other resources - # - # TPU API v1 - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/tpu/v1/tpu" - # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new - # - module Tpu - end - end - end - end -end - -helper_path = ::File.join __dir__, "tpu", "helpers.rb" -require "google/cloud/tpu/v1/tpu/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb deleted file mode 100644 index 2b7b841df38b..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/client.rb +++ /dev/null @@ -1,1517 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/cloud_tpu_pb" -require "google/cloud/location" - -module Google - module Cloud - module Tpu - module V1 - module Tpu - ## - # Client for the Tpu service. - # - # Manages TPU nodes and other resources - # - # TPU API v1 - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "tpu.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tpu_stub - - ## - # Configure the Tpu Client class. - # - # See {::Google::Cloud::Tpu::V1::Tpu::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Tpu clients - # ::Google::Cloud::Tpu::V1::Tpu::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", "Tpu", "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.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Tpu 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::Tpu::V1::Tpu::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 - @tpu_stub.universe_domain - end - - ## - # Create a new Tpu client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Tpu 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/tpu/v1/cloud_tpu_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 - - @tpu_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Tpu::V1::Tpu::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, - logger: @config.logger - ) - - @tpu_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @tpu_stub.endpoint - config.universe_domain = @tpu_stub.universe_domain - config.logger = @tpu_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Tpu::V1::Tpu::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @tpu_stub.logger - end - - # Service calls - - ## - # Lists nodes. - # - # @overload list_nodes(request, options = nil) - # Pass arguments to `list_nodes` via a request object, either of type - # {::Google::Cloud::Tpu::V1::ListNodesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::ListNodesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_nodes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_nodes` via keyword arguments. Note that at - # least one keyword argument is 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 name. - # @param page_size [::Integer] - # The maximum number of items to return. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::Node>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::Node>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::ListNodesRequest.new - # - # # Call the list_nodes method. - # result = client.list_nodes 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::Tpu::V1::Node. - # p item - # end - # - def list_nodes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ListNodesRequest - - # Converts hash 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_nodes.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::Tpu::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_nodes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_nodes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :list_nodes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tpu_stub, :list_nodes, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the details of a node. - # - # @overload get_node(request, options = nil) - # Pass arguments to `get_node` via a request object, either of type - # {::Google::Cloud::Tpu::V1::GetNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::GetNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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(name: nil) - # Pass arguments to `get_node` via keyword arguments. Note that at - # least one keyword argument is 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tpu::V1::Node] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tpu::V1::Node] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::GetNodeRequest.new - # - # # Call the get_node method. - # result = client.get_node request - # - # # The returned object is of type Google::Cloud::Tpu::V1::Node. - # p result - # - def get_node request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::GetNodeRequest - - # Converts hash 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.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::Tpu::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.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :get_node, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a node. - # - # @overload create_node(request, options = nil) - # Pass arguments to `create_node` via a request object, either of type - # {::Google::Cloud::Tpu::V1::CreateNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::CreateNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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(parent: nil, node_id: nil, node: nil) - # Pass arguments to `create_node` via keyword arguments. Note that at - # least one keyword argument is 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 name. - # @param node_id [::String] - # The unqualified resource name. - # @param node [::Google::Cloud::Tpu::V1::Node, ::Hash] - # Required. The node. - # - # @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/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::CreateNodeRequest.new - # - # # Call the create_node method. - # result = client.create_node 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 request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::CreateNodeRequest - - # Converts hash 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.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::Tpu::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.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :create_node, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a node. - # - # @overload delete_node(request, options = nil) - # Pass arguments to `delete_node` via a request object, either of type - # {::Google::Cloud::Tpu::V1::DeleteNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::DeleteNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node(name: nil) - # Pass arguments to `delete_node` via keyword arguments. Note that at - # least one keyword argument is 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. - # - # @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/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::DeleteNodeRequest.new - # - # # Call the delete_node method. - # result = client.delete_node 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_node request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::DeleteNodeRequest - - # Converts hash 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_node.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::Tpu::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_node.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :delete_node, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Reimages a node's OS. - # - # @overload reimage_node(request, options = nil) - # Pass arguments to `reimage_node` via a request object, either of type - # {::Google::Cloud::Tpu::V1::ReimageNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::ReimageNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reimage_node(name: nil, tensorflow_version: nil) - # Pass arguments to `reimage_node` via keyword arguments. Note that at - # least one keyword argument is 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 resource name. - # @param tensorflow_version [::String] - # The version for reimage to create. - # - # @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/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::ReimageNodeRequest.new - # - # # Call the reimage_node method. - # result = client.reimage_node 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 reimage_node request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ReimageNodeRequest - - # Converts hash 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.reimage_node.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::Tpu::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.reimage_node.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reimage_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :reimage_node, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops a node, this operation is only available with single TPU nodes. - # - # @overload stop_node(request, options = nil) - # Pass arguments to `stop_node` via a request object, either of type - # {::Google::Cloud::Tpu::V1::StopNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::StopNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node(name: nil) - # Pass arguments to `stop_node` via keyword arguments. Note that at - # least one keyword argument is 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 resource name. - # - # @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/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::StopNodeRequest.new - # - # # Call the stop_node method. - # result = client.stop_node 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_node request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::StopNodeRequest - - # Converts hash 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_node.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::Tpu::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.stop_node.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :stop_node, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts a node. - # - # @overload start_node(request, options = nil) - # Pass arguments to `start_node` via a request object, either of type - # {::Google::Cloud::Tpu::V1::StartNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::StartNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node(name: nil) - # Pass arguments to `start_node` via keyword arguments. Note that at - # least one keyword argument is 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 resource name. - # - # @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/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::StartNodeRequest.new - # - # # Call the start_node method. - # result = client.start_node 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_node request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::StartNodeRequest - - # Converts hash 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_node.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::Tpu::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.start_node.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :start_node, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List TensorFlow versions supported by this API. - # - # @overload list_tensor_flow_versions(request, options = nil) - # Pass arguments to `list_tensor_flow_versions` via a request object, either of type - # {::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tensor_flow_versions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_tensor_flow_versions` via keyword arguments. Note that at - # least one keyword argument is 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 name. - # @param page_size [::Integer] - # The maximum number of items to return. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # List filter. - # @param order_by [::String] - # Sort results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::TensorFlowVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::TensorFlowVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.new - # - # # Call the list_tensor_flow_versions method. - # result = client.list_tensor_flow_versions 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::Tpu::V1::TensorFlowVersion. - # p item - # end - # - def list_tensor_flow_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest - - # Converts hash 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_tensor_flow_versions.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::Tpu::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_tensor_flow_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tensor_flow_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :list_tensor_flow_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tpu_stub, :list_tensor_flow_versions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets TensorFlow Version. - # - # @overload get_tensor_flow_version(request, options = nil) - # Pass arguments to `get_tensor_flow_version` via a request object, either of type - # {::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tensor_flow_version(name: nil) - # Pass arguments to `get_tensor_flow_version` via keyword arguments. Note that at - # least one keyword argument is 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tpu::V1::TensorFlowVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tpu::V1::TensorFlowVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new - # - # # Call the get_tensor_flow_version method. - # result = client.get_tensor_flow_version request - # - # # The returned object is of type Google::Cloud::Tpu::V1::TensorFlowVersion. - # p result - # - def get_tensor_flow_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest - - # Converts hash 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_tensor_flow_version.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::Tpu::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_tensor_flow_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tensor_flow_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :get_tensor_flow_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists accelerator types supported by this API. - # - # @overload list_accelerator_types(request, options = nil) - # Pass arguments to `list_accelerator_types` via a request object, either of type - # {::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_accelerator_types(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_accelerator_types` via keyword arguments. Note that at - # least one keyword argument is 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 name. - # @param page_size [::Integer] - # The maximum number of items to return. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # List filter. - # @param order_by [::String] - # Sort results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::AcceleratorType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Tpu::V1::AcceleratorType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.new - # - # # Call the list_accelerator_types method. - # result = client.list_accelerator_types 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::Tpu::V1::AcceleratorType. - # p item - # end - # - def list_accelerator_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest - - # Converts hash 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_accelerator_types.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::Tpu::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_accelerator_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_accelerator_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :list_accelerator_types, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tpu_stub, :list_accelerator_types, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets AcceleratorType. - # - # @overload get_accelerator_type(request, options = nil) - # Pass arguments to `get_accelerator_type` via a request object, either of type - # {::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_accelerator_type(name: nil) - # Pass arguments to `get_accelerator_type` via keyword arguments. Note that at - # least one keyword argument is 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Tpu::V1::AcceleratorType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Tpu::V1::AcceleratorType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/tpu/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Tpu::V1::Tpu::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new - # - # # Call the get_accelerator_type method. - # result = client.get_accelerator_type request - # - # # The returned object is of type Google::Cloud::Tpu::V1::AcceleratorType. - # p result - # - def get_accelerator_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest - - # Converts hash 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_accelerator_type.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::Tpu::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_accelerator_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_accelerator_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tpu_stub.call_rpc :get_accelerator_type, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Tpu API. - # - # This class represents the configuration for Tpu, - # 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::Tpu::V1::Tpu::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_nodes to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Tpu::V1::Tpu::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_nodes.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_nodes.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "tpu.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 Tpu 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_nodes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_nodes - ## - # RPC-specific configuration for `get_node` - # @return [::Gapic::Config::Method] - # - attr_reader :get_node - ## - # RPC-specific configuration for `create_node` - # @return [::Gapic::Config::Method] - # - attr_reader :create_node - ## - # RPC-specific configuration for `delete_node` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_node - ## - # RPC-specific configuration for `reimage_node` - # @return [::Gapic::Config::Method] - # - attr_reader :reimage_node - ## - # RPC-specific configuration for `stop_node` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_node - ## - # RPC-specific configuration for `start_node` - # @return [::Gapic::Config::Method] - # - attr_reader :start_node - ## - # RPC-specific configuration for `list_tensor_flow_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tensor_flow_versions - ## - # RPC-specific configuration for `get_tensor_flow_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tensor_flow_version - ## - # RPC-specific configuration for `list_accelerator_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_accelerator_types - ## - # RPC-specific configuration for `get_accelerator_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_accelerator_type - - # @private - def initialize parent_rpcs = nil - list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes - @list_nodes = ::Gapic::Config::Method.new list_nodes_config - get_node_config = parent_rpcs.get_node if parent_rpcs.respond_to? :get_node - @get_node = ::Gapic::Config::Method.new get_node_config - create_node_config = parent_rpcs.create_node if parent_rpcs.respond_to? :create_node - @create_node = ::Gapic::Config::Method.new create_node_config - delete_node_config = parent_rpcs.delete_node if parent_rpcs.respond_to? :delete_node - @delete_node = ::Gapic::Config::Method.new delete_node_config - reimage_node_config = parent_rpcs.reimage_node if parent_rpcs.respond_to? :reimage_node - @reimage_node = ::Gapic::Config::Method.new reimage_node_config - stop_node_config = parent_rpcs.stop_node if parent_rpcs.respond_to? :stop_node - @stop_node = ::Gapic::Config::Method.new stop_node_config - start_node_config = parent_rpcs.start_node if parent_rpcs.respond_to? :start_node - @start_node = ::Gapic::Config::Method.new start_node_config - list_tensor_flow_versions_config = parent_rpcs.list_tensor_flow_versions if parent_rpcs.respond_to? :list_tensor_flow_versions - @list_tensor_flow_versions = ::Gapic::Config::Method.new list_tensor_flow_versions_config - get_tensor_flow_version_config = parent_rpcs.get_tensor_flow_version if parent_rpcs.respond_to? :get_tensor_flow_version - @get_tensor_flow_version = ::Gapic::Config::Method.new get_tensor_flow_version_config - list_accelerator_types_config = parent_rpcs.list_accelerator_types if parent_rpcs.respond_to? :list_accelerator_types - @list_accelerator_types = ::Gapic::Config::Method.new list_accelerator_types_config - get_accelerator_type_config = parent_rpcs.get_accelerator_type if parent_rpcs.respond_to? :get_accelerator_type - @get_accelerator_type = ::Gapic::Config::Method.new get_accelerator_type_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb deleted file mode 100644 index 9c95a410d65c..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu - module V1 - module Tpu - # Credentials for the Tpu API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "CLOUD_TPU_CREDENTIALS", - "CLOUD_TPU_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "CLOUD_TPU_CREDENTIALS_JSON", - "CLOUD_TPU_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-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb deleted file mode 100644 index 2705f05c388e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu - module V1 - module Tpu - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "tpu.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Tpu 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 Tpu 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::Tpu::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? - throw :response, 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::Tpu::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? - throw :response, 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::Tpu::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? - 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::Tpu::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? - 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::Tpu::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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "tpu.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb deleted file mode 100644 index e459e1626bc7..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/tpu/paths.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu - module V1 - module Tpu - # Path helper methods for the Tpu API. - module Paths - ## - # Create a fully-qualified AcceleratorType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}` - # - # @param project [String] - # @param location [String] - # @param accelerator_type [String] - # - # @return [::String] - def accelerator_type_path project:, location:, accelerator_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/acceleratorTypes/#{accelerator_type}" - 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 Node resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/nodes/{node}` - # - # @param project [String] - # @param location [String] - # @param node [String] - # - # @return [::String] - def node_path project:, location:, node: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/nodes/#{node}" - end - - ## - # Create a fully-qualified TensorFlowVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}` - # - # @param project [String] - # @param location [String] - # @param tensor_flow_version [String] - # - # @return [::String] - def tensor_flow_version_path project:, location:, tensor_flow_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tensorFlowVersions/#{tensor_flow_version}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb b/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb deleted file mode 100644 index 371ff2ba232b..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/lib/google/cloud/tpu/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md deleted file mode 100644 index f1be9ff90bac..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud TPU V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-tpu-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb deleted file mode 100644 index 337015bf0ead..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/cloud/tpu/v1/cloud_tpu.rb +++ /dev/null @@ -1,521 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu - module V1 - # Sets the scheduling options for this node. - # @!attribute [rw] preemptible - # @return [::Boolean] - # Defines whether the node is preemptible. - # @!attribute [rw] reserved - # @return [::Boolean] - # Whether the node is created under a reservation. - class SchedulingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A network endpoint over which a TPU worker can be reached. - # @!attribute [rw] ip_address - # @return [::String] - # The IP address of this network endpoint. - # @!attribute [rw] port - # @return [::Integer] - # The port of this network endpoint. - class NetworkEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A TPU instance. - # @!attribute [r] name - # @return [::String] - # Output only. Immutable. The name of the TPU - # @!attribute [rw] description - # @return [::String] - # The user-supplied description of the TPU. Maximum of 512 characters. - # @!attribute [rw] accelerator_type - # @return [::String] - # Required. The type of hardware accelerators associated with this node. - # @!attribute [rw] ip_address - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Output only. DEPRECATED! Use network_endpoints instead. - # The network address for the TPU Node as visible to Compute Engine - # instances. - # @!attribute [rw] port - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Output only. DEPRECATED! Use network_endpoints instead. - # The network port for the TPU Node as visible to Compute Engine instances. - # @!attribute [r] state - # @return [::Google::Cloud::Tpu::V1::Node::State] - # Output only. The current state for the TPU Node. - # @!attribute [r] health_description - # @return [::String] - # Output only. If this field is populated, it contains a description of why - # the TPU Node is unhealthy. - # @!attribute [rw] tensorflow_version - # @return [::String] - # Required. The version of Tensorflow running in the Node. - # @!attribute [rw] network - # @return [::String] - # The name of a network they wish to peer the TPU node to. It must be a - # preexisting Compute Engine network inside of the project on which this API - # has been activated. If none is provided, "default" will be used. - # @!attribute [rw] cidr_block - # @return [::String] - # The CIDR block that the TPU node will use when selecting an IP address. - # This CIDR block must be a /29 block; the Compute Engine networks API - # forbids a smaller block, and using a larger block would be wasteful (a - # node can only consume one IP address). Errors will occur if the CIDR block - # has already been used for a currently existing TPU node, the CIDR block - # conflicts with any subnetworks in the user's provided network, or the - # provided network is peered with another network that is using that CIDR - # block. - # @!attribute [r] service_account - # @return [::String] - # Output only. The service account used to run the tensor flow services - # within the node. To share resources, including Google Cloud Storage data, - # with the Tensorflow job running in the Node, this account must have - # permissions to that data. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the node was created. - # @!attribute [rw] scheduling_config - # @return [::Google::Cloud::Tpu::V1::SchedulingConfig] - # The scheduling options for this node. - # @!attribute [r] network_endpoints - # @return [::Array<::Google::Cloud::Tpu::V1::NetworkEndpoint>] - # Output only. The network endpoints where TPU workers can be accessed and - # sent work. It is recommended that Tensorflow clients of the node reach out - # to the 0th entry in this map first. - # @!attribute [rw] health - # @return [::Google::Cloud::Tpu::V1::Node::Health] - # The health status of the TPU node. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Resource labels to represent user-provided metadata. - # @!attribute [rw] use_service_networking - # @return [::Boolean] - # Whether the VPC peering for the node is set up through Service Networking - # API. The VPC Peering should be set up before provisioning the node. - # If this field is set, cidr_block field should not be specified. If the - # network, that you want to peer the TPU Node to, is Shared VPC networks, - # the node must be created with this this field enabled. - # @!attribute [r] api_version - # @return [::Google::Cloud::Tpu::V1::Node::ApiVersion] - # Output only. The API version that created this Node. - # @!attribute [r] symptoms - # @return [::Array<::Google::Cloud::Tpu::V1::Symptom>] - # Output only. The Symptoms that have occurred to the TPU Node. - class Node - 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 - - # Represents the different states of a TPU node during its lifecycle. - module State - # TPU node state is not known/set. - STATE_UNSPECIFIED = 0 - - # TPU node is being created. - CREATING = 1 - - # TPU node has been created. - READY = 2 - - # TPU node is restarting. - RESTARTING = 3 - - # TPU node is undergoing reimaging. - REIMAGING = 4 - - # TPU node is being deleted. - DELETING = 5 - - # TPU node is being repaired and may be unusable. Details can be - # found in the `help_description` field. - REPAIRING = 6 - - # TPU node is stopped. - STOPPED = 8 - - # TPU node is currently stopping. - STOPPING = 9 - - # TPU node is currently starting. - STARTING = 10 - - # TPU node has been preempted. Only applies to Preemptible TPU Nodes. - PREEMPTED = 11 - - # TPU node has been terminated due to maintenance or has reached the end of - # its life cycle (for preemptible nodes). - TERMINATED = 12 - - # TPU node is currently hiding. - HIDING = 13 - - # TPU node has been hidden. - HIDDEN = 14 - - # TPU node is currently unhiding. - UNHIDING = 15 - - # TPU node has unknown state after a failed repair. - UNKNOWN = 16 - end - - # Health defines the status of a TPU node as reported by - # Health Monitor. - module Health - # Health status is unknown: not initialized or failed to retrieve. - HEALTH_UNSPECIFIED = 0 - - # The resource is healthy. - HEALTHY = 1 - - # The resource is unhealthy. - DEPRECATED_UNHEALTHY = 2 - - # The resource is unresponsive. - TIMEOUT = 3 - - # The in-guest ML stack is unhealthy. - UNHEALTHY_TENSORFLOW = 4 - - # The node is under maintenance/priority boost caused rescheduling and - # will resume running once rescheduled. - UNHEALTHY_MAINTENANCE = 5 - end - - # TPU API Version. - module ApiVersion - # API version is unknown. - API_VERSION_UNSPECIFIED = 0 - - # TPU API V1Alpha1 version. - V1_ALPHA1 = 1 - - # TPU API V1 version. - V1 = 2 - - # TPU API V2Alpha1 version. - V2_ALPHA1 = 3 - end - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#list_nodes ListNodes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - class ListNodesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for {::Google::Cloud::Tpu::V1::Tpu::Client#list_nodes ListNodes}. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::Tpu::V1::Node>] - # The listed nodes. - # @!attribute [rw] next_page_token - # @return [::String] - # The next page token or empty if none. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListNodesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#get_node GetNode}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name. - class GetNodeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#create_node CreateNode}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. - # @!attribute [rw] node_id - # @return [::String] - # The unqualified resource name. - # @!attribute [rw] node - # @return [::Google::Cloud::Tpu::V1::Node] - # Required. The node. - class CreateNodeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#delete_node DeleteNode}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name. - class DeleteNodeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#reimage_node ReimageNode}. - # @!attribute [rw] name - # @return [::String] - # The resource name. - # @!attribute [rw] tensorflow_version - # @return [::String] - # The version for reimage to create. - class ReimageNodeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#stop_node StopNode}. - # @!attribute [rw] name - # @return [::String] - # The resource name. - class StopNodeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#start_node StartNode}. - # @!attribute [rw] name - # @return [::String] - # The resource name. - class StartNodeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A tensorflow version that a Node can be configured with. - # @!attribute [rw] name - # @return [::String] - # The resource name. - # @!attribute [rw] version - # @return [::String] - # the tensorflow version. - class TensorFlowVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Tpu::V1::Tpu::Client#get_tensor_flow_version GetTensorFlowVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name. - class GetTensorFlowVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions ListTensorFlowVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - # @!attribute [rw] filter - # @return [::String] - # List filter. - # @!attribute [rw] order_by - # @return [::String] - # Sort results. - class ListTensorFlowVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for - # {::Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions ListTensorFlowVersions}. - # @!attribute [rw] tensorflow_versions - # @return [::Array<::Google::Cloud::Tpu::V1::TensorFlowVersion>] - # The listed nodes. - # @!attribute [rw] next_page_token - # @return [::String] - # The next page token or empty if none. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListTensorFlowVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A accelerator type that a Node can be configured with. - # @!attribute [rw] name - # @return [::String] - # The resource name. - # @!attribute [rw] type - # @return [::String] - # the accelerator type. - class AcceleratorType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for {::Google::Cloud::Tpu::V1::Tpu::Client#get_accelerator_type GetAcceleratorType}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name. - class GetAcceleratorTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for - # {::Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types ListAcceleratorTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - # @!attribute [rw] filter - # @return [::String] - # List filter. - # @!attribute [rw] order_by - # @return [::String] - # Sort results. - class ListAcceleratorTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for - # {::Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types ListAcceleratorTypes}. - # @!attribute [rw] accelerator_types - # @return [::Array<::Google::Cloud::Tpu::V1::AcceleratorType>] - # The listed nodes. - # @!attribute [rw] next_page_token - # @return [::String] - # The next page token or empty if none. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListAcceleratorTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata describing an {::Google::Longrunning::Operation Operation} - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was created. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation finished running. - # @!attribute [rw] target - # @return [::String] - # Target of the operation - for example - # projects/project-1/connectivityTests/test-1 - # @!attribute [rw] verb - # @return [::String] - # Name of the verb executed by the operation. - # @!attribute [rw] status_detail - # @return [::String] - # Human-readable status of the operation, if any. - # @!attribute [rw] cancel_requested - # @return [::Boolean] - # Specifies if cancellation was requested for the operation. - # @!attribute [rw] api_version - # @return [::String] - # API version. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Symptom instance. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when the Symptom is created. - # @!attribute [rw] symptom_type - # @return [::Google::Cloud::Tpu::V1::Symptom::SymptomType] - # Type of the Symptom. - # @!attribute [rw] details - # @return [::String] - # Detailed information of the current Symptom. - # @!attribute [rw] worker_id - # @return [::String] - # A string used to uniquely distinguish a worker within a TPU node. - class Symptom - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # SymptomType represents the different types of Symptoms that a TPU can be - # at. - module SymptomType - # Unspecified symptom. - SYMPTOM_TYPE_UNSPECIFIED = 0 - - # TPU VM memory is low. - LOW_MEMORY = 1 - - # TPU runtime is out of memory. - OUT_OF_MEMORY = 2 - - # TPU runtime execution has timed out. - EXECUTE_TIMED_OUT = 3 - - # TPU runtime fails to construct a mesh that recognizes each TPU device's - # neighbors. - MESH_BUILD_FAIL = 4 - - # TPU HBM is out of memory. - HBM_OUT_OF_MEMORY = 5 - - # Abusive behaviors have been identified on the current project. - PROJECT_ABUSE = 6 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-tpu-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile deleted file mode 100644 index 8e8e1bbc6e73..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu-v1", path: "../" -else - gem "google-cloud-tpu-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-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json b/owl-bot-staging/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json deleted file mode 100644 index 8d24f0d69dda..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-tpu-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.tpu.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "tpu_v1_generated_Tpu_ListNodes_sync", - "title": "Snippet for the list_nodes call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#list_nodes.", - "file": "tpu/list_nodes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_nodes", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#list_nodes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::ListNodesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tpu::V1::ListNodesResponse", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "ListNodes", - "full_name": "google.cloud.tpu.v1.Tpu.ListNodes", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_GetNode_sync", - "title": "Snippet for the get_node call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#get_node.", - "file": "tpu/get_node.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_node", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#get_node", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::GetNodeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tpu::V1::Node", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "GetNode", - "full_name": "google.cloud.tpu.v1.Tpu.GetNode", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_CreateNode_sync", - "title": "Snippet for the create_node call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#create_node.", - "file": "tpu/create_node.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_node", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#create_node", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::CreateNodeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "CreateNode", - "full_name": "google.cloud.tpu.v1.Tpu.CreateNode", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_DeleteNode_sync", - "title": "Snippet for the delete_node call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#delete_node.", - "file": "tpu/delete_node.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_node", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#delete_node", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::DeleteNodeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "DeleteNode", - "full_name": "google.cloud.tpu.v1.Tpu.DeleteNode", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_ReimageNode_sync", - "title": "Snippet for the reimage_node call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#reimage_node.", - "file": "tpu/reimage_node.rb", - "language": "RUBY", - "client_method": { - "short_name": "reimage_node", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#reimage_node", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::ReimageNodeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "ReimageNode", - "full_name": "google.cloud.tpu.v1.Tpu.ReimageNode", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_StopNode_sync", - "title": "Snippet for the stop_node call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#stop_node.", - "file": "tpu/stop_node.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_node", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#stop_node", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::StopNodeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "StopNode", - "full_name": "google.cloud.tpu.v1.Tpu.StopNode", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_StartNode_sync", - "title": "Snippet for the start_node call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#start_node.", - "file": "tpu/start_node.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_node", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#start_node", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::StartNodeRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "StartNode", - "full_name": "google.cloud.tpu.v1.Tpu.StartNode", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_ListTensorFlowVersions_sync", - "title": "Snippet for the list_tensor_flow_versions call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions.", - "file": "tpu/list_tensor_flow_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tensor_flow_versions", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tpu::V1::ListTensorFlowVersionsResponse", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "ListTensorFlowVersions", - "full_name": "google.cloud.tpu.v1.Tpu.ListTensorFlowVersions", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_GetTensorFlowVersion_sync", - "title": "Snippet for the get_tensor_flow_version call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#get_tensor_flow_version.", - "file": "tpu/get_tensor_flow_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tensor_flow_version", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#get_tensor_flow_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tpu::V1::TensorFlowVersion", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "GetTensorFlowVersion", - "full_name": "google.cloud.tpu.v1.Tpu.GetTensorFlowVersion", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_ListAcceleratorTypes_sync", - "title": "Snippet for the list_accelerator_types call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types.", - "file": "tpu/list_accelerator_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_accelerator_types", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tpu::V1::ListAcceleratorTypesResponse", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "ListAcceleratorTypes", - "full_name": "google.cloud.tpu.v1.Tpu.ListAcceleratorTypes", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "tpu_v1_generated_Tpu_GetAcceleratorType_sync", - "title": "Snippet for the get_accelerator_type call in the Tpu service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Tpu::V1::Tpu::Client#get_accelerator_type.", - "file": "tpu/get_accelerator_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_accelerator_type", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client#get_accelerator_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Tpu::V1::AcceleratorType", - "client": { - "short_name": "Tpu::Client", - "full_name": "::Google::Cloud::Tpu::V1::Tpu::Client" - }, - "method": { - "short_name": "GetAcceleratorType", - "full_name": "google.cloud.tpu.v1.Tpu.GetAcceleratorType", - "service": { - "short_name": "Tpu", - "full_name": "google.cloud.tpu.v1.Tpu" - } - } - }, - "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-tpu-v1/snippets/tpu/create_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/create_node.rb deleted file mode 100644 index d1c45f76a1a5..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/create_node.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_CreateNode_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the create_node call in the Tpu 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::Tpu::V1::Tpu::Client#create_node. -# -def create_node - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::CreateNodeRequest.new - - # Call the create_node method. - result = client.create_node 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 tpu_v1_generated_Tpu_CreateNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb deleted file mode 100644 index 461da43fb962..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/delete_node.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_DeleteNode_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the delete_node call in the Tpu 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::Tpu::V1::Tpu::Client#delete_node. -# -def delete_node - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::DeleteNodeRequest.new - - # Call the delete_node method. - result = client.delete_node 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 tpu_v1_generated_Tpu_DeleteNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb deleted file mode 100644 index 01933680099e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_GetAcceleratorType_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the get_accelerator_type call in the Tpu 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::Tpu::V1::Tpu::Client#get_accelerator_type. -# -def get_accelerator_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new - - # Call the get_accelerator_type method. - result = client.get_accelerator_type request - - # The returned object is of type Google::Cloud::Tpu::V1::AcceleratorType. - p result -end -# [END tpu_v1_generated_Tpu_GetAcceleratorType_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb deleted file mode 100644 index 8f5fd80cf9f1..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_node.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_GetNode_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the get_node call in the Tpu 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::Tpu::V1::Tpu::Client#get_node. -# -def get_node - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::GetNodeRequest.new - - # Call the get_node method. - result = client.get_node request - - # The returned object is of type Google::Cloud::Tpu::V1::Node. - p result -end -# [END tpu_v1_generated_Tpu_GetNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb deleted file mode 100644 index f8602be5c5da..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_GetTensorFlowVersion_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the get_tensor_flow_version call in the Tpu 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::Tpu::V1::Tpu::Client#get_tensor_flow_version. -# -def get_tensor_flow_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new - - # Call the get_tensor_flow_version method. - result = client.get_tensor_flow_version request - - # The returned object is of type Google::Cloud::Tpu::V1::TensorFlowVersion. - p result -end -# [END tpu_v1_generated_Tpu_GetTensorFlowVersion_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb deleted file mode 100644 index 98fd7b460c0e..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ListAcceleratorTypes_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the list_accelerator_types call in the Tpu 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::Tpu::V1::Tpu::Client#list_accelerator_types. -# -def list_accelerator_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.new - - # Call the list_accelerator_types method. - result = client.list_accelerator_types 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::Tpu::V1::AcceleratorType. - p item - end -end -# [END tpu_v1_generated_Tpu_ListAcceleratorTypes_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb deleted file mode 100644 index 12cc06e1969a..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ListNodes_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the list_nodes call in the Tpu 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::Tpu::V1::Tpu::Client#list_nodes. -# -def list_nodes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::ListNodesRequest.new - - # Call the list_nodes method. - result = client.list_nodes 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::Tpu::V1::Node. - p item - end -end -# [END tpu_v1_generated_Tpu_ListNodes_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb deleted file mode 100644 index ca3d984b9276..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ListTensorFlowVersions_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the list_tensor_flow_versions call in the Tpu 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::Tpu::V1::Tpu::Client#list_tensor_flow_versions. -# -def list_tensor_flow_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.new - - # Call the list_tensor_flow_versions method. - result = client.list_tensor_flow_versions 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::Tpu::V1::TensorFlowVersion. - p item - end -end -# [END tpu_v1_generated_Tpu_ListTensorFlowVersions_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb deleted file mode 100644 index 8af8741cff8f..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_ReimageNode_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the reimage_node call in the Tpu 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::Tpu::V1::Tpu::Client#reimage_node. -# -def reimage_node - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::ReimageNodeRequest.new - - # Call the reimage_node method. - result = client.reimage_node 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 tpu_v1_generated_Tpu_ReimageNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb deleted file mode 100644 index f4bcab475e2c..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/start_node.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_StartNode_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the start_node call in the Tpu 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::Tpu::V1::Tpu::Client#start_node. -# -def start_node - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::StartNodeRequest.new - - # Call the start_node method. - result = client.start_node 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 tpu_v1_generated_Tpu_StartNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb b/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb deleted file mode 100644 index 8d4b1be90049..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/snippets/tpu/stop_node.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 tpu_v1_generated_Tpu_StopNode_sync] -require "google/cloud/tpu/v1" - -## -# Snippet for the stop_node call in the Tpu 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::Tpu::V1::Tpu::Client#stop_node. -# -def stop_node - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Tpu::V1::Tpu::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Tpu::V1::StopNodeRequest.new - - # Call the stop_node method. - result = client.stop_node 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 tpu_v1_generated_Tpu_StopNode_sync] diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb deleted file mode 100644 index ad025ce2f9bc..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/cloud_tpu_pb" -require "google/cloud/tpu/v1/cloud_tpu_services_pb" -require "google/cloud/tpu/v1/tpu" - -class ::Google::Cloud::Tpu::V1::Tpu::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb deleted file mode 100644 index 4ceac4e2e690..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/tpu" - -class ::Google::Cloud::Tpu::V1::Tpu::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_accelerator_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.accelerator_type_path project: "value0", location: "value1", accelerator_type: "value2" - assert_equal "projects/value0/locations/value1/acceleratorTypes/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::Tpu::V1::Tpu::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_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.node_path project: "value0", location: "value1", node: "value2" - assert_equal "projects/value0/locations/value1/nodes/value2", path - end - end - - def test_tensor_flow_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tensor_flow_version_path project: "value0", location: "value1", tensor_flow_version: "value2" - assert_equal "projects/value0/locations/value1/tensorFlowVersions/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb b/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb deleted file mode 100644 index 96dc840e4d05..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/google/cloud/tpu/v1/tpu_test.rb +++ /dev/null @@ -1,822 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu/v1/cloud_tpu_pb" -require "google/cloud/tpu/v1/tpu" - -class ::Google::Cloud::Tpu::V1::Tpu::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_nodes - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tpu::V1::ListNodesResponse.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_nodes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_nodes, name - assert_kind_of ::Google::Cloud::Tpu::V1::ListNodesRequest, 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_nodes_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_nodes({ 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_nodes 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_nodes ::Google::Cloud::Tpu::V1::ListNodesRequest.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_nodes({ 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_nodes(::Google::Cloud::Tpu::V1::ListNodesRequest.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_nodes_client_stub.call_rpc_count - end - end - - def test_get_node - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tpu::V1::Node.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_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_node, name - assert_kind_of ::Google::Cloud::Tpu::V1::GetNodeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_node_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_node({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_node name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_node ::Google::Cloud::Tpu::V1::GetNodeRequest.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({ 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(::Google::Cloud::Tpu::V1::GetNodeRequest.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_client_stub.call_rpc_count - end - end - - def test_create_node - # 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_id = "hello world" - node = {} - - create_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_node, name - assert_kind_of ::Google::Cloud::Tpu::V1::CreateNodeRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["node_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Tpu::V1::Node), request["node"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_node_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_node({ parent: parent, node_id: node_id, node: node }) 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 parent: parent, node_id: node_id, node: node 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 ::Google::Cloud::Tpu::V1::CreateNodeRequest.new(parent: parent, node_id: node_id, node: node) 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({ parent: parent, node_id: node_id, node: node }, 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(::Google::Cloud::Tpu::V1::CreateNodeRequest.new(parent: parent, node_id: node_id, node: node), 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_client_stub.call_rpc_count - end - end - - def test_delete_node - # 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" - - delete_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_node, name - assert_kind_of ::Google::Cloud::Tpu::V1::DeleteNodeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_node_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_node({ 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.delete_node 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.delete_node ::Google::Cloud::Tpu::V1::DeleteNodeRequest.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.delete_node({ 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.delete_node(::Google::Cloud::Tpu::V1::DeleteNodeRequest.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, delete_node_client_stub.call_rpc_count - end - end - - def test_reimage_node - # 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" - tensorflow_version = "hello world" - - reimage_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reimage_node, name - assert_kind_of ::Google::Cloud::Tpu::V1::ReimageNodeRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["tensorflow_version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reimage_node_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reimage_node({ name: name, tensorflow_version: tensorflow_version }) 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.reimage_node name: name, tensorflow_version: tensorflow_version 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.reimage_node ::Google::Cloud::Tpu::V1::ReimageNodeRequest.new(name: name, tensorflow_version: tensorflow_version) 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.reimage_node({ name: name, tensorflow_version: tensorflow_version }, 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.reimage_node(::Google::Cloud::Tpu::V1::ReimageNodeRequest.new(name: name, tensorflow_version: tensorflow_version), 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, reimage_node_client_stub.call_rpc_count - end - end - - def test_stop_node - # 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" - - stop_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_node, name - assert_kind_of ::Google::Cloud::Tpu::V1::StopNodeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_node_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_node({ 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.stop_node 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.stop_node ::Google::Cloud::Tpu::V1::StopNodeRequest.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.stop_node({ 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.stop_node(::Google::Cloud::Tpu::V1::StopNodeRequest.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, stop_node_client_stub.call_rpc_count - end - end - - def test_start_node - # 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" - - start_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_node, name - assert_kind_of ::Google::Cloud::Tpu::V1::StartNodeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_node_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_node({ 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.start_node 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.start_node ::Google::Cloud::Tpu::V1::StartNodeRequest.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.start_node({ 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.start_node(::Google::Cloud::Tpu::V1::StartNodeRequest.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, start_node_client_stub.call_rpc_count - end - end - - def test_list_tensor_flow_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsResponse.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_tensor_flow_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tensor_flow_versions, name - assert_kind_of ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest, 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_tensor_flow_versions_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tensor_flow_versions({ 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_tensor_flow_versions 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_tensor_flow_versions ::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.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_tensor_flow_versions({ 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_tensor_flow_versions(::Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.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_tensor_flow_versions_client_stub.call_rpc_count - end - end - - def test_get_tensor_flow_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tpu::V1::TensorFlowVersion.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_tensor_flow_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tensor_flow_version, name - assert_kind_of ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tensor_flow_version_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_tensor_flow_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_tensor_flow_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_tensor_flow_version ::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_tensor_flow_version({ 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_tensor_flow_version(::Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.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_tensor_flow_version_client_stub.call_rpc_count - end - end - - def test_list_accelerator_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tpu::V1::ListAcceleratorTypesResponse.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_accelerator_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_accelerator_types, name - assert_kind_of ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest, 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_accelerator_types_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_accelerator_types({ 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_accelerator_types 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_accelerator_types ::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.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_accelerator_types({ 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_accelerator_types(::Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.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_accelerator_types_client_stub.call_rpc_count - end - end - - def test_get_accelerator_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Tpu::V1::AcceleratorType.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_accelerator_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_accelerator_type, name - assert_kind_of ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_accelerator_type_client_stub do - # Create client - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_accelerator_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_accelerator_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_accelerator_type ::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_accelerator_type({ 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_accelerator_type(::Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.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_accelerator_type_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::Tpu::V1::Tpu::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::Tpu::V1::Tpu::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Tpu::V1::Tpu::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Tpu::V1::Tpu::Client, client - assert_equal creds, client.configure.credentials - end - 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::Tpu::V1::Tpu::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Tpu::V1::Tpu::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb b/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-tpu-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-tpu/.gitignore b/owl-bot-staging/google-cloud-tpu/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-tpu/.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-tpu/.repo-metadata.json b/owl-bot-staging/google-cloud-tpu/.repo-metadata.json deleted file mode 100644 index 7a404d7edb34..000000000000 --- a/owl-bot-staging/google-cloud-tpu/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "tpu.googleapis.com", - "api_shortname": "tpu", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-tpu/latest", - "distribution_name": "google-cloud-tpu", - "is_cloud": true, - "language": "ruby", - "name": "tpu", - "name_pretty": "Cloud TPU API", - "product_documentation": "https://cloud.google.com/tpu/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform.", - "ruby-cloud-env-prefix": "CLOUD_TPU", - "ruby-cloud-product-url": "https://cloud.google.com/tpu/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-tpu/.rubocop.yml b/owl-bot-staging/google-cloud-tpu/.rubocop.yml deleted file mode 100644 index bb2820bfb3e1..000000000000 --- a/owl-bot-staging/google-cloud-tpu/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-tpu.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-tpu.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-tpu/.toys.rb b/owl-bot-staging/google-cloud-tpu/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-tpu/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-tpu/.yardopts b/owl-bot-staging/google-cloud-tpu/.yardopts deleted file mode 100644 index 159a9a920b2c..000000000000 --- a/owl-bot-staging/google-cloud-tpu/.yardopts +++ /dev/null @@ -1,11 +0,0 @@ ---no-private ---title="Cloud TPU API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md b/owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md deleted file mode 100644 index 42020570ba11..000000000000 --- a/owl-bot-staging/google-cloud-tpu/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-tpu 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-tpu 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/tpu" - -client = Google::Cloud::Tpu.tpu do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/tpu" - -Google::Cloud::Tpu.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Tpu.tpu -``` - -### 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-tpu -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/tpu" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Tpu.tpu -``` - -### 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-tpu/CHANGELOG.md b/owl-bot-staging/google-cloud-tpu/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-tpu/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-tpu/Gemfile b/owl-bot-staging/google-cloud-tpu/Gemfile deleted file mode 100644 index 8db1745a6566..000000000000 --- a/owl-bot-staging/google-cloud-tpu/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-tpu-v1"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-tpu.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.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-tpu/LICENSE.md b/owl-bot-staging/google-cloud-tpu/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-tpu/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-tpu/README.md b/owl-bot-staging/google-cloud-tpu/README.md deleted file mode 100644 index d3f1b3ca10fd..000000000000 --- a/owl-bot-staging/google-cloud-tpu/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Ruby Client for the Cloud TPU API - -API Client library for the Cloud TPU API - -Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-tpu-v*`. -The gem `google-cloud-tpu` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu/latest) -for this library, google-cloud-tpu, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-tpu-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest). - -See also the [Product Documentation](https://cloud.google.com/tpu/) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-tpu -``` - -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/tpu.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/tpu" - -client = Google::Cloud::Tpu.tpu -request = ::Google::Cloud::Tpu::V1::ListNodesRequest.new # (request fields as keyword arguments...) -response = client.list_nodes request -``` - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-tpu-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -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-tpu`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-tpu-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-tpu`. -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-tpu-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-tpu/Rakefile b/owl-bot-staging/google-cloud-tpu/Rakefile deleted file mode 100644 index 3db6f8becfe3..000000000000 --- a/owl-bot-staging/google-cloud-tpu/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true -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-tpu acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["CLOUD_TPU_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["CLOUD_TPU_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["CLOUD_TPU_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 CLOUD_TPU_TEST_PROJECT=test123 CLOUD_TPU_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/tpu/v1/tpu/credentials" - ::Google::Cloud::Tpu::V1::Tpu::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["CLOUD_TPU_PROJECT"] = project - ENV["CLOUD_TPU_TEST_PROJECT"] = project - ENV["CLOUD_TPU_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-tpu 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-tpu 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-tpu 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-tpu gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-tpu" - header "google-cloud-tpu rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-tpu yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-tpu 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-tpu 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-tpu 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-tpu/google-cloud-tpu.gemspec b/owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec deleted file mode 100644 index 781768c20cac..000000000000 --- a/owl-bot-staging/google-cloud-tpu/google-cloud-tpu.gemspec +++ /dev/null @@ -1,27 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/tpu/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-tpu" - gem.version = Google::Cloud::Tpu::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Tensor Processing Units (TPUs) are Google's custom-developed application-specific integrated circuits (ASICs) used to accelerate machine learning workloads. Cloud TPUs allow you to access TPUs from Compute Engine, Google Kubernetes Engine and AI Platform." - gem.summary = "API Client library for the Cloud TPU API" - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-tpu-v1", ">= 0.6", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb b/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb deleted file mode 100644 index 99f9595ff472..000000000000 --- a/owl-bot-staging/google-cloud-tpu/lib/google-cloud-tpu.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/tpu" unless defined? Google::Cloud::Tpu::VERSION diff --git a/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb deleted file mode 100644 index b57a41a50a01..000000000000 --- a/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu.rb +++ /dev/null @@ -1,149 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/tpu/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :tpu do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Tpu - ## - # Create a new client object for Tpu. - # - # By default, this returns an instance of - # [Google::Cloud::Tpu::V1::Tpu::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-tpu-v1/latest/Google-Cloud-Tpu-V1-Tpu-Client) - # for a gRPC client for version V1 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the Tpu service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the Tpu service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Tpu.tpu_available?}. - # - # ## About Tpu - # - # Manages TPU nodes and other resources - # - # TPU API v1 - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [::Object] A client object for the specified version. - # - def self.tpu version: :v1, &block - require "google/cloud/tpu/#{version.to_s.downcase}" - - package_name = Google::Cloud::Tpu - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Tpu.const_get(package_name).const_get(:Tpu) - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the Tpu service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Tpu.tpu}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the Tpu service, - # or if the versioned client gem needs an update to support the Tpu service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v1`. - # @return [boolean] Whether the service is available. - # - def self.tpu_available? version: :v1 - require "google/cloud/tpu/#{version.to_s.downcase}" - package_name = Google::Cloud::Tpu - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Tpu.const_get package_name - return false unless service_module.const_defined? :Tpu - service_module = service_module.const_get :Tpu - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-tpu library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.tpu if block_given? - - ::Google::Cloud.configure.tpu - end - end - end -end - -helper_path = ::File.join __dir__, "tpu", "helpers.rb" -require "google/cloud/tpu/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb b/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb deleted file mode 100644 index 7008c26acfae..000000000000 --- a/owl-bot-staging/google-cloud-tpu/lib/google/cloud/tpu/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Tpu - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb b/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb deleted file mode 100644 index add90e3eddd7..000000000000 --- a/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/client_test.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tpu" -require "gapic/common" -require "gapic/grpc" - -class Google::Cloud::Tpu::ClientConstructionMinitest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_tpu_grpc - skip unless Google::Cloud::Tpu.tpu_available? - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Tpu.tpu do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Tpu::V1::Tpu::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb b/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb deleted file mode 100644 index 71fff0353b98..000000000000 --- a/owl-bot-staging/google-cloud-tpu/test/google/cloud/tpu/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/tpu/version" - -class Google::Cloud::Tpu::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Tpu::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-tpu/test/helper.rb b/owl-bot-staging/google-cloud-tpu/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-tpu/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-trace-v1/.gitignore b/owl-bot-staging/google-cloud-trace-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-trace-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-trace-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-trace-v1/.repo-metadata.json deleted file mode 100644 index d328c585f392..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudtrace.googleapis.com", - "api_shortname": "cloudtrace", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v1/latest", - "distribution_name": "google-cloud-trace-v1", - "is_cloud": true, - "language": "ruby", - "name": "cloudtrace", - "name_pretty": "Cloud Trace V1 API", - "product_documentation": "https://cloud.google.com/trace", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TRACE", - "ruby-cloud-product-url": "https://cloud.google.com/trace", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-trace-v1/.rubocop.yml b/owl-bot-staging/google-cloud-trace-v1/.rubocop.yml deleted file mode 100644 index 497c946242fd..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-trace-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-trace-v1.rb" diff --git a/owl-bot-staging/google-cloud-trace-v1/.toys.rb b/owl-bot-staging/google-cloud-trace-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/.yardopts b/owl-bot-staging/google-cloud-trace-v1/.yardopts deleted file mode 100644 index a9ea6aa99950..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Trace 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-trace-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-trace-v1/AUTHENTICATION.md deleted file mode 100644 index ce2edb9aa12f..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-trace-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-trace-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/trace/v1" - -client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/trace/v1" - -::Google::Cloud::Trace::V1::TraceService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Trace::V1::TraceService::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-trace-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/trace/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Trace::V1::TraceService::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-trace-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-trace-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-trace-v1/Gemfile b/owl-bot-staging/google-cloud-trace-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-trace-v1/LICENSE.md b/owl-bot-staging/google-cloud-trace-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-trace-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-trace-v1/README.md b/owl-bot-staging/google-cloud-trace-v1/README.md deleted file mode 100644 index 488c98aabfe3..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Trace V1 API - -Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry. - -The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. - -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 Trace V1 API. Most users should consider using -the main client gem, -[google-cloud-trace](https://rubygems.org/gems/google-cloud-trace). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-trace-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/cloudtrace.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/trace/v1" - -client = ::Google::Cloud::Trace::V1::TraceService::Client.new -request = ::Google::Cloud::Trace::V1::ListTracesRequest.new # (request fields as keyword arguments...) -response = client.list_traces request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/trace) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/trace/v1" -require "logger" - -client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-trace`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-trace-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-trace`. -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-trace-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-trace-v1/Rakefile b/owl-bot-staging/google-cloud-trace-v1/Rakefile deleted file mode 100644 index 663b8d0b3857..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TRACE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TRACE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TRACE_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 TRACE_TEST_PROJECT=test123 TRACE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/trace/v1/trace_service/credentials" - ::Google::Cloud::Trace::V1::TraceService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TRACE_PROJECT"] = project - ENV["TRACE_TEST_PROJECT"] = project - ENV["TRACE_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-trace-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-trace-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-trace-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-trace-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-trace-v1" - header "google-cloud-trace-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-trace-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-trace-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-trace-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-trace-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-trace-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-trace-v1/gapic_metadata.json deleted file mode 100644 index c869538c2a6c..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.devtools.cloudtrace.v1", - "libraryPackage": "::Google::Cloud::Trace::V1", - "services": { - "TraceService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Trace::V1::TraceService::Client", - "rpcs": { - "ListTraces": { - "methods": [ - "list_traces" - ] - }, - "GetTrace": { - "methods": [ - "get_trace" - ] - }, - "PatchTraces": { - "methods": [ - "patch_traces" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec b/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec deleted file mode 100644 index c9e4cd057fe9..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/google-cloud-trace-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/trace/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-trace-v1" - gem.version = Google::Cloud::Trace::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details." - gem.summary = "Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb deleted file mode 100644 index d0d18e420960..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google-cloud-trace-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1" diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb deleted file mode 100644 index bdd9cdacfccf..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/trace_service" -require "google/cloud/trace/v1/version" - -module Google - module Cloud - module Trace - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/trace/v1" - # client = ::Google::Cloud::Trace::V1::TraceService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/trace/v1" - # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/trace/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb deleted file mode 100644 index 9e774bceaca2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/trace_service/rest" -require "google/cloud/trace/v1/version" - -module Google - module Cloud - module Trace - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/trace/v1/rest" - # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb deleted file mode 100644 index 4f7face77bb1..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/version" - -require "google/cloud/trace/v1/trace_service/credentials" -require "google/cloud/trace/v1/trace_service/client" -require "google/cloud/trace/v1/trace_service/rest" - -module Google - module Cloud - module Trace - module V1 - ## - # This file describes an API for collecting and viewing traces and spans - # within a trace. A Trace is a collection of spans corresponding to a single - # operation or set of operations for an application. A span is an individual - # timed event which forms a node of the trace tree. Spans for a single trace - # may span multiple services. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/trace/v1/trace_service" - # client = ::Google::Cloud::Trace::V1::TraceService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/trace/v1/trace_service/rest" - # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - module TraceService - end - end - end - end -end - -helper_path = ::File.join __dir__, "trace_service", "helpers.rb" -require "google/cloud/trace/v1/trace_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb deleted file mode 100644 index 14e8613b2622..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/client.rb +++ /dev/null @@ -1,753 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" - -module Google - module Cloud - module Trace - module V1 - module TraceService - ## - # Client for the TraceService service. - # - # This file describes an API for collecting and viewing traces and spans - # within a trace. A Trace is a collection of spans corresponding to a single - # operation or set of operations for an application. A span is an individual - # timed event which forms a node of the trace tree. Spans for a single trace - # may span multiple services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :trace_service_stub - - ## - # Configure the TraceService Client class. - # - # See {::Google::Cloud::Trace::V1::TraceService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TraceService clients - # ::Google::Cloud::Trace::V1::TraceService::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", "Trace", "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.list_traces.timeout = 45.0 - default_config.rpcs.list_traces.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config.rpcs.get_trace.timeout = 45.0 - default_config.rpcs.get_trace.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config.rpcs.patch_traces.timeout = 45.0 - default_config.rpcs.patch_traces.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TraceService 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::Trace::V1::TraceService::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 - @trace_service_stub.universe_domain - end - - ## - # Create a new TraceService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Trace::V1::TraceService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TraceService 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/devtools/cloudtrace/v1/trace_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 - - @trace_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Trace::V1::TraceService::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, - logger: @config.logger - ) - - @trace_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @trace_service_stub.logger - end - - # Service calls - - ## - # Returns of a list of traces that match the specified filter conditions. - # - # @overload list_traces(request, options = nil) - # Pass arguments to `list_traces` via a request object, either of type - # {::Google::Cloud::Trace::V1::ListTracesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V1::ListTracesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_traces(project_id: nil, view: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil, filter: nil, order_by: nil) - # Pass arguments to `list_traces` via keyword arguments. Note that at - # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. - # @param view [::Google::Cloud::Trace::V1::ListTracesRequest::ViewType] - # Optional. Type of data returned for traces in the list. Default is - # `MINIMAL`. - # @param page_size [::Integer] - # Optional. Maximum number of traces to return. If not specified or <= 0, the - # implementation selects a reasonable value. The implementation may - # return fewer traces than the requested page size. - # @param page_token [::String] - # Token identifying the page of results to return. If provided, use the - # value of the `next_page_token` field from a previous request. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Start of the time interval (inclusive) during which the trace data was - # collected from the application. - # @param end_time [::Google::Protobuf::Timestamp, ::Hash] - # End of the time interval (inclusive) during which the trace data was - # collected from the application. - # @param filter [::String] - # Optional. A filter against labels for the request. - # - # By default, searches use prefix matching. To specify exact match, prepend - # a plus symbol (`+`) to the search term. - # Multiple terms are ANDed. Syntax: - # - # * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root - # span starts with `NAME_PREFIX`. - # * `+root:NAME` or `+NAME`: Return traces where any root span's name is - # exactly `NAME`. - # * `span:NAME_PREFIX`: Return traces where any span starts with - # `NAME_PREFIX`. - # * `+span:NAME`: Return traces where any span's name is exactly - # `NAME`. - # * `latency:DURATION`: Return traces whose overall latency is - # greater or equal to than `DURATION`. Accepted units are nanoseconds - # (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For - # example, `latency:24ms` returns traces whose overall latency - # is greater than or equal to 24 milliseconds. - # * `label:LABEL_KEY`: Return all traces containing the specified - # label key (exact match, case-sensitive) regardless of the key:value - # pair's value (including empty values). - # * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified - # label key (exact match, case-sensitive) whose value starts with - # `VALUE_PREFIX`. Both a key and a value must be specified. - # * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair - # exactly matching the specified text. Both a key and a value must be - # specified. - # * `method:VALUE`: Equivalent to `/http/method:VALUE`. - # * `url:VALUE`: Equivalent to `/http/url:VALUE`. - # @param order_by [::String] - # Optional. Field used to sort the returned traces. - # Can be one of the following: - # - # * `trace_id` - # * `name` (`name` field of root span in the trace) - # * `duration` (difference between `end_time` and `start_time` fields of - # the root span) - # * `start` (`start_time` field of the root span) - # - # Descending order can be specified by appending `desc` to the sort field - # (for example, `name desc`). - # - # Only one sort field is permitted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/trace/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V1::TraceService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V1::ListTracesRequest.new - # - # # Call the list_traces method. - # result = client.list_traces 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::Trace::V1::Trace. - # p item - # end - # - def list_traces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::ListTracesRequest - - # Converts hash 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_traces.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::Trace::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 - - 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_traces.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_traces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.call_rpc :list_traces, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @trace_service_stub, :list_traces, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a single trace by its ID. - # - # @overload get_trace(request, options = nil) - # Pass arguments to `get_trace` via a request object, either of type - # {::Google::Cloud::Trace::V1::GetTraceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V1::GetTraceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_trace(project_id: nil, trace_id: nil) - # Pass arguments to `get_trace` via keyword arguments. Note that at - # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. - # @param trace_id [::String] - # Required. ID of the trace to return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Trace::V1::Trace] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Trace::V1::Trace] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/trace/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V1::TraceService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V1::GetTraceRequest.new - # - # # Call the get_trace method. - # result = client.get_trace request - # - # # The returned object is of type Google::Cloud::Trace::V1::Trace. - # p result - # - def get_trace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::GetTraceRequest - - # Converts hash 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_trace.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::Trace::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.trace_id - header_params["trace_id"] = request.trace_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_trace.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_trace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.call_rpc :get_trace, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sends new traces to Stackdriver Trace or updates existing traces. If the ID - # of a trace that you send matches that of an existing trace, any fields - # in the existing trace and its spans are overwritten by the provided values, - # and any new fields provided are merged with the existing trace data. If the - # ID does not match, a new trace is created. - # - # @overload patch_traces(request, options = nil) - # Pass arguments to `patch_traces` via a request object, either of type - # {::Google::Cloud::Trace::V1::PatchTracesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V1::PatchTracesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload patch_traces(project_id: nil, traces: nil) - # Pass arguments to `patch_traces` via keyword arguments. Note that at - # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. - # @param traces [::Google::Cloud::Trace::V1::Traces, ::Hash] - # Required. The body of the message. - # - # @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/trace/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V1::TraceService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V1::PatchTracesRequest.new - # - # # Call the patch_traces method. - # result = client.patch_traces request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def patch_traces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::PatchTracesRequest - - # Converts hash 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.patch_traces.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::Trace::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 - - 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.patch_traces.timeout, - metadata: metadata, - retry_policy: @config.rpcs.patch_traces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.call_rpc :patch_traces, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TraceService API. - # - # This class represents the configuration for TraceService, - # 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::Trace::V1::TraceService::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_traces to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Trace::V1::TraceService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_traces.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_traces.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TraceService 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_traces` - # @return [::Gapic::Config::Method] - # - attr_reader :list_traces - ## - # RPC-specific configuration for `get_trace` - # @return [::Gapic::Config::Method] - # - attr_reader :get_trace - ## - # RPC-specific configuration for `patch_traces` - # @return [::Gapic::Config::Method] - # - attr_reader :patch_traces - - # @private - def initialize parent_rpcs = nil - list_traces_config = parent_rpcs.list_traces if parent_rpcs.respond_to? :list_traces - @list_traces = ::Gapic::Config::Method.new list_traces_config - get_trace_config = parent_rpcs.get_trace if parent_rpcs.respond_to? :get_trace - @get_trace = ::Gapic::Config::Method.new get_trace_config - patch_traces_config = parent_rpcs.patch_traces if parent_rpcs.respond_to? :patch_traces - @patch_traces = ::Gapic::Config::Method.new patch_traces_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb deleted file mode 100644 index b71df52a528b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/credentials.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V1 - module TraceService - # Credentials for the TraceService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.append", - "https://www.googleapis.com/auth/trace.readonly" - ] - self.env_vars = [ - "TRACE_CREDENTIALS", - "TRACE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TRACE_CREDENTIALS_JSON", - "TRACE_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-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb deleted file mode 100644 index 5de97dd38be4..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v1/version" - -require "google/cloud/trace/v1/trace_service/credentials" -require "google/cloud/trace/v1/trace_service/rest/client" - -module Google - module Cloud - module Trace - module V1 - ## - # This file describes an API for collecting and viewing traces and spans - # within a trace. A Trace is a collection of spans corresponding to a single - # operation or set of operations for an application. A span is an individual - # timed event which forms a node of the trace tree. Spans for a single trace - # may span multiple services. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/trace/v1/trace_service/rest" - # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - module TraceService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/trace/v1/trace_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb deleted file mode 100644 index b3a5a3771116..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/client.rb +++ /dev/null @@ -1,686 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" -require "google/cloud/trace/v1/trace_service/rest/service_stub" - -module Google - module Cloud - module Trace - module V1 - module TraceService - module Rest - ## - # REST client for the TraceService service. - # - # This file describes an API for collecting and viewing traces and spans - # within a trace. A Trace is a collection of spans corresponding to a single - # operation or set of operations for an application. A span is an individual - # timed event which forms a node of the trace tree. Spans for a single trace - # may span multiple services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :trace_service_stub - - ## - # Configure the TraceService Client class. - # - # See {::Google::Cloud::Trace::V1::TraceService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TraceService clients - # ::Google::Cloud::Trace::V1::TraceService::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", "Trace", "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.list_traces.timeout = 45.0 - default_config.rpcs.list_traces.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config.rpcs.get_trace.timeout = 45.0 - default_config.rpcs.get_trace.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config.rpcs.patch_traces.timeout = 45.0 - default_config.rpcs.patch_traces.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TraceService 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::Trace::V1::TraceService::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 - @trace_service_stub.universe_domain - end - - ## - # Create a new TraceService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TraceService 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 - - @trace_service_stub = ::Google::Cloud::Trace::V1::TraceService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @trace_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @trace_service_stub.logger - end - - # Service calls - - ## - # Returns of a list of traces that match the specified filter conditions. - # - # @overload list_traces(request, options = nil) - # Pass arguments to `list_traces` via a request object, either of type - # {::Google::Cloud::Trace::V1::ListTracesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V1::ListTracesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_traces(project_id: nil, view: nil, page_size: nil, page_token: nil, start_time: nil, end_time: nil, filter: nil, order_by: nil) - # Pass arguments to `list_traces` via keyword arguments. Note that at - # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. - # @param view [::Google::Cloud::Trace::V1::ListTracesRequest::ViewType] - # Optional. Type of data returned for traces in the list. Default is - # `MINIMAL`. - # @param page_size [::Integer] - # Optional. Maximum number of traces to return. If not specified or <= 0, the - # implementation selects a reasonable value. The implementation may - # return fewer traces than the requested page size. - # @param page_token [::String] - # Token identifying the page of results to return. If provided, use the - # value of the `next_page_token` field from a previous request. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Start of the time interval (inclusive) during which the trace data was - # collected from the application. - # @param end_time [::Google::Protobuf::Timestamp, ::Hash] - # End of the time interval (inclusive) during which the trace data was - # collected from the application. - # @param filter [::String] - # Optional. A filter against labels for the request. - # - # By default, searches use prefix matching. To specify exact match, prepend - # a plus symbol (`+`) to the search term. - # Multiple terms are ANDed. Syntax: - # - # * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root - # span starts with `NAME_PREFIX`. - # * `+root:NAME` or `+NAME`: Return traces where any root span's name is - # exactly `NAME`. - # * `span:NAME_PREFIX`: Return traces where any span starts with - # `NAME_PREFIX`. - # * `+span:NAME`: Return traces where any span's name is exactly - # `NAME`. - # * `latency:DURATION`: Return traces whose overall latency is - # greater or equal to than `DURATION`. Accepted units are nanoseconds - # (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For - # example, `latency:24ms` returns traces whose overall latency - # is greater than or equal to 24 milliseconds. - # * `label:LABEL_KEY`: Return all traces containing the specified - # label key (exact match, case-sensitive) regardless of the key:value - # pair's value (including empty values). - # * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified - # label key (exact match, case-sensitive) whose value starts with - # `VALUE_PREFIX`. Both a key and a value must be specified. - # * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair - # exactly matching the specified text. Both a key and a value must be - # specified. - # * `method:VALUE`: Equivalent to `/http/method:VALUE`. - # * `url:VALUE`: Equivalent to `/http/url:VALUE`. - # @param order_by [::String] - # Optional. Field used to sort the returned traces. - # Can be one of the following: - # - # * `trace_id` - # * `name` (`name` field of root span in the trace) - # * `duration` (difference between `end_time` and `start_time` fields of - # the root span) - # * `start` (`start_time` field of the root span) - # - # Descending order can be specified by appending `desc` to the sort field - # (for example, `name desc`). - # - # Only one sort field is permitted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Trace::V1::Trace>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/trace/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V1::ListTracesRequest.new - # - # # Call the list_traces method. - # result = client.list_traces 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::Trace::V1::Trace. - # p item - # end - # - def list_traces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::ListTracesRequest - - # Converts hash 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_traces.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::Trace::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_traces.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_traces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.list_traces request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @trace_service_stub, :list_traces, "traces", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a single trace by its ID. - # - # @overload get_trace(request, options = nil) - # Pass arguments to `get_trace` via a request object, either of type - # {::Google::Cloud::Trace::V1::GetTraceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V1::GetTraceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_trace(project_id: nil, trace_id: nil) - # Pass arguments to `get_trace` via keyword arguments. Note that at - # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. - # @param trace_id [::String] - # Required. ID of the trace to return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Trace::V1::Trace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Trace::V1::Trace] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/trace/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V1::GetTraceRequest.new - # - # # Call the get_trace method. - # result = client.get_trace request - # - # # The returned object is of type Google::Cloud::Trace::V1::Trace. - # p result - # - def get_trace request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::GetTraceRequest - - # Converts hash 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_trace.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::Trace::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_trace.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_trace.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.get_trace request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sends new traces to Stackdriver Trace or updates existing traces. If the ID - # of a trace that you send matches that of an existing trace, any fields - # in the existing trace and its spans are overwritten by the provided values, - # and any new fields provided are merged with the existing trace data. If the - # ID does not match, a new trace is created. - # - # @overload patch_traces(request, options = nil) - # Pass arguments to `patch_traces` via a request object, either of type - # {::Google::Cloud::Trace::V1::PatchTracesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V1::PatchTracesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload patch_traces(project_id: nil, traces: nil) - # Pass arguments to `patch_traces` via keyword arguments. Note that at - # least one keyword argument is 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. ID of the Cloud project where the trace data is stored. - # @param traces [::Google::Cloud::Trace::V1::Traces, ::Hash] - # Required. The body of the message. - # @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/trace/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V1::TraceService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V1::PatchTracesRequest.new - # - # # Call the patch_traces method. - # result = client.patch_traces request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def patch_traces request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V1::PatchTracesRequest - - # Converts hash 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.patch_traces.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::Trace::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.patch_traces.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.patch_traces.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.patch_traces request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TraceService REST API. - # - # This class represents the configuration for TraceService 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::Trace::V1::TraceService::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_traces to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Trace::V1::TraceService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_traces.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_traces.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TraceService 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_traces` - # @return [::Gapic::Config::Method] - # - attr_reader :list_traces - ## - # RPC-specific configuration for `get_trace` - # @return [::Gapic::Config::Method] - # - attr_reader :get_trace - ## - # RPC-specific configuration for `patch_traces` - # @return [::Gapic::Config::Method] - # - attr_reader :patch_traces - - # @private - def initialize parent_rpcs = nil - list_traces_config = parent_rpcs.list_traces if parent_rpcs.respond_to? :list_traces - @list_traces = ::Gapic::Config::Method.new list_traces_config - get_trace_config = parent_rpcs.get_trace if parent_rpcs.respond_to? :get_trace - @get_trace = ::Gapic::Config::Method.new get_trace_config - patch_traces_config = parent_rpcs.patch_traces if parent_rpcs.respond_to? :patch_traces - @patch_traces = ::Gapic::Config::Method.new patch_traces_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb deleted file mode 100644 index 68870f715db3..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/trace_service/rest/service_stub.rb +++ /dev/null @@ -1,266 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" - -module Google - module Cloud - module Trace - module V1 - module TraceService - module Rest - ## - # REST service stub for the TraceService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_traces REST call - # - # @param request_pb [::Google::Cloud::Trace::V1::ListTracesRequest] - # 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::Trace::V1::ListTracesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Trace::V1::ListTracesResponse] - # A result object deserialized from the server's reply - def list_traces request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_traces_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, - method_name: "list_traces", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Trace::V1::ListTracesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_trace REST call - # - # @param request_pb [::Google::Cloud::Trace::V1::GetTraceRequest] - # 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::Trace::V1::Trace] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Trace::V1::Trace] - # A result object deserialized from the server's reply - def get_trace request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_trace_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, - method_name: "get_trace", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Trace::V1::Trace.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the patch_traces REST call - # - # @param request_pb [::Google::Cloud::Trace::V1::PatchTracesRequest] - # 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 patch_traces request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_patch_traces_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, - method_name: "patch_traces", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_traces REST call - # - # @param request_pb [::Google::Cloud::Trace::V1::ListTracesRequest] - # 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_traces_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/projects/{project_id}/traces", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_trace REST call - # - # @param request_pb [::Google::Cloud::Trace::V1::GetTraceRequest] - # 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_trace_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/projects/{project_id}/traces/{trace_id}", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["trace_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the patch_traces REST call - # - # @param request_pb [::Google::Cloud::Trace::V1::PatchTracesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_patch_traces_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/projects/{project_id}/traces", - body: "traces", - matches: [ - ["project_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb deleted file mode 100644 index 57e91ef8eec8..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/cloud/trace/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb deleted file mode 100644 index dc5fca602562..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudtrace/v1/trace.proto - -require 'google/protobuf' - -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' -require 'google/api/annotations_pb' - - -descriptor_data = "\n)google/devtools/cloudtrace/v1/trace.proto\x12\x1dgoogle.devtools.cloudtrace.v1\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto\"f\n\x05Trace\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x10\n\x08trace_id\x18\x02 \x01(\t\x12\x37\n\x05spans\x18\x03 \x03(\x0b\x32(.google.devtools.cloudtrace.v1.TraceSpan\">\n\x06Traces\x12\x34\n\x06traces\x18\x01 \x03(\x0b\x32$.google.devtools.cloudtrace.v1.Trace\"\xa2\x03\n\tTraceSpan\x12\x0f\n\x07span_id\x18\x01 \x01(\x06\x12?\n\x04kind\x18\x02 \x01(\x0e\x32\x31.google.devtools.cloudtrace.v1.TraceSpan.SpanKind\x12\x0c\n\x04name\x18\x03 \x01(\t\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x0eparent_span_id\x18\x06 \x01(\x06\x42\x03\xe0\x41\x01\x12\x44\n\x06labels\x18\x07 \x03(\x0b\x32\x34.google.devtools.cloudtrace.v1.TraceSpan.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x0e\n\nRPC_SERVER\x10\x01\x12\x0e\n\nRPC_CLIENT\x10\x02\"\x80\x03\n\x11ListTracesRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x04view\x18\x02 \x01(\x0e\x32\x39.google.devtools.cloudtrace.v1.ListTracesRequest.ViewTypeB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x04 \x01(\t\x12.\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x06\x66ilter\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x08 \x01(\tB\x03\xe0\x41\x01\"N\n\x08ViewType\x12\x19\n\x15VIEW_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MINIMAL\x10\x01\x12\x0c\n\x08ROOTSPAN\x10\x02\x12\x0c\n\x08\x43OMPLETE\x10\x03\"c\n\x12ListTracesResponse\x12\x34\n\x06traces\x18\x01 \x03(\x0b\x32$.google.devtools.cloudtrace.v1.Trace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"A\n\x0fGetTraceRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08trace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"i\n\x12PatchTracesRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06traces\x18\x02 \x01(\x0b\x32%.google.devtools.cloudtrace.v1.TracesB\x03\xe0\x41\x02\x32\xb5\x05\n\x0cTraceService\x12\xa8\x01\n\nListTraces\x12\x30.google.devtools.cloudtrace.v1.ListTracesRequest\x1a\x31.google.devtools.cloudtrace.v1.ListTracesResponse\"5\xda\x41\nproject_id\x82\xd3\xe4\x93\x02\"\x12 /v1/projects/{project_id}/traces\x12\xab\x01\n\x08GetTrace\x12..google.devtools.cloudtrace.v1.GetTraceRequest\x1a$.google.devtools.cloudtrace.v1.Trace\"I\xda\x41\x13project_id,trace_id\x82\xd3\xe4\x93\x02-\x12+/v1/projects/{project_id}/traces/{trace_id}\x12\x9e\x01\n\x0bPatchTraces\x12\x31.google.devtools.cloudtrace.v1.PatchTracesRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x11project_id,traces\x82\xd3\xe4\x93\x02*2 /v1/projects/{project_id}/traces:\x06traces\x1a\xaa\x01\xca\x41\x19\x63loudtrace.googleapis.com\xd2\x41\x8a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/trace.readonlyB\xad\x01\n!com.google.devtools.cloudtrace.v1B\nTraceProtoP\x01Z/cloud.google.com/go/trace/apiv1/tracepb;tracepb\xaa\x02\x15Google.Cloud.Trace.V1\xca\x02\x15Google\\Cloud\\Trace\\V1\xea\x02\x18Google::Cloud::Trace::V1b\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 Trace - module V1 - Trace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Trace").msgclass - Traces = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.Traces").msgclass - TraceSpan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan").msgclass - TraceSpan::SpanKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.TraceSpan.SpanKind").enummodule - ListTracesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest").msgclass - ListTracesRequest::ViewType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesRequest.ViewType").enummodule - ListTracesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.ListTracesResponse").msgclass - GetTraceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.GetTraceRequest").msgclass - PatchTracesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v1.PatchTracesRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb b/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb deleted file mode 100644 index 56320be47991..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/lib/google/devtools/cloudtrace/v1/trace_services_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/devtools/cloudtrace/v1/trace.proto for package 'Google.Cloud.Trace.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/devtools/cloudtrace/v1/trace_pb' - -module Google - module Cloud - module Trace - module V1 - module TraceService - # This file describes an API for collecting and viewing traces and spans - # within a trace. A Trace is a collection of spans corresponding to a single - # operation or set of operations for an application. A span is an individual - # timed event which forms a node of the trace tree. Spans for a single trace - # may span multiple services. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.devtools.cloudtrace.v1.TraceService' - - # Returns of a list of traces that match the specified filter conditions. - rpc :ListTraces, ::Google::Cloud::Trace::V1::ListTracesRequest, ::Google::Cloud::Trace::V1::ListTracesResponse - # Gets a single trace by its ID. - rpc :GetTrace, ::Google::Cloud::Trace::V1::GetTraceRequest, ::Google::Cloud::Trace::V1::Trace - # Sends new traces to Stackdriver Trace or updates existing traces. If the ID - # of a trace that you send matches that of an existing trace, any fields - # in the existing trace and its spans are overwritten by the provided values, - # and any new fields provided are merged with the existing trace data. If the - # ID does not match, a new trace is created. - rpc :PatchTraces, ::Google::Cloud::Trace::V1::PatchTracesRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md deleted file mode 100644 index 8f04d0cc9e5b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Trace V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-trace-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb deleted file mode 100644 index f10fa9094e2d..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/devtools/cloudtrace/v1/trace.rb +++ /dev/null @@ -1,287 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V1 - # A trace describes how long it takes for an application to perform an - # operation. It consists of a set of spans, each of which represent a single - # timed event within the operation. - # @!attribute [rw] project_id - # @return [::String] - # Project ID of the Cloud project where the trace data is stored. - # @!attribute [rw] trace_id - # @return [::String] - # Globally unique identifier for the trace. This identifier is a 128-bit - # numeric value formatted as a 32-byte hex string. For example, - # `382d4f4c6b7bb2f4a972559d9085001d`. - # @!attribute [rw] spans - # @return [::Array<::Google::Cloud::Trace::V1::TraceSpan>] - # Collection of spans in the trace. - class Trace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List of new or updated traces. - # @!attribute [rw] traces - # @return [::Array<::Google::Cloud::Trace::V1::Trace>] - # List of traces. - class Traces - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A span represents a single timed event within a trace. Spans can be nested - # and form a trace tree. Often, a trace contains a root span that describes the - # end-to-end latency of an operation and, optionally, one or more subspans for - # its suboperations. Spans do not need to be contiguous. There may be gaps - # between spans in a trace. - # @!attribute [rw] span_id - # @return [::Integer] - # Identifier for the span. Must be a 64-bit integer other than 0 and - # unique within a trace. For example, `2205310701640571284`. - # @!attribute [rw] kind - # @return [::Google::Cloud::Trace::V1::TraceSpan::SpanKind] - # Distinguishes between spans generated in a particular context. For example, - # two spans with the same name may be distinguished using `RPC_CLIENT` - # and `RPC_SERVER` to identify queueing latency associated with the span. - # @!attribute [rw] name - # @return [::String] - # Name of the span. Must be less than 128 bytes. The span name is sanitized - # and displayed in the Stackdriver Trace tool in the - # Google Cloud Platform Console. - # The name may be a method name or some other per-call site name. - # For the same executable and the same call point, a best practice is - # to use a consistent name, which makes it easier to correlate - # cross-trace spans. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start time of the span in nanoseconds from the UNIX epoch. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End time of the span in nanoseconds from the UNIX epoch. - # @!attribute [rw] parent_span_id - # @return [::Integer] - # Optional. ID of the parent span, if any. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Collection of labels associated with the span. Label keys must be less than - # 128 bytes. Label values must be less than 16 kilobytes (10MB for - # `/stacktrace` values). - # - # Some predefined label keys exist, or you may create your own. When creating - # your own, we recommend the following formats: - # - # * `/category/product/key` for agents of well-known products (e.g. - # `/db/mongodb/read_size`). - # * `short_host/path/key` for domain-specific keys (e.g. - # `foo.com/myproduct/bar`) - # - # Predefined labels include: - # - # * `/agent` - # * `/component` - # * `/error/message` - # * `/error/name` - # * `/http/client_city` - # * `/http/client_country` - # * `/http/client_protocol` - # * `/http/client_region` - # * `/http/host` - # * `/http/method` - # * `/http/path` - # * `/http/redirected_url` - # * `/http/request/size` - # * `/http/response/size` - # * `/http/route` - # * `/http/status_code` - # * `/http/url` - # * `/http/user_agent` - # * `/pid` - # * `/stacktrace` - # * `/tid` - class TraceSpan - 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 - - # Type of span. Can be used to specify additional relationships between spans - # in addition to a parent/child relationship. - module SpanKind - # Unspecified. - SPAN_KIND_UNSPECIFIED = 0 - - # Indicates that the span covers server-side handling of an RPC or other - # remote network request. - RPC_SERVER = 1 - - # Indicates that the span covers the client-side wrapper around an RPC or - # other remote request. - RPC_CLIENT = 2 - end - end - - # The request message for the `ListTraces` method. All fields are required - # unless specified. - # @!attribute [rw] project_id - # @return [::String] - # Required. ID of the Cloud project where the trace data is stored. - # @!attribute [rw] view - # @return [::Google::Cloud::Trace::V1::ListTracesRequest::ViewType] - # Optional. Type of data returned for traces in the list. Default is - # `MINIMAL`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of traces to return. If not specified or <= 0, the - # implementation selects a reasonable value. The implementation may - # return fewer traces than the requested page size. - # @!attribute [rw] page_token - # @return [::String] - # Token identifying the page of results to return. If provided, use the - # value of the `next_page_token` field from a previous request. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start of the time interval (inclusive) during which the trace data was - # collected from the application. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End of the time interval (inclusive) during which the trace data was - # collected from the application. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter against labels for the request. - # - # By default, searches use prefix matching. To specify exact match, prepend - # a plus symbol (`+`) to the search term. - # Multiple terms are ANDed. Syntax: - # - # * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root - # span starts with `NAME_PREFIX`. - # * `+root:NAME` or `+NAME`: Return traces where any root span's name is - # exactly `NAME`. - # * `span:NAME_PREFIX`: Return traces where any span starts with - # `NAME_PREFIX`. - # * `+span:NAME`: Return traces where any span's name is exactly - # `NAME`. - # * `latency:DURATION`: Return traces whose overall latency is - # greater or equal to than `DURATION`. Accepted units are nanoseconds - # (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For - # example, `latency:24ms` returns traces whose overall latency - # is greater than or equal to 24 milliseconds. - # * `label:LABEL_KEY`: Return all traces containing the specified - # label key (exact match, case-sensitive) regardless of the key:value - # pair's value (including empty values). - # * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified - # label key (exact match, case-sensitive) whose value starts with - # `VALUE_PREFIX`. Both a key and a value must be specified. - # * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair - # exactly matching the specified text. Both a key and a value must be - # specified. - # * `method:VALUE`: Equivalent to `/http/method:VALUE`. - # * `url:VALUE`: Equivalent to `/http/url:VALUE`. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Field used to sort the returned traces. - # Can be one of the following: - # - # * `trace_id` - # * `name` (`name` field of root span in the trace) - # * `duration` (difference between `end_time` and `start_time` fields of - # the root span) - # * `start` (`start_time` field of the root span) - # - # Descending order can be specified by appending `desc` to the sort field - # (for example, `name desc`). - # - # Only one sort field is permitted. - class ListTracesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of data returned for traces in the list. - module ViewType - # Default is `MINIMAL` if unspecified. - VIEW_TYPE_UNSPECIFIED = 0 - - # Minimal view of the trace record that contains only the project - # and trace IDs. - MINIMAL = 1 - - # Root span view of the trace record that returns the root spans along - # with the minimal trace data. - ROOTSPAN = 2 - - # Complete view of the trace record that contains the actual trace data. - # This is equivalent to calling the REST `get` or RPC `GetTrace` method - # using the ID of each listed trace. - COMPLETE = 3 - end - end - - # The response message for the `ListTraces` method. - # @!attribute [rw] traces - # @return [::Array<::Google::Cloud::Trace::V1::Trace>] - # List of trace records as specified by the view parameter. - # @!attribute [rw] next_page_token - # @return [::String] - # If defined, indicates that there are more traces that match the request - # and that this value should be passed to the next request to continue - # retrieving additional traces. - class ListTracesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the `GetTrace` method. - # @!attribute [rw] project_id - # @return [::String] - # Required. ID of the Cloud project where the trace data is stored. - # @!attribute [rw] trace_id - # @return [::String] - # Required. ID of the trace to return. - class GetTraceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for the `PatchTraces` method. - # @!attribute [rw] project_id - # @return [::String] - # Required. ID of the Cloud project where the trace data is stored. - # @!attribute [rw] traces - # @return [::Google::Cloud::Trace::V1::Traces] - # Required. The body of the message. - class PatchTracesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile deleted file mode 100644 index c09bc4f74260..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v1", path: "../" -else - gem "google-cloud-trace-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-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json b/owl-bot-staging/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json deleted file mode 100644 index 314aca148ab2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-trace-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.devtools.cloudtrace.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudtrace_v1_generated_TraceService_ListTraces_sync", - "title": "Snippet for the list_traces call in the TraceService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V1::TraceService::Client#list_traces.", - "file": "trace_service/list_traces.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_traces", - "full_name": "::Google::Cloud::Trace::V1::TraceService::Client#list_traces", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Trace::V1::ListTracesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Trace::V1::ListTracesResponse", - "client": { - "short_name": "TraceService::Client", - "full_name": "::Google::Cloud::Trace::V1::TraceService::Client" - }, - "method": { - "short_name": "ListTraces", - "full_name": "google.devtools.cloudtrace.v1.TraceService.ListTraces", - "service": { - "short_name": "TraceService", - "full_name": "google.devtools.cloudtrace.v1.TraceService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtrace_v1_generated_TraceService_GetTrace_sync", - "title": "Snippet for the get_trace call in the TraceService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V1::TraceService::Client#get_trace.", - "file": "trace_service/get_trace.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_trace", - "full_name": "::Google::Cloud::Trace::V1::TraceService::Client#get_trace", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Trace::V1::GetTraceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Trace::V1::Trace", - "client": { - "short_name": "TraceService::Client", - "full_name": "::Google::Cloud::Trace::V1::TraceService::Client" - }, - "method": { - "short_name": "GetTrace", - "full_name": "google.devtools.cloudtrace.v1.TraceService.GetTrace", - "service": { - "short_name": "TraceService", - "full_name": "google.devtools.cloudtrace.v1.TraceService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtrace_v1_generated_TraceService_PatchTraces_sync", - "title": "Snippet for the patch_traces call in the TraceService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V1::TraceService::Client#patch_traces.", - "file": "trace_service/patch_traces.rb", - "language": "RUBY", - "client_method": { - "short_name": "patch_traces", - "full_name": "::Google::Cloud::Trace::V1::TraceService::Client#patch_traces", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Trace::V1::PatchTracesRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TraceService::Client", - "full_name": "::Google::Cloud::Trace::V1::TraceService::Client" - }, - "method": { - "short_name": "PatchTraces", - "full_name": "google.devtools.cloudtrace.v1.TraceService.PatchTraces", - "service": { - "short_name": "TraceService", - "full_name": "google.devtools.cloudtrace.v1.TraceService" - } - } - }, - "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-trace-v1/snippets/trace_service/get_trace.rb b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/get_trace.rb deleted file mode 100644 index cda36e0edbd3..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/get_trace.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v1_generated_TraceService_GetTrace_sync] -require "google/cloud/trace/v1" - -## -# Snippet for the get_trace call in the TraceService 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::Trace::V1::TraceService::Client#get_trace. -# -def get_trace - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Trace::V1::TraceService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Trace::V1::GetTraceRequest.new - - # Call the get_trace method. - result = client.get_trace request - - # The returned object is of type Google::Cloud::Trace::V1::Trace. - p result -end -# [END cloudtrace_v1_generated_TraceService_GetTrace_sync] diff --git a/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb deleted file mode 100644 index 17cca45ee65e..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/list_traces.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v1_generated_TraceService_ListTraces_sync] -require "google/cloud/trace/v1" - -## -# Snippet for the list_traces call in the TraceService 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::Trace::V1::TraceService::Client#list_traces. -# -def list_traces - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Trace::V1::TraceService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Trace::V1::ListTracesRequest.new - - # Call the list_traces method. - result = client.list_traces 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::Trace::V1::Trace. - p item - end -end -# [END cloudtrace_v1_generated_TraceService_ListTraces_sync] diff --git a/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb b/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb deleted file mode 100644 index 1a9f634e125c..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v1_generated_TraceService_PatchTraces_sync] -require "google/cloud/trace/v1" - -## -# Snippet for the patch_traces call in the TraceService 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::Trace::V1::TraceService::Client#patch_traces. -# -def patch_traces - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Trace::V1::TraceService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Trace::V1::PatchTracesRequest.new - - # Call the patch_traces method. - result = client.patch_traces request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtrace_v1_generated_TraceService_PatchTraces_sync] diff --git a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb deleted file mode 100644 index 600d2460da19..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_rest_test.rb +++ /dev/null @@ -1,270 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" -require "google/cloud/trace/v1/trace_service/rest" - - -class ::Google::Cloud::Trace::V1::TraceService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_traces - # Create test objects. - client_result = ::Google::Cloud::Trace::V1::ListTracesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - view = :VIEW_TYPE_UNSPECIFIED - page_size = 42 - page_token = "hello world" - start_time = {} - end_time = {} - filter = "hello world" - order_by = "hello world" - - list_traces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Trace::V1::TraceService::Rest::ServiceStub.stub :transcode_list_traces_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_traces_client_stub do - # Create client - client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_traces project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_traces ::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces(::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces_client_stub.call_count - end - end - end - - def test_get_trace - # Create test objects. - client_result = ::Google::Cloud::Trace::V1::Trace.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - trace_id = "hello world" - - get_trace_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Trace::V1::TraceService::Rest::ServiceStub.stub :transcode_get_trace_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_trace_client_stub do - # Create client - client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_trace({ project_id: project_id, trace_id: trace_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_trace project_id: project_id, trace_id: trace_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_trace ::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_trace({ project_id: project_id, trace_id: trace_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_trace(::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_trace_client_stub.call_count - end - end - end - - def test_patch_traces - # 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" - traces = {} - - patch_traces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Trace::V1::TraceService::Rest::ServiceStub.stub :transcode_patch_traces_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, patch_traces_client_stub do - # Create client - client = ::Google::Cloud::Trace::V1::TraceService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.patch_traces({ project_id: project_id, traces: traces }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.patch_traces project_id: project_id, traces: traces do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.patch_traces ::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.patch_traces({ project_id: project_id, traces: traces }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.patch_traces(::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, patch_traces_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::Trace::V1::TraceService::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::Trace::V1::TraceService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb b/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb deleted file mode 100644 index cf06253597e4..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/test/google/cloud/trace/v1/trace_service_test.rb +++ /dev/null @@ -1,301 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v1/trace_pb" -require "google/cloud/trace/v1/trace_service" - -class ::Google::Cloud::Trace::V1::TraceService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_traces - # Create GRPC objects. - grpc_response = ::Google::Cloud::Trace::V1::ListTracesResponse.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" - view = :VIEW_TYPE_UNSPECIFIED - page_size = 42 - page_token = "hello world" - start_time = {} - end_time = {} - filter = "hello world" - order_by = "hello world" - - list_traces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_traces, name - assert_kind_of ::Google::Cloud::Trace::V1::ListTracesRequest, request - assert_equal "hello world", request["project_id"] - assert_equal :VIEW_TYPE_UNSPECIFIED, request["view"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["end_time"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_traces_client_stub do - # Create client - client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces ::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces({ project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces(::Google::Cloud::Trace::V1::ListTracesRequest.new(project_id: project_id, view: view, page_size: page_size, page_token: page_token, start_time: start_time, end_time: end_time, 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_traces_client_stub.call_rpc_count - end - end - - def test_get_trace - # Create GRPC objects. - grpc_response = ::Google::Cloud::Trace::V1::Trace.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" - trace_id = "hello world" - - get_trace_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_trace, name - assert_kind_of ::Google::Cloud::Trace::V1::GetTraceRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["trace_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_trace_client_stub do - # Create client - client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_trace({ project_id: project_id, trace_id: trace_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_trace project_id: project_id, trace_id: trace_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_trace ::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_trace({ project_id: project_id, trace_id: trace_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_trace(::Google::Cloud::Trace::V1::GetTraceRequest.new(project_id: project_id, trace_id: trace_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_trace_client_stub.call_rpc_count - end - end - - def test_patch_traces - # 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" - traces = {} - - patch_traces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :patch_traces, name - assert_kind_of ::Google::Cloud::Trace::V1::PatchTracesRequest, request - assert_equal "hello world", request["project_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V1::Traces), request["traces"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, patch_traces_client_stub do - # Create client - client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.patch_traces({ project_id: project_id, traces: traces }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.patch_traces project_id: project_id, traces: traces do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.patch_traces ::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.patch_traces({ project_id: project_id, traces: traces }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.patch_traces(::Google::Cloud::Trace::V1::PatchTracesRequest.new(project_id: project_id, traces: traces), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, patch_traces_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::Trace::V1::TraceService::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::Trace::V1::TraceService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Trace::V1::TraceService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Trace::V1::TraceService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v1/test/helper.rb b/owl-bot-staging/google-cloud-trace-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-trace-v2/.gitignore b/owl-bot-staging/google-cloud-trace-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/.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-trace-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-trace-v2/.repo-metadata.json deleted file mode 100644 index 67811910934d..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "cloudtrace.googleapis.com", - "api_shortname": "cloudtrace", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v2/latest", - "distribution_name": "google-cloud-trace-v2", - "is_cloud": true, - "language": "ruby", - "name": "cloudtrace", - "name_pretty": "Cloud Trace V2 API", - "product_documentation": "https://cloud.google.com/trace", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TRACE", - "ruby-cloud-product-url": "https://cloud.google.com/trace", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-trace-v2/.rubocop.yml b/owl-bot-staging/google-cloud-trace-v2/.rubocop.yml deleted file mode 100644 index f3216e912f4e..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-trace-v2.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-trace-v2.rb" diff --git a/owl-bot-staging/google-cloud-trace-v2/.toys.rb b/owl-bot-staging/google-cloud-trace-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/.yardopts b/owl-bot-staging/google-cloud-trace-v2/.yardopts deleted file mode 100644 index 6c8fa994b18f..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Trace V2 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-trace-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-trace-v2/AUTHENTICATION.md deleted file mode 100644 index cd2b7cadfb3d..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-trace-v2 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-trace-v2 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/trace/v2" - -client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/trace/v2" - -::Google::Cloud::Trace::V2::TraceService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Trace::V2::TraceService::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-trace-v2 -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/trace/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Trace::V2::TraceService::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-trace-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-trace-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-trace-v2/Gemfile b/owl-bot-staging/google-cloud-trace-v2/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-trace-v2/LICENSE.md b/owl-bot-staging/google-cloud-trace-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/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-trace-v2/README.md b/owl-bot-staging/google-cloud-trace-v2/README.md deleted file mode 100644 index 1ff702d96ad8..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Trace V2 API - -Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry. - -The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. - -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 Trace V2 API. Most users should consider using -the main client gem, -[google-cloud-trace](https://rubygems.org/gems/google-cloud-trace). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-trace-v2 -``` - -## 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/cloudtrace.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/trace/v2" - -client = ::Google::Cloud::Trace::V2::TraceService::Client.new -request = ::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new # (request fields as keyword arguments...) -response = client.batch_write_spans request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-trace-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/trace) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/trace/v2" -require "logger" - -client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-trace`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-trace-v2`. -_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-trace`. -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-trace-v2`. - -### 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-trace-v2/Rakefile b/owl-bot-staging/google-cloud-trace-v2/Rakefile deleted file mode 100644 index 010c4e0623c1..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TRACE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TRACE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TRACE_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 TRACE_TEST_PROJECT=test123 TRACE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/trace/v2/trace_service/credentials" - ::Google::Cloud::Trace::V2::TraceService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TRACE_PROJECT"] = project - ENV["TRACE_TEST_PROJECT"] = project - ENV["TRACE_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-trace-v2 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-trace-v2 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-trace-v2 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-trace-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-trace-v2" - header "google-cloud-trace-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-trace-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-trace-v2 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-trace-v2 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-trace-v2 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-trace-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-trace-v2/gapic_metadata.json deleted file mode 100644 index 9cd82cbd9ba1..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/gapic_metadata.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.devtools.cloudtrace.v2", - "libraryPackage": "::Google::Cloud::Trace::V2", - "services": { - "TraceService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Trace::V2::TraceService::Client", - "rpcs": { - "BatchWriteSpans": { - "methods": [ - "batch_write_spans" - ] - }, - "CreateSpan": { - "methods": [ - "create_span" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec b/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec deleted file mode 100644 index d057b30781c6..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/google-cloud-trace-v2.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/trace/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-trace-v2" - gem.version = Google::Cloud::Trace::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Cloud Trace API lets you send and retrieve latency data to and from Cloud Trace. This API provides low-level interfaces for interacting directly with the feature. For some languages, you can use OpenTelemetry, a set of open source tracing and stats instrumentation libraries that work with multiple backends. Note that google-cloud-trace-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-trace instead. See the readme for more details." - gem.summary = "Sends application trace data to Stackdriver Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Trace API directly. If you are looking to instrument your application for Stackdriver Trace, we recommend using OpenTelemetry." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb deleted file mode 100644 index f27f8272e44b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google-cloud-trace-v2.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2" diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb deleted file mode 100644 index c1e11a6a5167..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/trace_service" -require "google/cloud/trace/v2/version" - -module Google - module Cloud - module Trace - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/trace/v2" - # client = ::Google::Cloud::Trace::V2::TraceService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/trace/v2" - # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/trace/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb deleted file mode 100644 index 531187513daf..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/trace_service/rest" -require "google/cloud/trace/v2/version" - -module Google - module Cloud - module Trace - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/trace/v2/rest" - # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb deleted file mode 100644 index 71726f38d623..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/version" - -require "google/cloud/trace/v2/trace_service/credentials" -require "google/cloud/trace/v2/trace_service/paths" -require "google/cloud/trace/v2/trace_service/client" -require "google/cloud/trace/v2/trace_service/rest" - -module Google - module Cloud - module Trace - module V2 - ## - # Service for collecting and viewing traces and spans within a trace. - # - # A trace is a collection of spans corresponding to a single - # operation or a set of operations in an application. - # - # A span is an individual timed event which forms a node of the trace tree. - # A single trace can contain spans from multiple services. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/trace/v2/trace_service" - # client = ::Google::Cloud::Trace::V2::TraceService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/trace/v2/trace_service/rest" - # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new - # - module TraceService - end - end - end - end -end - -helper_path = ::File.join __dir__, "trace_service", "helpers.rb" -require "google/cloud/trace/v2/trace_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb deleted file mode 100644 index 1f59d76e257f..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/client.rb +++ /dev/null @@ -1,643 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" - -module Google - module Cloud - module Trace - module V2 - module TraceService - ## - # Client for the TraceService service. - # - # Service for collecting and viewing traces and spans within a trace. - # - # A trace is a collection of spans corresponding to a single - # operation or a set of operations in an application. - # - # A span is an individual timed event which forms a node of the trace tree. - # A single trace can contain spans from multiple services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :trace_service_stub - - ## - # Configure the TraceService Client class. - # - # See {::Google::Cloud::Trace::V2::TraceService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TraceService clients - # ::Google::Cloud::Trace::V2::TraceService::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", "Trace", "V2"] - 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.batch_write_spans.timeout = 120.0 - default_config.rpcs.batch_write_spans.retry_policy = { - initial_delay: 0.1, max_delay: 30.0, multiplier: 2, retry_codes: [14, 4] - } - - default_config.rpcs.create_span.timeout = 120.0 - default_config.rpcs.create_span.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TraceService 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::Trace::V2::TraceService::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 - @trace_service_stub.universe_domain - end - - ## - # Create a new TraceService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Trace::V2::TraceService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TraceService 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/devtools/cloudtrace/v2/tracing_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 - - @trace_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Trace::V2::TraceService::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, - logger: @config.logger - ) - - @trace_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @trace_service_stub.logger - end - - # Service calls - - ## - # Batch writes new spans to new or existing traces. You cannot update - # existing spans. - # - # @overload batch_write_spans(request, options = nil) - # Pass arguments to `batch_write_spans` via a request object, either of type - # {::Google::Cloud::Trace::V2::BatchWriteSpansRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V2::BatchWriteSpansRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_write_spans(name: nil, spans: nil) - # Pass arguments to `batch_write_spans` via keyword arguments. Note that at - # least one keyword argument is 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 project where the spans belong. The format is - # `projects/[PROJECT_ID]`. - # @param spans [::Array<::Google::Cloud::Trace::V2::Span, ::Hash>] - # Required. A list of new spans. The span names must not match existing - # spans, otherwise the results are undefined. - # - # @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/trace/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V2::TraceService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new - # - # # Call the batch_write_spans method. - # result = client.batch_write_spans request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def batch_write_spans request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::BatchWriteSpansRequest - - # Converts hash 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.batch_write_spans.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::Trace::V2::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.batch_write_spans.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_write_spans.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.call_rpc :batch_write_spans, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new span. - # - # @overload create_span(request, options = nil) - # Pass arguments to `create_span` via a request object, either of type - # {::Google::Cloud::Trace::V2::Span} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V2::Span, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_span(name: nil, span_id: nil, parent_span_id: nil, display_name: nil, start_time: nil, end_time: nil, attributes: nil, stack_trace: nil, time_events: nil, links: nil, status: nil, same_process_as_parent_span: nil, child_span_count: nil, span_kind: nil) - # Pass arguments to `create_span` via keyword arguments. Note that at - # least one keyword argument is 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 span in the following format: - # - # * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` - # - # `[TRACE_ID]` is a unique identifier for a trace within a project; - # it is a 32-character hexadecimal encoding of a 16-byte array. It should - # not be zero. - # - # `[SPAN_ID]` is a unique identifier for a span within a trace; it - # is a 16-character hexadecimal encoding of an 8-byte array. It should not - # be zero. - # . - # @param span_id [::String] - # Required. The `[SPAN_ID]` portion of the span's resource name. - # @param parent_span_id [::String] - # The `[SPAN_ID]` of this span's parent span. If this is a root span, - # then this field must be empty. - # @param display_name [::Google::Cloud::Trace::V2::TruncatableString, ::Hash] - # Required. A description of the span's operation (up to 128 bytes). - # Cloud Trace displays the description in the - # Cloud console. - # For example, the display name can be a qualified method name or a file name - # and a line number where the operation is called. A best practice is to use - # the same display name within an application and at the same call point. - # This makes it easier to correlate spans in different traces. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The start time of the span. On the client side, this is the time - # kept by the local machine where the span execution starts. On the server - # side, this is the time when the server's application handler starts - # running. - # @param end_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The end time of the span. On the client side, this is the time - # kept by the local machine where the span execution ends. On the server - # side, this is the time when the server application handler stops running. - # @param attributes [::Google::Cloud::Trace::V2::Span::Attributes, ::Hash] - # A set of attributes on the span. You can have up to 32 attributes per - # span. - # @param stack_trace [::Google::Cloud::Trace::V2::StackTrace, ::Hash] - # Stack trace captured at the start of the span. - # @param time_events [::Google::Cloud::Trace::V2::Span::TimeEvents, ::Hash] - # A set of time events. You can have up to 32 annotations and 128 message - # events per span. - # @param links [::Google::Cloud::Trace::V2::Span::Links, ::Hash] - # Links associated with the span. You can have up to 128 links per Span. - # @param status [::Google::Rpc::Status, ::Hash] - # Optional. The final status for this span. - # @param same_process_as_parent_span [::Google::Protobuf::BoolValue, ::Hash] - # Optional. Set this parameter to indicate whether this span is in - # the same process as its parent. If you do not set this parameter, - # Trace is unable to take advantage of this helpful information. - # @param child_span_count [::Google::Protobuf::Int32Value, ::Hash] - # Optional. The number of child spans that were generated while this span - # was active. If set, allows implementation to detect missing child spans. - # @param span_kind [::Google::Cloud::Trace::V2::Span::SpanKind] - # Optional. Distinguishes between spans generated in a particular context. - # For example, two spans with the same name may be distinguished using - # `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Trace::V2::Span] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Trace::V2::Span] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/trace/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V2::TraceService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V2::Span.new - # - # # Call the create_span method. - # result = client.create_span request - # - # # The returned object is of type Google::Cloud::Trace::V2::Span. - # p result - # - def create_span request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::Span - - # Converts hash 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_span.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::Trace::V2::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.create_span.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_span.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.call_rpc :create_span, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TraceService API. - # - # This class represents the configuration for TraceService, - # 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::Trace::V2::TraceService::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 - # # batch_write_spans to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Trace::V2::TraceService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_write_spans.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_write_spans.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TraceService 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 `batch_write_spans` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_write_spans - ## - # RPC-specific configuration for `create_span` - # @return [::Gapic::Config::Method] - # - attr_reader :create_span - - # @private - def initialize parent_rpcs = nil - batch_write_spans_config = parent_rpcs.batch_write_spans if parent_rpcs.respond_to? :batch_write_spans - @batch_write_spans = ::Gapic::Config::Method.new batch_write_spans_config - create_span_config = parent_rpcs.create_span if parent_rpcs.respond_to? :create_span - @create_span = ::Gapic::Config::Method.new create_span_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb deleted file mode 100644 index db91afb17b6c..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V2 - module TraceService - # Credentials for the TraceService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.append" - ] - self.env_vars = [ - "TRACE_CREDENTIALS", - "TRACE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TRACE_CREDENTIALS_JSON", - "TRACE_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-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb deleted file mode 100644 index 25d2b38e26ac..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/paths.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V2 - module TraceService - # Path helper methods for the TraceService API. - module Paths - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Span resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/traces/{trace}/spans/{span}` - # - # @param project [String] - # @param trace [String] - # @param span [String] - # - # @return [::String] - def span_path project:, trace:, span: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "trace cannot contain /" if trace.to_s.include? "/" - - "projects/#{project}/traces/#{trace}/spans/#{span}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb deleted file mode 100644 index 0f21f9aa2181..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/version" - -require "google/cloud/trace/v2/trace_service/credentials" -require "google/cloud/trace/v2/trace_service/paths" -require "google/cloud/trace/v2/trace_service/rest/client" - -module Google - module Cloud - module Trace - module V2 - ## - # Service for collecting and viewing traces and spans within a trace. - # - # A trace is a collection of spans corresponding to a single - # operation or a set of operations in an application. - # - # A span is an individual timed event which forms a node of the trace tree. - # A single trace can contain spans from multiple services. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/trace/v2/trace_service/rest" - # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new - # - module TraceService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/trace/v2/trace_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb deleted file mode 100644 index a96278916b0a..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/client.rb +++ /dev/null @@ -1,586 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" -require "google/cloud/trace/v2/trace_service/rest/service_stub" - -module Google - module Cloud - module Trace - module V2 - module TraceService - module Rest - ## - # REST client for the TraceService service. - # - # Service for collecting and viewing traces and spans within a trace. - # - # A trace is a collection of spans corresponding to a single - # operation or a set of operations in an application. - # - # A span is an individual timed event which forms a node of the trace tree. - # A single trace can contain spans from multiple services. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "cloudtrace.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :trace_service_stub - - ## - # Configure the TraceService Client class. - # - # See {::Google::Cloud::Trace::V2::TraceService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TraceService clients - # ::Google::Cloud::Trace::V2::TraceService::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", "Trace", "V2"] - 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.batch_write_spans.timeout = 120.0 - default_config.rpcs.batch_write_spans.retry_policy = { - initial_delay: 0.1, max_delay: 30.0, multiplier: 2, retry_codes: [14, 4] - } - - default_config.rpcs.create_span.timeout = 120.0 - default_config.rpcs.create_span.retry_policy = { - initial_delay: 0.1, max_delay: 1.0, multiplier: 1.2, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TraceService 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::Trace::V2::TraceService::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 - @trace_service_stub.universe_domain - end - - ## - # Create a new TraceService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TraceService 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 - - @trace_service_stub = ::Google::Cloud::Trace::V2::TraceService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @trace_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @trace_service_stub.logger - end - - # Service calls - - ## - # Batch writes new spans to new or existing traces. You cannot update - # existing spans. - # - # @overload batch_write_spans(request, options = nil) - # Pass arguments to `batch_write_spans` via a request object, either of type - # {::Google::Cloud::Trace::V2::BatchWriteSpansRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V2::BatchWriteSpansRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_write_spans(name: nil, spans: nil) - # Pass arguments to `batch_write_spans` via keyword arguments. Note that at - # least one keyword argument is 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 project where the spans belong. The format is - # `projects/[PROJECT_ID]`. - # @param spans [::Array<::Google::Cloud::Trace::V2::Span, ::Hash>] - # Required. A list of new spans. The span names must not match existing - # spans, otherwise the results are undefined. - # @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/trace/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V2::TraceService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new - # - # # Call the batch_write_spans method. - # result = client.batch_write_spans request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def batch_write_spans request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::BatchWriteSpansRequest - - # Converts hash 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.batch_write_spans.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::Trace::V2::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.batch_write_spans.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_write_spans.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.batch_write_spans request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new span. - # - # @overload create_span(request, options = nil) - # Pass arguments to `create_span` via a request object, either of type - # {::Google::Cloud::Trace::V2::Span} or an equivalent Hash. - # - # @param request [::Google::Cloud::Trace::V2::Span, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_span(name: nil, span_id: nil, parent_span_id: nil, display_name: nil, start_time: nil, end_time: nil, attributes: nil, stack_trace: nil, time_events: nil, links: nil, status: nil, same_process_as_parent_span: nil, child_span_count: nil, span_kind: nil) - # Pass arguments to `create_span` via keyword arguments. Note that at - # least one keyword argument is 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 span in the following format: - # - # * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` - # - # `[TRACE_ID]` is a unique identifier for a trace within a project; - # it is a 32-character hexadecimal encoding of a 16-byte array. It should - # not be zero. - # - # `[SPAN_ID]` is a unique identifier for a span within a trace; it - # is a 16-character hexadecimal encoding of an 8-byte array. It should not - # be zero. - # . - # @param span_id [::String] - # Required. The `[SPAN_ID]` portion of the span's resource name. - # @param parent_span_id [::String] - # The `[SPAN_ID]` of this span's parent span. If this is a root span, - # then this field must be empty. - # @param display_name [::Google::Cloud::Trace::V2::TruncatableString, ::Hash] - # Required. A description of the span's operation (up to 128 bytes). - # Cloud Trace displays the description in the - # Cloud console. - # For example, the display name can be a qualified method name or a file name - # and a line number where the operation is called. A best practice is to use - # the same display name within an application and at the same call point. - # This makes it easier to correlate spans in different traces. - # @param start_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The start time of the span. On the client side, this is the time - # kept by the local machine where the span execution starts. On the server - # side, this is the time when the server's application handler starts - # running. - # @param end_time [::Google::Protobuf::Timestamp, ::Hash] - # Required. The end time of the span. On the client side, this is the time - # kept by the local machine where the span execution ends. On the server - # side, this is the time when the server application handler stops running. - # @param attributes [::Google::Cloud::Trace::V2::Span::Attributes, ::Hash] - # A set of attributes on the span. You can have up to 32 attributes per - # span. - # @param stack_trace [::Google::Cloud::Trace::V2::StackTrace, ::Hash] - # Stack trace captured at the start of the span. - # @param time_events [::Google::Cloud::Trace::V2::Span::TimeEvents, ::Hash] - # A set of time events. You can have up to 32 annotations and 128 message - # events per span. - # @param links [::Google::Cloud::Trace::V2::Span::Links, ::Hash] - # Links associated with the span. You can have up to 128 links per Span. - # @param status [::Google::Rpc::Status, ::Hash] - # Optional. The final status for this span. - # @param same_process_as_parent_span [::Google::Protobuf::BoolValue, ::Hash] - # Optional. Set this parameter to indicate whether this span is in - # the same process as its parent. If you do not set this parameter, - # Trace is unable to take advantage of this helpful information. - # @param child_span_count [::Google::Protobuf::Int32Value, ::Hash] - # Optional. The number of child spans that were generated while this span - # was active. If set, allows implementation to detect missing child spans. - # @param span_kind [::Google::Cloud::Trace::V2::Span::SpanKind] - # Optional. Distinguishes between spans generated in a particular context. - # For example, two spans with the same name may be distinguished using - # `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Trace::V2::Span] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Trace::V2::Span] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/trace/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Trace::V2::TraceService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Trace::V2::Span.new - # - # # Call the create_span method. - # result = client.create_span request - # - # # The returned object is of type Google::Cloud::Trace::V2::Span. - # p result - # - def create_span request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Trace::V2::Span - - # Converts hash 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_span.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::Trace::V2::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_span.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_span.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @trace_service_stub.create_span request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TraceService REST API. - # - # This class represents the configuration for TraceService 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::Trace::V2::TraceService::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 - # # batch_write_spans to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Trace::V2::TraceService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_write_spans.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_write_spans.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "cloudtrace.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TraceService 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 `batch_write_spans` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_write_spans - ## - # RPC-specific configuration for `create_span` - # @return [::Gapic::Config::Method] - # - attr_reader :create_span - - # @private - def initialize parent_rpcs = nil - batch_write_spans_config = parent_rpcs.batch_write_spans if parent_rpcs.respond_to? :batch_write_spans - @batch_write_spans = ::Gapic::Config::Method.new batch_write_spans_config - create_span_config = parent_rpcs.create_span if parent_rpcs.respond_to? :create_span - @create_span = ::Gapic::Config::Method.new create_span_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb deleted file mode 100644 index bd1feae3a232..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/trace_service/rest/service_stub.rb +++ /dev/null @@ -1,205 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" - -module Google - module Cloud - module Trace - module V2 - module TraceService - module Rest - ## - # REST service stub for the TraceService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the batch_write_spans REST call - # - # @param request_pb [::Google::Cloud::Trace::V2::BatchWriteSpansRequest] - # 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 batch_write_spans request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_write_spans_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, - method_name: "batch_write_spans", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_span REST call - # - # @param request_pb [::Google::Cloud::Trace::V2::Span] - # 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::Trace::V2::Span] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Trace::V2::Span] - # A result object deserialized from the server's reply - def create_span request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_span_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, - method_name: "create_span", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Trace::V2::Span.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_write_spans REST call - # - # @param request_pb [::Google::Cloud::Trace::V2::BatchWriteSpansRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_write_spans_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}/traces:batchWrite", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_span REST call - # - # @param request_pb [::Google::Cloud::Trace::V2::Span] - # 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_span_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/traces/[^/]+/spans/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb deleted file mode 100644 index d2142daddb36..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/cloud/trace/v2/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb deleted file mode 100644 index 01114e89013b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/trace_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudtrace/v2/trace.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n)google/devtools/cloudtrace/v2/trace.proto\x12\x1dgoogle.devtools.cloudtrace.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto\"\xf1\x11\n\x04Span\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07span_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0eparent_span_id\x18\x03 \x01(\t\x12K\n\x0c\x64isplay_name\x18\x04 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableStringB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x31\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x42\n\nattributes\x18\x07 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\x12>\n\x0bstack_trace\x18\x08 \x01(\x0b\x32).google.devtools.cloudtrace.v2.StackTrace\x12\x43\n\x0btime_events\x18\t \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.TimeEvents\x12\x38\n\x05links\x18\n \x01(\x0b\x32).google.devtools.cloudtrace.v2.Span.Links\x12\'\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x01\x12\x44\n\x1bsame_process_as_parent_span\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\x03\xe0\x41\x01\x12:\n\x10\x63hild_span_count\x18\r \x01(\x0b\x32\x1b.google.protobuf.Int32ValueB\x03\xe0\x41\x01\x12\x44\n\tspan_kind\x18\x0e \x01(\x0e\x32,.google.devtools.cloudtrace.v2.Span.SpanKindB\x03\xe0\x41\x01\x1a\xeb\x01\n\nAttributes\x12W\n\rattribute_map\x18\x01 \x03(\x0b\x32@.google.devtools.cloudtrace.v2.Span.Attributes.AttributeMapEntry\x12 \n\x18\x64ropped_attributes_count\x18\x02 \x01(\x05\x1a\x62\n\x11\x41ttributeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.devtools.cloudtrace.v2.AttributeValue:\x02\x38\x01\x1a\xdf\x04\n\tTimeEvent\x12(\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\nannotation\x18\x02 \x01(\x0b\x32\x38.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationH\x00\x12S\n\rmessage_event\x18\x03 \x01(\x0b\x32:.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventH\x00\x1a\x97\x01\n\nAnnotation\x12\x45\n\x0b\x64\x65scription\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x42\n\nattributes\x18\x02 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\x1a\xdf\x01\n\x0cMessageEvent\x12M\n\x04type\x18\x01 \x01(\x0e\x32?.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type\x12\n\n\x02id\x18\x02 \x01(\x03\x12\x1f\n\x17uncompressed_size_bytes\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ompressed_size_bytes\x18\x04 \x01(\x03\"4\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04SENT\x10\x01\x12\x0c\n\x08RECEIVED\x10\x02\x42\x07\n\x05value\x1a\x98\x01\n\nTimeEvents\x12\x41\n\ntime_event\x18\x01 \x03(\x0b\x32-.google.devtools.cloudtrace.v2.Span.TimeEvent\x12!\n\x19\x64ropped_annotations_count\x18\x02 \x01(\x05\x12$\n\x1c\x64ropped_message_events_count\x18\x03 \x01(\x05\x1a\xf7\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\t\x12\x0f\n\x07span_id\x18\x02 \x01(\t\x12;\n\x04type\x18\x03 \x01(\x0e\x32-.google.devtools.cloudtrace.v2.Span.Link.Type\x12\x42\n\nattributes\x18\x04 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43HILD_LINKED_SPAN\x10\x01\x12\x16\n\x12PARENT_LINKED_SPAN\x10\x02\x1a\\\n\x05Links\x12\x36\n\x04link\x18\x01 \x03(\x0b\x32(.google.devtools.cloudtrace.v2.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x02 \x01(\x05\"g\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x0c\n\x08INTERNAL\x10\x01\x12\n\n\x06SERVER\x10\x02\x12\n\n\x06\x43LIENT\x10\x03\x12\x0c\n\x08PRODUCER\x10\x04\x12\x0c\n\x08\x43ONSUMER\x10\x05:S\xea\x41P\n\x1e\x63loudtrace.googleapis.com/Span\x12.projects/{project}/traces/{trace}/spans/{span}\"\x8e\x01\n\x0e\x41ttributeValue\x12H\n\x0cstring_value\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableStringH\x00\x12\x13\n\tint_value\x18\x02 \x01(\x03H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value\"\x89\x05\n\nStackTrace\x12K\n\x0cstack_frames\x18\x01 \x01(\x0b\x32\x35.google.devtools.cloudtrace.v2.StackTrace.StackFrames\x12\x1b\n\x13stack_trace_hash_id\x18\x02 \x01(\x03\x1a\x9e\x03\n\nStackFrame\x12G\n\rfunction_name\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12P\n\x16original_function_name\x18\x02 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x43\n\tfile_name\x18\x03 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x13\n\x0bline_number\x18\x04 \x01(\x03\x12\x15\n\rcolumn_number\x18\x05 \x01(\x03\x12:\n\x0bload_module\x18\x06 \x01(\x0b\x32%.google.devtools.cloudtrace.v2.Module\x12H\n\x0esource_version\x18\x07 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x1ap\n\x0bStackFrames\x12\x43\n\x05\x66rame\x18\x01 \x03(\x0b\x32\x34.google.devtools.cloudtrace.v2.StackTrace.StackFrame\x12\x1c\n\x14\x64ropped_frames_count\x18\x02 \x01(\x05\"\x8e\x01\n\x06Module\x12@\n\x06module\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x42\n\x08\x62uild_id\x18\x02 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\"@\n\x11TruncatableString\x12\r\n\x05value\x18\x01 \x01(\t\x12\x1c\n\x14truncated_byte_count\x18\x02 \x01(\x05\x42\xad\x01\n!com.google.devtools.cloudtrace.v2B\nTraceProtoP\x01Z/cloud.google.com/go/trace/apiv2/tracepb;tracepb\xaa\x02\x15Google.Cloud.Trace.V2\xca\x02\x15Google\\Cloud\\Trace\\V2\xea\x02\x18Google::Cloud::Trace::V2b\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.rpc.Status", "google/rpc/status.proto"], - ["google.protobuf.BoolValue", "google/protobuf/wrappers.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 Trace - module V2 - Span = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span").msgclass - Span::Attributes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Attributes").msgclass - Span::TimeEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent").msgclass - Span::TimeEvent::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation").msgclass - Span::TimeEvent::MessageEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent").msgclass - Span::TimeEvent::MessageEvent::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type").enummodule - Span::TimeEvents = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.TimeEvents").msgclass - Span::Link = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link").msgclass - Span::Link::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Link.Type").enummodule - Span::Links = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.Links").msgclass - Span::SpanKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Span.SpanKind").enummodule - AttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.AttributeValue").msgclass - StackTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace").msgclass - StackTrace::StackFrame = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrame").msgclass - StackTrace::StackFrames = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.StackTrace.StackFrames").msgclass - Module = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.Module").msgclass - TruncatableString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.TruncatableString").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb deleted file mode 100644 index 5127c0102621..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudtrace/v2/tracing.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/devtools/cloudtrace/v2/trace_pb' -require 'google/protobuf/empty_pb' - - -descriptor_data = "\n+google/devtools/cloudtrace/v2/tracing.proto\x12\x1dgoogle.devtools.cloudtrace.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/devtools/cloudtrace/v2/trace.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x94\x01\n\x16\x42\x61tchWriteSpansRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x37\n\x05spans\x18\x02 \x03(\x0b\x32#.google.devtools.cloudtrace.v2.SpanB\x03\xe0\x41\x02\x32\xba\x03\n\x0cTraceService\x12\xa1\x01\n\x0f\x42\x61tchWriteSpans\x12\x35.google.devtools.cloudtrace.v2.BatchWriteSpansRequest\x1a\x16.google.protobuf.Empty\"?\xda\x41\nname,spans\x82\xd3\xe4\x93\x02,\"\'/v2/{name=projects/*}/traces:batchWrite:\x01*\x12\x89\x01\n\nCreateSpan\x12#.google.devtools.cloudtrace.v2.Span\x1a#.google.devtools.cloudtrace.v2.Span\"1\x82\xd3\xe4\x93\x02+\"&/v2/{name=projects/*/traces/*/spans/*}:\x01*\x1az\xca\x41\x19\x63loudtrace.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.appendB\xaf\x01\n!com.google.devtools.cloudtrace.v2B\x0cTracingProtoP\x01Z/cloud.google.com/go/trace/apiv2/tracepb;tracepb\xaa\x02\x15Google.Cloud.Trace.V2\xca\x02\x15Google\\Cloud\\Trace\\V2\xea\x02\x18Google::Cloud::Trace::V2b\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.devtools.cloudtrace.v2.Span", "google/devtools/cloudtrace/v2/trace.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 Trace - module V2 - BatchWriteSpansRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudtrace.v2.BatchWriteSpansRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb b/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb deleted file mode 100644 index a6ad28a02fee..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/devtools/cloudtrace/v2/tracing.proto for package 'Google.Cloud.Trace.V2' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/devtools/cloudtrace/v2/tracing_pb' - -module Google - module Cloud - module Trace - module V2 - module TraceService - # Service for collecting and viewing traces and spans within a trace. - # - # A trace is a collection of spans corresponding to a single - # operation or a set of operations in an application. - # - # A span is an individual timed event which forms a node of the trace tree. - # A single trace can contain spans from multiple services. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.devtools.cloudtrace.v2.TraceService' - - # Batch writes new spans to new or existing traces. You cannot update - # existing spans. - rpc :BatchWriteSpans, ::Google::Cloud::Trace::V2::BatchWriteSpansRequest, ::Google::Protobuf::Empty - # Creates a new span. - rpc :CreateSpan, ::Google::Cloud::Trace::V2::Span, ::Google::Cloud::Trace::V2::Span - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md deleted file mode 100644 index bcb9d2cdc0ae..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Trace V2 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-trace-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb deleted file mode 100644 index 040d6c9b24da..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/trace.rb +++ /dev/null @@ -1,427 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V2 - # A span represents a single operation within a trace. Spans can be - # nested to form a trace tree. Often, a trace contains a root span - # that describes the end-to-end latency, and one or more subspans for - # its sub-operations. - # - # A trace can also contain multiple root spans, or none at all. - # Spans do not need to be contiguous. There might be - # gaps or overlaps between spans in a trace. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the span in the following format: - # - # * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` - # - # `[TRACE_ID]` is a unique identifier for a trace within a project; - # it is a 32-character hexadecimal encoding of a 16-byte array. It should - # not be zero. - # - # `[SPAN_ID]` is a unique identifier for a span within a trace; it - # is a 16-character hexadecimal encoding of an 8-byte array. It should not - # be zero. - # . - # @!attribute [rw] span_id - # @return [::String] - # Required. The `[SPAN_ID]` portion of the span's resource name. - # @!attribute [rw] parent_span_id - # @return [::String] - # The `[SPAN_ID]` of this span's parent span. If this is a root span, - # then this field must be empty. - # @!attribute [rw] display_name - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # Required. A description of the span's operation (up to 128 bytes). - # Cloud Trace displays the description in the - # Cloud console. - # For example, the display name can be a qualified method name or a file name - # and a line number where the operation is called. A best practice is to use - # the same display name within an application and at the same call point. - # This makes it easier to correlate spans in different traces. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Required. The start time of the span. On the client side, this is the time - # kept by the local machine where the span execution starts. On the server - # side, this is the time when the server's application handler starts - # running. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # Required. The end time of the span. On the client side, this is the time - # kept by the local machine where the span execution ends. On the server - # side, this is the time when the server application handler stops running. - # @!attribute [rw] attributes - # @return [::Google::Cloud::Trace::V2::Span::Attributes] - # A set of attributes on the span. You can have up to 32 attributes per - # span. - # @!attribute [rw] stack_trace - # @return [::Google::Cloud::Trace::V2::StackTrace] - # Stack trace captured at the start of the span. - # @!attribute [rw] time_events - # @return [::Google::Cloud::Trace::V2::Span::TimeEvents] - # A set of time events. You can have up to 32 annotations and 128 message - # events per span. - # @!attribute [rw] links - # @return [::Google::Cloud::Trace::V2::Span::Links] - # Links associated with the span. You can have up to 128 links per Span. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Optional. The final status for this span. - # @!attribute [rw] same_process_as_parent_span - # @return [::Google::Protobuf::BoolValue] - # Optional. Set this parameter to indicate whether this span is in - # the same process as its parent. If you do not set this parameter, - # Trace is unable to take advantage of this helpful information. - # @!attribute [rw] child_span_count - # @return [::Google::Protobuf::Int32Value] - # Optional. The number of child spans that were generated while this span - # was active. If set, allows implementation to detect missing child spans. - # @!attribute [rw] span_kind - # @return [::Google::Cloud::Trace::V2::Span::SpanKind] - # Optional. Distinguishes between spans generated in a particular context. - # For example, two spans with the same name may be distinguished using - # `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. - class Span - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A set of attributes as key-value pairs. - # @!attribute [rw] attribute_map - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Trace::V2::AttributeValue}] - # A set of attributes. Each attribute's key can be up to 128 bytes - # long. The value can be a string up to 256 bytes, a signed 64-bit integer, - # or the boolean values `true` or `false`. For example: - # - # "/instance_id": { "string_value": { "value": "my-instance" } } - # "/http/request_bytes": { "int_value": 300 } - # "abc.com/myattribute": { "bool_value": false } - # @!attribute [rw] dropped_attributes_count - # @return [::Integer] - # The number of attributes that were discarded. Attributes can be discarded - # because their keys are too long or because there are too many attributes. - # If this value is 0 then all attributes are valid. - class Attributes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Trace::V2::AttributeValue] - class AttributeMapEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A time-stamped annotation or message event in the Span. - # @!attribute [rw] time - # @return [::Google::Protobuf::Timestamp] - # The timestamp indicating the time the event occurred. - # @!attribute [rw] annotation - # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::Annotation] - # Text annotation with a set of attributes. - # - # Note: The following fields are mutually exclusive: `annotation`, `message_event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] message_event - # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::MessageEvent] - # An event describing a message sent/received between Spans. - # - # Note: The following fields are mutually exclusive: `message_event`, `annotation`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class TimeEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Text annotation with a set of attributes. - # @!attribute [rw] description - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # A user-supplied message describing the event. The maximum length for - # the description is 256 bytes. - # @!attribute [rw] attributes - # @return [::Google::Cloud::Trace::V2::Span::Attributes] - # A set of attributes on the annotation. You can have up to 4 attributes - # per Annotation. - class Annotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An event describing a message sent/received between Spans. - # @!attribute [rw] type - # @return [::Google::Cloud::Trace::V2::Span::TimeEvent::MessageEvent::Type] - # Type of MessageEvent. Indicates whether the message was sent or - # received. - # @!attribute [rw] id - # @return [::Integer] - # An identifier for the MessageEvent's message that can be used to match - # `SENT` and `RECEIVED` MessageEvents. - # @!attribute [rw] uncompressed_size_bytes - # @return [::Integer] - # The number of uncompressed bytes sent or received. - # @!attribute [rw] compressed_size_bytes - # @return [::Integer] - # The number of compressed bytes sent or received. If missing, the - # compressed size is assumed to be the same size as the uncompressed - # size. - class MessageEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates whether the message was sent or received. - module Type - # Unknown event type. - TYPE_UNSPECIFIED = 0 - - # Indicates a sent message. - SENT = 1 - - # Indicates a received message. - RECEIVED = 2 - end - end - end - - # A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation - # on the span, consisting of either user-supplied key:value pairs, or - # details of a message sent/received between Spans. - # @!attribute [rw] time_event - # @return [::Array<::Google::Cloud::Trace::V2::Span::TimeEvent>] - # A collection of `TimeEvent`s. - # @!attribute [rw] dropped_annotations_count - # @return [::Integer] - # The number of dropped annotations in all the included time events. - # If the value is 0, then no annotations were dropped. - # @!attribute [rw] dropped_message_events_count - # @return [::Integer] - # The number of dropped message events in all the included time events. - # If the value is 0, then no message events were dropped. - class TimeEvents - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A pointer from the current span to another span in the same trace or in a - # different trace. For example, this can be used in batching operations, - # where a single batch handler processes multiple requests from different - # traces or when the handler receives a request from a different project. - # @!attribute [rw] trace_id - # @return [::String] - # The `[TRACE_ID]` for a trace within a project. - # @!attribute [rw] span_id - # @return [::String] - # The `[SPAN_ID]` for a span within a trace. - # @!attribute [rw] type - # @return [::Google::Cloud::Trace::V2::Span::Link::Type] - # The relationship of the current span relative to the linked span. - # @!attribute [rw] attributes - # @return [::Google::Cloud::Trace::V2::Span::Attributes] - # A set of attributes on the link. Up to 32 attributes can be - # specified per link. - class Link - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The relationship of the current span relative to the linked span: child, - # parent, or unspecified. - module Type - # The relationship of the two spans is unknown. - TYPE_UNSPECIFIED = 0 - - # The linked span is a child of the current span. - CHILD_LINKED_SPAN = 1 - - # The linked span is a parent of the current span. - PARENT_LINKED_SPAN = 2 - end - end - - # A collection of links, which are references from this span to a span - # in the same or different trace. - # @!attribute [rw] link - # @return [::Array<::Google::Cloud::Trace::V2::Span::Link>] - # A collection of links. - # @!attribute [rw] dropped_links_count - # @return [::Integer] - # The number of dropped links after the maximum size was enforced. If - # this value is 0, then no links were dropped. - class Links - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Type of span. Can be used to specify additional relationships between spans - # in addition to a parent/child relationship. - module SpanKind - # Unspecified. Do NOT use as default. - # Implementations MAY assume SpanKind.INTERNAL to be default. - SPAN_KIND_UNSPECIFIED = 0 - - # Indicates that the span is used internally. Default value. - INTERNAL = 1 - - # Indicates that the span covers server-side handling of an RPC or other - # remote network request. - SERVER = 2 - - # Indicates that the span covers the client-side wrapper around an RPC or - # other remote request. - CLIENT = 3 - - # Indicates that the span describes producer sending a message to a broker. - # Unlike client and server, there is no direct critical path latency - # relationship between producer and consumer spans (e.g. publishing a - # message to a pubsub service). - PRODUCER = 4 - - # Indicates that the span describes consumer receiving a message from a - # broker. Unlike client and server, there is no direct critical path - # latency relationship between producer and consumer spans (e.g. receiving - # a message from a pubsub service subscription). - CONSUMER = 5 - end - end - - # The allowed types for `[VALUE]` in a `[KEY]:[VALUE]` attribute. - # @!attribute [rw] string_value - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # A string up to 256 bytes long. - # - # Note: The following fields are mutually exclusive: `string_value`, `int_value`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] int_value - # @return [::Integer] - # A 64-bit signed integer. - # - # Note: The following fields are mutually exclusive: `int_value`, `string_value`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # A Boolean value represented by `true` or `false`. - # - # Note: The following fields are mutually exclusive: `bool_value`, `string_value`, `int_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AttributeValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A call stack appearing in a trace. - # @!attribute [rw] stack_frames - # @return [::Google::Cloud::Trace::V2::StackTrace::StackFrames] - # Stack frames in this stack trace. A maximum of 128 frames are allowed. - # @!attribute [rw] stack_trace_hash_id - # @return [::Integer] - # The hash ID is used to conserve network bandwidth for duplicate - # stack traces within a single trace. - # - # Often multiple spans will have identical stack traces. - # The first occurrence of a stack trace should contain both the - # `stackFrame` content and a value in `stackTraceHashId`. - # - # Subsequent spans within the same request can refer - # to that stack trace by only setting `stackTraceHashId`. - class StackTrace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a single stack frame in a stack trace. - # @!attribute [rw] function_name - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # The fully-qualified name that uniquely identifies the function or - # method that is active in this frame (up to 1024 bytes). - # @!attribute [rw] original_function_name - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # An un-mangled function name, if `function_name` is mangled. - # To get information about name mangling, run - # [this search](https://www.google.com/search?q=cxx+name+mangling). - # The name can be fully-qualified (up to 1024 bytes). - # @!attribute [rw] file_name - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # The name of the source file where the function call appears (up to 256 - # bytes). - # @!attribute [rw] line_number - # @return [::Integer] - # The line number in `file_name` where the function call appears. - # @!attribute [rw] column_number - # @return [::Integer] - # The column number where the function call appears, if available. - # This is important in JavaScript because of its anonymous functions. - # @!attribute [rw] load_module - # @return [::Google::Cloud::Trace::V2::Module] - # The binary module from where the code was loaded. - # @!attribute [rw] source_version - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # The version of the deployed source code (up to 128 bytes). - class StackFrame - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection of stack frames, which can be truncated. - # @!attribute [rw] frame - # @return [::Array<::Google::Cloud::Trace::V2::StackTrace::StackFrame>] - # Stack frames in this call stack. - # @!attribute [rw] dropped_frames_count - # @return [::Integer] - # The number of stack frames that were dropped because there - # were too many stack frames. - # If this value is 0, then no stack frames were dropped. - class StackFrames - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Binary module. - # @!attribute [rw] module - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # For example: main binary, kernel modules, and dynamic libraries - # such as libc.so, sharedlib.so (up to 256 bytes). - # @!attribute [rw] build_id - # @return [::Google::Cloud::Trace::V2::TruncatableString] - # A unique identifier for the module, usually a hash of its - # contents (up to 128 bytes). - class Module - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a string that might be shortened to a specified length. - # @!attribute [rw] value - # @return [::String] - # The shortened string. For example, if the original string is 500 - # bytes long and the limit of the string is 128 bytes, then - # `value` contains the first 128 bytes of the 500-byte string. - # - # Truncation always happens on a UTF8 character boundary. If there - # are multi-byte characters in the string, then the length of the - # shortened string might be less than the size limit. - # @!attribute [rw] truncated_byte_count - # @return [::Integer] - # The number of bytes removed from the original string. If this - # value is 0, then the string was not shortened. - class TruncatableString - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb deleted file mode 100644 index cd7bfb705d2f..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/devtools/cloudtrace/v2/tracing.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Trace - module V2 - # The request message for the `BatchWriteSpans` method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the project where the spans belong. The format is - # `projects/[PROJECT_ID]`. - # @!attribute [rw] spans - # @return [::Array<::Google::Cloud::Trace::V2::Span>] - # Required. A list of new spans. The span names must not match existing - # spans, otherwise the results are undefined. - class BatchWriteSpansRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 1b485b0c3456..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile deleted file mode 100644 index d4b193b35cd6..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-trace-v2", path: "../" -else - gem "google-cloud-trace-v2" -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-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json b/owl-bot-staging/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json deleted file mode 100644 index 3f9f5b451203..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-trace-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.devtools.cloudtrace.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync", - "title": "Snippet for the batch_write_spans call in the TraceService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V2::TraceService::Client#batch_write_spans.", - "file": "trace_service/batch_write_spans.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_write_spans", - "full_name": "::Google::Cloud::Trace::V2::TraceService::Client#batch_write_spans", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Trace::V2::BatchWriteSpansRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TraceService::Client", - "full_name": "::Google::Cloud::Trace::V2::TraceService::Client" - }, - "method": { - "short_name": "BatchWriteSpans", - "full_name": "google.devtools.cloudtrace.v2.TraceService.BatchWriteSpans", - "service": { - "short_name": "TraceService", - "full_name": "google.devtools.cloudtrace.v2.TraceService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "cloudtrace_v2_generated_TraceService_CreateSpan_sync", - "title": "Snippet for the create_span call in the TraceService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Trace::V2::TraceService::Client#create_span.", - "file": "trace_service/create_span.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_span", - "full_name": "::Google::Cloud::Trace::V2::TraceService::Client#create_span", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Trace::V2::Span", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Trace::V2::Span", - "client": { - "short_name": "TraceService::Client", - "full_name": "::Google::Cloud::Trace::V2::TraceService::Client" - }, - "method": { - "short_name": "CreateSpan", - "full_name": "google.devtools.cloudtrace.v2.TraceService.CreateSpan", - "service": { - "short_name": "TraceService", - "full_name": "google.devtools.cloudtrace.v2.TraceService" - } - } - }, - "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-trace-v2/snippets/trace_service/batch_write_spans.rb b/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb deleted file mode 100644 index e643549fe9fa..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync] -require "google/cloud/trace/v2" - -## -# Snippet for the batch_write_spans call in the TraceService 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::Trace::V2::TraceService::Client#batch_write_spans. -# -def batch_write_spans - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Trace::V2::TraceService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new - - # Call the batch_write_spans method. - result = client.batch_write_spans request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync] diff --git a/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb b/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb deleted file mode 100644 index b5360303f20b..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/snippets/trace_service/create_span.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 cloudtrace_v2_generated_TraceService_CreateSpan_sync] -require "google/cloud/trace/v2" - -## -# Snippet for the create_span call in the TraceService 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::Trace::V2::TraceService::Client#create_span. -# -def create_span - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Trace::V2::TraceService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Trace::V2::Span.new - - # Call the create_span method. - result = client.create_span request - - # The returned object is of type Google::Cloud::Trace::V2::Span. - p result -end -# [END cloudtrace_v2_generated_TraceService_CreateSpan_sync] diff --git a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb deleted file mode 100644 index 603da3b3b484..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_paths_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/trace/v2/trace_service" - -class ::Google::Cloud::Trace::V2::TraceService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_span_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.span_path project: "value0", trace: "value1", span: "value2" - assert_equal "projects/value0/traces/value1/spans/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb deleted file mode 100644 index 8660e0c553e2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_rest_test.rb +++ /dev/null @@ -1,221 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" -require "google/cloud/trace/v2/trace_service/rest" - - -class ::Google::Cloud::Trace::V2::TraceService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_batch_write_spans - # 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" - spans = [{}] - - batch_write_spans_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Trace::V2::TraceService::Rest::ServiceStub.stub :transcode_batch_write_spans_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_write_spans_client_stub do - # Create client - client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_write_spans({ name: name, spans: spans }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_write_spans name: name, spans: spans do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_write_spans ::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_write_spans({ name: name, spans: spans }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_write_spans(::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_write_spans_client_stub.call_count - end - end - end - - def test_create_span - # Create test objects. - client_result = ::Google::Cloud::Trace::V2::Span.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - span_id = "hello world" - parent_span_id = "hello world" - display_name = {} - start_time = {} - end_time = {} - attributes = {} - stack_trace = {} - time_events = {} - links = {} - status = {} - same_process_as_parent_span = {} - child_span_count = {} - span_kind = :SPAN_KIND_UNSPECIFIED - - create_span_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Trace::V2::TraceService::Rest::ServiceStub.stub :transcode_create_span_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_span_client_stub do - # Create client - client = ::Google::Cloud::Trace::V2::TraceService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_span name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_span ::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_span(::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_span_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::Trace::V2::TraceService::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::Trace::V2::TraceService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb b/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb deleted file mode 100644 index 3e5178e2ec6e..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/google/cloud/trace/v2/trace_service_test.rb +++ /dev/null @@ -1,248 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/devtools/cloudtrace/v2/tracing_pb" -require "google/cloud/trace/v2/trace_service" - -class ::Google::Cloud::Trace::V2::TraceService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_batch_write_spans - # 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" - spans = [{}] - - batch_write_spans_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_write_spans, name - assert_kind_of ::Google::Cloud::Trace::V2::BatchWriteSpansRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::Trace::V2::Span, request["spans"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_write_spans_client_stub do - # Create client - client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_write_spans({ name: name, spans: spans }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_write_spans name: name, spans: spans do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_write_spans ::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_write_spans({ name: name, spans: spans }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_write_spans(::Google::Cloud::Trace::V2::BatchWriteSpansRequest.new(name: name, spans: spans), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_write_spans_client_stub.call_rpc_count - end - end - - def test_create_span - # Create GRPC objects. - grpc_response = ::Google::Cloud::Trace::V2::Span.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" - span_id = "hello world" - parent_span_id = "hello world" - display_name = {} - start_time = {} - end_time = {} - attributes = {} - stack_trace = {} - time_events = {} - links = {} - status = {} - same_process_as_parent_span = {} - child_span_count = {} - span_kind = :SPAN_KIND_UNSPECIFIED - - create_span_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_span, name - assert_kind_of ::Google::Cloud::Trace::V2::Span, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["span_id"] - assert_equal "hello world", request["parent_span_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::TruncatableString), request["display_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["end_time"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::Span::Attributes), request["attributes"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::StackTrace), request["stack_trace"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::Span::TimeEvents), request["time_events"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Trace::V2::Span::Links), request["links"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Rpc::Status), request["status"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::BoolValue), request["same_process_as_parent_span"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Int32Value), request["child_span_count"] - assert_equal :SPAN_KIND_UNSPECIFIED, request["span_kind"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_span_client_stub do - # Create client - client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_span name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_span ::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_span({ name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_span(::Google::Cloud::Trace::V2::Span.new(name: name, span_id: span_id, parent_span_id: parent_span_id, display_name: display_name, start_time: start_time, end_time: end_time, attributes: attributes, stack_trace: stack_trace, time_events: time_events, links: links, status: status, same_process_as_parent_span: same_process_as_parent_span, child_span_count: child_span_count, span_kind: span_kind), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_span_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::Trace::V2::TraceService::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::Trace::V2::TraceService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Trace::V2::TraceService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Trace::V2::TraceService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-trace-v2/test/helper.rb b/owl-bot-staging/google-cloud-trace-v2/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-trace-v2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-translate-v3/.gitignore b/owl-bot-staging/google-cloud-translate-v3/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/.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-translate-v3/.repo-metadata.json b/owl-bot-staging/google-cloud-translate-v3/.repo-metadata.json deleted file mode 100644 index 550038f3aaea..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "translate.googleapis.com", - "api_shortname": "translate", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest", - "distribution_name": "google-cloud-translate-v3", - "is_cloud": true, - "language": "ruby", - "name": "translate", - "name_pretty": "Cloud Translation V3 API", - "product_documentation": "https://cloud.google.com/translate", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. Note that google-cloud-translate-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-translate instead. See the readme for more details.", - "ruby-cloud-env-prefix": "TRANSLATE", - "ruby-cloud-product-url": "https://cloud.google.com/translate", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-translate-v3/.rubocop.yml b/owl-bot-staging/google-cloud-translate-v3/.rubocop.yml deleted file mode 100644 index 68b485677107..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-translate-v3.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-translate-v3.rb" diff --git a/owl-bot-staging/google-cloud-translate-v3/.toys.rb b/owl-bot-staging/google-cloud-translate-v3/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/.yardopts b/owl-bot-staging/google-cloud-translate-v3/.yardopts deleted file mode 100644 index 6a5acb03bbde..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Translation V3 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-translate-v3/AUTHENTICATION.md b/owl-bot-staging/google-cloud-translate-v3/AUTHENTICATION.md deleted file mode 100644 index f67deb161865..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-translate-v3 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-translate-v3 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/translate/v3" - -client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/translate/v3" - -::Google::Cloud::Translate::V3::TranslationService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Translate::V3::TranslationService::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-translate-v3 -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/translate/v3" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Translate::V3::TranslationService::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-translate-v3/CHANGELOG.md b/owl-bot-staging/google-cloud-translate-v3/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-translate-v3/Gemfile b/owl-bot-staging/google-cloud-translate-v3/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-translate-v3/LICENSE.md b/owl-bot-staging/google-cloud-translate-v3/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/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-translate-v3/README.md b/owl-bot-staging/google-cloud-translate-v3/README.md deleted file mode 100644 index 99718bb0a50c..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Translation V3 API - -Integrates text translation into your website or application. - -Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. - -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 Translation V3 API. Most users should consider using -the main client gem, -[google-cloud-translate](https://rubygems.org/gems/google-cloud-translate). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-translate-v3 -``` - -## 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/translate.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/translate/v3" - -client = ::Google::Cloud::Translate::V3::TranslationService::Client.new -request = ::Google::Cloud::Translate::V3::TranslateTextRequest.new # (request fields as keyword arguments...) -response = client.translate_text request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/translate) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/translate/v3" -require "logger" - -client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-translate`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-translate-v3`. -_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-translate`. -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-translate-v3`. - -### 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-translate-v3/Rakefile b/owl-bot-staging/google-cloud-translate-v3/Rakefile deleted file mode 100644 index 06aca81cc0ab..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TRANSLATE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TRANSLATE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TRANSLATE_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 TRANSLATE_TEST_PROJECT=test123 TRANSLATE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/translate/v3/translation_service/credentials" - ::Google::Cloud::Translate::V3::TranslationService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TRANSLATE_PROJECT"] = project - ENV["TRANSLATE_TEST_PROJECT"] = project - ENV["TRANSLATE_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-translate-v3 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-translate-v3 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-translate-v3 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-translate-v3 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-translate-v3" - header "google-cloud-translate-v3 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-translate-v3 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-translate-v3 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-translate-v3 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-translate-v3 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-translate-v3/gapic_metadata.json b/owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json deleted file mode 100644 index e12339b2e4a4..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/gapic_metadata.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.translation.v3", - "libraryPackage": "::Google::Cloud::Translate::V3", - "services": { - "TranslationService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Translate::V3::TranslationService::Client", - "rpcs": { - "TranslateText": { - "methods": [ - "translate_text" - ] - }, - "RomanizeText": { - "methods": [ - "romanize_text" - ] - }, - "DetectLanguage": { - "methods": [ - "detect_language" - ] - }, - "GetSupportedLanguages": { - "methods": [ - "get_supported_languages" - ] - }, - "TranslateDocument": { - "methods": [ - "translate_document" - ] - }, - "BatchTranslateText": { - "methods": [ - "batch_translate_text" - ] - }, - "BatchTranslateDocument": { - "methods": [ - "batch_translate_document" - ] - }, - "CreateGlossary": { - "methods": [ - "create_glossary" - ] - }, - "UpdateGlossary": { - "methods": [ - "update_glossary" - ] - }, - "ListGlossaries": { - "methods": [ - "list_glossaries" - ] - }, - "GetGlossary": { - "methods": [ - "get_glossary" - ] - }, - "DeleteGlossary": { - "methods": [ - "delete_glossary" - ] - }, - "GetGlossaryEntry": { - "methods": [ - "get_glossary_entry" - ] - }, - "ListGlossaryEntries": { - "methods": [ - "list_glossary_entries" - ] - }, - "CreateGlossaryEntry": { - "methods": [ - "create_glossary_entry" - ] - }, - "UpdateGlossaryEntry": { - "methods": [ - "update_glossary_entry" - ] - }, - "DeleteGlossaryEntry": { - "methods": [ - "delete_glossary_entry" - ] - }, - "CreateDataset": { - "methods": [ - "create_dataset" - ] - }, - "GetDataset": { - "methods": [ - "get_dataset" - ] - }, - "ListDatasets": { - "methods": [ - "list_datasets" - ] - }, - "DeleteDataset": { - "methods": [ - "delete_dataset" - ] - }, - "CreateAdaptiveMtDataset": { - "methods": [ - "create_adaptive_mt_dataset" - ] - }, - "DeleteAdaptiveMtDataset": { - "methods": [ - "delete_adaptive_mt_dataset" - ] - }, - "GetAdaptiveMtDataset": { - "methods": [ - "get_adaptive_mt_dataset" - ] - }, - "ListAdaptiveMtDatasets": { - "methods": [ - "list_adaptive_mt_datasets" - ] - }, - "AdaptiveMtTranslate": { - "methods": [ - "adaptive_mt_translate" - ] - }, - "GetAdaptiveMtFile": { - "methods": [ - "get_adaptive_mt_file" - ] - }, - "DeleteAdaptiveMtFile": { - "methods": [ - "delete_adaptive_mt_file" - ] - }, - "ImportAdaptiveMtFile": { - "methods": [ - "import_adaptive_mt_file" - ] - }, - "ListAdaptiveMtFiles": { - "methods": [ - "list_adaptive_mt_files" - ] - }, - "ListAdaptiveMtSentences": { - "methods": [ - "list_adaptive_mt_sentences" - ] - }, - "ImportData": { - "methods": [ - "import_data" - ] - }, - "ExportData": { - "methods": [ - "export_data" - ] - }, - "ListExamples": { - "methods": [ - "list_examples" - ] - }, - "CreateModel": { - "methods": [ - "create_model" - ] - }, - "ListModels": { - "methods": [ - "list_models" - ] - }, - "GetModel": { - "methods": [ - "get_model" - ] - }, - "DeleteModel": { - "methods": [ - "delete_model" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec b/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec deleted file mode 100644 index d0c7184e0d02..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/google-cloud-translate-v3.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/translate/v3/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-translate-v3" - gem.version = Google::Cloud::Translate::V3::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. Note that google-cloud-translate-v3 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-translate instead. See the readme for more details." - gem.summary = "Integrates text translation into your website or application." - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "google-iam-v1", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb deleted file mode 100644 index 4feb19bf3cb3..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google-cloud-translate-v3.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3" diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb deleted file mode 100644 index 9da4decef7f8..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service" -require "google/cloud/translate/v3/version" - -module Google - module Cloud - module Translate - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/translate/v3" - # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/translate/v3" - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - module V3 - end - end - end -end - -helper_path = ::File.join __dir__, "v3", "_helpers.rb" -require "google/cloud/translate/v3/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb deleted file mode 100644 index d4d827c8bde8..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/adaptive_mt_pb.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/translate/v3/adaptive_mt.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/translate/v3/common_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n+google/cloud/translate/v3/adaptive_mt.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa1\x03\n\x11\x41\x64\x61ptiveMtDataset\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1c\n\x14source_language_code\x18\x03 \x01(\t\x12\x1c\n\x14target_language_code\x18\x04 \x01(\t\x12\x15\n\rexample_count\x18\x05 \x01(\x05\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:u\xea\x41r\n*translate.googleapis.com/AdaptiveMtDataset\x12\x44projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}\"\xad\x01\n\x1e\x43reateAdaptiveMtDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12P\n\x13\x61\x64\x61ptive_mt_dataset\x18\x02 \x01(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x02\"b\n\x1e\x44\x65leteAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"_\n\x1bGetAdaptiveMtDatasetRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\"\xa0\x01\n\x1dListAdaptiveMtDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\"\x91\x01\n\x1eListAdaptiveMtDatasetsResponse\x12Q\n\x14\x61\x64\x61ptive_mt_datasets\x18\x01 \x03(\x0b\x32..google.cloud.translation.v3.AdaptiveMtDatasetB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8b\x08\n\x1a\x41\x64\x61ptiveMtTranslateRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x07\x64\x61taset\x18\x02 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12\x14\n\x07\x63ontent\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12w\n\x19reference_sentence_config\x18\x06 \x01(\x0b\x32O.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentenceConfigH\x00\x88\x01\x01\x12i\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x46.google.cloud.translation.v3.AdaptiveMtTranslateRequest.GlossaryConfigB\x03\xe0\x41\x01H\x01\x88\x01\x01\x1aI\n\x15ReferenceSentencePair\x12\x17\n\x0fsource_sentence\x18\x01 \x01(\t\x12\x17\n\x0ftarget_sentence\x18\x02 \x01(\t\x1a\x8c\x01\n\x19ReferenceSentencePairList\x12o\n\x18reference_sentence_pairs\x18\x01 \x03(\x0b\x32M.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePair\x1a\xcf\x01\n\x17ReferenceSentenceConfig\x12x\n\x1dreference_sentence_pair_lists\x18\x01 \x03(\x0b\x32Q.google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePairList\x12\x1c\n\x14source_language_code\x18\x02 \x01(\t\x12\x1c\n\x14target_language_code\x18\x03 \x01(\t\x1a\x94\x01\n\x0eGlossaryConfig\x12;\n\x08glossary\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1e\x63ontextual_translation_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1c\n\x1a_reference_sentence_configB\x12\n\x10_glossary_config\"5\n\x15\x41\x64\x61ptiveMtTranslation\x12\x1c\n\x0ftranslated_text\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xdb\x01\n\x1b\x41\x64\x61ptiveMtTranslateResponse\x12M\n\x0ctranslations\x18\x01 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslationB\x03\xe0\x41\x03\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Q\n\x15glossary_translations\x18\x04 \x03(\x0b\x32\x32.google.cloud.translation.v3.AdaptiveMtTranslation\"\x94\x03\n\x0e\x41\x64\x61ptiveMtFile\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\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:\xab\x01\xea\x41\xa7\x01\n\'translate.googleapis.com/AdaptiveMtFile\x12[projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}*\x0f\x61\x64\x61ptiveMtFiles2\x0e\x61\x64\x61ptiveMtFile\"Y\n\x18GetAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\\\n\x1b\x44\x65leteAdaptiveMtFileRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\"\xff\x01\n\x1bImportAdaptiveMtFileRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\x12I\n\x11\x66ile_input_source\x18\x02 \x01(\x0b\x32,.google.cloud.translation.v3.FileInputSourceH\x00\x12G\n\x10gcs_input_source\x18\x03 \x01(\x0b\x32+.google.cloud.translation.v3.GcsInputSourceH\x00\x42\x08\n\x06source\"j\n\x1cImportAdaptiveMtFileResponse\x12J\n\x10\x61\x64\x61ptive_mt_file\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\"\x91\x01\n\x1aListAdaptiveMtFilesRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*translate.googleapis.com/AdaptiveMtDataset\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\"\x88\x01\n\x1bListAdaptiveMtFilesResponse\x12K\n\x11\x61\x64\x61ptive_mt_files\x18\x01 \x03(\x0b\x32+.google.cloud.translation.v3.AdaptiveMtFileB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xd8\x03\n\x12\x41\x64\x61ptiveMtSentence\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+translate.googleapis.com/AdaptiveMtSentence\x12\x1c\n\x0fsource_sentence\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarget_sentence\x18\x03 \x01(\tB\x03\xe0\x41\x02\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:\xd6\x01\xea\x41\xd2\x01\n+translate.googleapis.com/AdaptiveMtSentence\x12zprojects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}*\x13\x61\x64\x61ptiveMtSentences2\x12\x61\x64\x61ptiveMtSentence\"\x88\x01\n\x1eListAdaptiveMtSentencesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'translate.googleapis.com/AdaptiveMtFile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x94\x01\n\x1fListAdaptiveMtSentencesResponse\x12S\n\x15\x61\x64\x61ptive_mt_sentences\x18\x01 \x03(\x0b\x32/.google.cloud.translation.v3.AdaptiveMtSentenceB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x42\xc6\x01\n\x1d\x63om.google.cloud.translate.v3B\x0f\x41\x64\x61ptiveMtProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\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.translation.v3.FileInputSource", "google/cloud/translate/v3/common.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 Translate - module V3 - AdaptiveMtDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtDataset").msgclass - CreateAdaptiveMtDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateAdaptiveMtDatasetRequest").msgclass - DeleteAdaptiveMtDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteAdaptiveMtDatasetRequest").msgclass - GetAdaptiveMtDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetAdaptiveMtDatasetRequest").msgclass - ListAdaptiveMtDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtDatasetsRequest").msgclass - ListAdaptiveMtDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtDatasetsResponse").msgclass - AdaptiveMtTranslateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest").msgclass - AdaptiveMtTranslateRequest::ReferenceSentencePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePair").msgclass - AdaptiveMtTranslateRequest::ReferenceSentencePairList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentencePairList").msgclass - AdaptiveMtTranslateRequest::ReferenceSentenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.ReferenceSentenceConfig").msgclass - AdaptiveMtTranslateRequest::GlossaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateRequest.GlossaryConfig").msgclass - AdaptiveMtTranslation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslation").msgclass - AdaptiveMtTranslateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtTranslateResponse").msgclass - AdaptiveMtFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtFile").msgclass - GetAdaptiveMtFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetAdaptiveMtFileRequest").msgclass - DeleteAdaptiveMtFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteAdaptiveMtFileRequest").msgclass - ImportAdaptiveMtFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportAdaptiveMtFileRequest").msgclass - ImportAdaptiveMtFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportAdaptiveMtFileResponse").msgclass - ListAdaptiveMtFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtFilesRequest").msgclass - ListAdaptiveMtFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtFilesResponse").msgclass - AdaptiveMtSentence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.AdaptiveMtSentence").msgclass - ListAdaptiveMtSentencesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtSentencesRequest").msgclass - ListAdaptiveMtSentencesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListAdaptiveMtSentencesResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb deleted file mode 100644 index e0f412d2d493..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/automl_translation_pb.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/translate/v3/automl_translation.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/translate/v3/common_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n2google/cloud/translate/v3/automl_translation.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"u\n\x11ImportDataRequest\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12J\n\x0cinput_config\x18\x02 \x01(\x0b\x32/.google.cloud.translation.v3.DatasetInputConfigB\x03\xe0\x41\x02\"\xd2\x01\n\x12\x44\x61tasetInputConfig\x12N\n\x0binput_files\x18\x01 \x03(\x0b\x32\x39.google.cloud.translation.v3.DatasetInputConfig.InputFile\x1al\n\tInputFile\x12\x12\n\x05usage\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\ngcs_source\x18\x03 \x01(\x0b\x32+.google.cloud.translation.v3.GcsInputSourceH\x00\x42\x08\n\x06source\"\xd5\x01\n\x12ImportDataMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"w\n\x11\x45xportDataRequest\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\routput_config\x18\x02 \x01(\x0b\x32\x30.google.cloud.translation.v3.DatasetOutputConfigB\x03\xe0\x41\x02\"r\n\x13\x44\x61tasetOutputConfig\x12L\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32\x31.google.cloud.translation.v3.GcsOutputDestinationH\x00\x42\r\n\x0b\x64\x65stination\"\xd5\x01\n\x12\x45xportDataMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"N\n\x14\x44\x65leteDatasetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n translate.googleapis.com/Dataset\"\xd8\x01\n\x15\x44\x65leteDatasetMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"K\n\x11GetDatasetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n translate.googleapis.com/Dataset\"\x81\x01\n\x13ListDatasetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\"g\n\x14ListDatasetsResponse\x12\x36\n\x08\x64\x61tasets\x18\x01 \x03(\x0b\x32$.google.cloud.translation.v3.Dataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8d\x01\n\x14\x43reateDatasetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12:\n\x07\x64\x61taset\x18\x02 \x01(\x0b\x32$.google.cloud.translation.v3.DatasetB\x03\xe0\x41\x02\"\xd8\x01\n\x15\x43reateDatasetMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\x95\x01\n\x13ListExamplesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n translate.googleapis.com/Dataset\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"g\n\x14ListExamplesResponse\x12\x36\n\x08\x65xamples\x18\x01 \x03(\x0b\x32$.google.cloud.translation.v3.Example\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd0\x01\n\x07\x45xample\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0bsource_text\x18\x02 \x01(\t\x12\x13\n\x0btarget_text\x18\x03 \x01(\t\x12\x12\n\x05usage\x18\x04 \x01(\tB\x03\xe0\x41\x03:t\xea\x41q\n translate.googleapis.com/Example\x12Mprojects/{project}/locations/{location}/datasets/{dataset}/examples/{example}\"\xe8\x01\n\x1e\x42\x61tchTransferResourcesResponse\x12g\n\tresponses\x18\x01 \x03(\x0b\x32T.google.cloud.translation.v3.BatchTransferResourcesResponse.TransferResourceResponse\x1a]\n\x18TransferResourceResponse\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0e\n\x06target\x18\x02 \x01(\t\x12!\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\xbc\x03\n\x07\x44\x61taset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1c\n\x14source_language_code\x18\x03 \x01(\t\x12\x1c\n\x14target_language_code\x18\x04 \x01(\t\x12\x1a\n\rexample_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13train_example_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12#\n\x16validate_example_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12test_example_count\x18\x08 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:a\xea\x41^\n translate.googleapis.com/Dataset\x12:projects/{project}/locations/{location}/datasets/{dataset}\"\x87\x01\n\x12\x43reateModelRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x36\n\x05model\x18\x02 \x01(\x0b\x32\".google.cloud.translation.v3.ModelB\x03\xe0\x41\x02\"\xd6\x01\n\x13\x43reateModelMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\x94\x01\n\x11ListModelsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x13\n\x06\x66ilter\x18\x04 \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\"a\n\x12ListModelsResponse\x12\x32\n\x06models\x18\x01 \x03(\x0b\x32\".google.cloud.translation.v3.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"G\n\x0fGetModelRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1etranslate.googleapis.com/Model\"J\n\x12\x44\x65leteModelRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1etranslate.googleapis.com/Model\"\xd6\x01\n\x13\x44\x65leteModelMetadata\x12:\n\x05state\x18\x01 \x01(\x0e\x32+.google.cloud.translation.v3.OperationState\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\xb3\x03\n\x05Model\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x61taset\x18\x03 \x01(\t\x12!\n\x14source_language_code\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12!\n\x14target_language_code\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13train_example_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12#\n\x16validate_example_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12test_example_count\x18\x0c \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:[\xea\x41X\n\x1etranslate.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}B\xcd\x01\n\x1d\x63om.google.cloud.translate.v3B\x16\x41utoMLTranslationProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\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.translation.v3.GcsInputSource", "google/cloud/translate/v3/common.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.rpc.Status", "google/rpc/status.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 Translate - module V3 - ImportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportDataRequest").msgclass - DatasetInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DatasetInputConfig").msgclass - DatasetInputConfig::InputFile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DatasetInputConfig.InputFile").msgclass - ImportDataMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ImportDataMetadata").msgclass - ExportDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ExportDataRequest").msgclass - DatasetOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DatasetOutputConfig").msgclass - ExportDataMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ExportDataMetadata").msgclass - DeleteDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteDatasetRequest").msgclass - DeleteDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteDatasetMetadata").msgclass - GetDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetDatasetRequest").msgclass - ListDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListDatasetsRequest").msgclass - ListDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListDatasetsResponse").msgclass - CreateDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateDatasetRequest").msgclass - CreateDatasetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateDatasetMetadata").msgclass - ListExamplesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListExamplesRequest").msgclass - ListExamplesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListExamplesResponse").msgclass - Example = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Example").msgclass - BatchTransferResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTransferResourcesResponse").msgclass - BatchTransferResourcesResponse::TransferResourceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTransferResourcesResponse.TransferResourceResponse").msgclass - Dataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Dataset").msgclass - CreateModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateModelRequest").msgclass - CreateModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateModelMetadata").msgclass - ListModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListModelsRequest").msgclass - ListModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListModelsResponse").msgclass - GetModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetModelRequest").msgclass - DeleteModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteModelRequest").msgclass - DeleteModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteModelMetadata").msgclass - Model = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Model").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb deleted file mode 100644 index 780f191863aa..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" - -module Google - module Cloud - module Translate - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/translate/v3/rest" - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - module V3 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Translate"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v3/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb deleted file mode 100644 index d648a11bc7bc..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/common_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/translate/v3/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n&google/cloud/translate/v3/common.proto\x12\x1bgoogle.cloud.translation.v3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"(\n\x0eGcsInputSource\x12\x16\n\tinput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"Z\n\x0f\x46ileInputSource\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\"6\n\x14GcsOutputDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xf8\x04\n\rGlossaryEntry\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12R\n\nterms_pair\x18\x02 \x01(\x0b\x32<.google.cloud.translation.v3.GlossaryEntry.GlossaryTermsPairH\x00\x12P\n\tterms_set\x18\x03 \x01(\x0b\x32;.google.cloud.translation.v3.GlossaryEntry.GlossaryTermsSetH\x00\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x1a\x93\x01\n\x11GlossaryTermsPair\x12>\n\x0bsource_term\x18\x01 \x01(\x0b\x32).google.cloud.translation.v3.GlossaryTerm\x12>\n\x0btarget_term\x18\x02 \x01(\x0b\x32).google.cloud.translation.v3.GlossaryTerm\x1aL\n\x10GlossaryTermsSet\x12\x38\n\x05terms\x18\x01 \x03(\x0b\x32).google.cloud.translation.v3.GlossaryTerm:\xac\x01\xea\x41\xa8\x01\n&translate.googleapis.com/GlossaryEntry\x12^projects/{project}/locations/{location}/glossaries/{glossary}/glossaryEntries/{glossary_entry}*\x0fglossaryEntries2\rglossaryEntryB\x06\n\x04\x64\x61ta\"3\n\x0cGlossaryTerm\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x0c\n\x04text\x18\x02 \x01(\t*\xc8\x01\n\x0eOperationState\x12\x1f\n\x1bOPERATION_STATE_UNSPECIFIED\x10\x00\x12\x1b\n\x17OPERATION_STATE_RUNNING\x10\x01\x12\x1d\n\x19OPERATION_STATE_SUCCEEDED\x10\x02\x12\x1a\n\x16OPERATION_STATE_FAILED\x10\x03\x12\x1e\n\x1aOPERATION_STATE_CANCELLING\x10\x04\x12\x1d\n\x19OPERATION_STATE_CANCELLED\x10\x05\x42\xc2\x01\n\x1d\x63om.google.cloud.translate.v3B\x0b\x43ommonProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3b\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 = [ - ] - 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 Translate - module V3 - GcsInputSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsInputSource").msgclass - FileInputSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.FileInputSource").msgclass - GcsOutputDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsOutputDestination").msgclass - GlossaryEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryEntry").msgclass - GlossaryEntry::GlossaryTermsPair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryEntry.GlossaryTermsPair").msgclass - GlossaryEntry::GlossaryTermsSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryEntry.GlossaryTermsSet").msgclass - GlossaryTerm = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryTerm").msgclass - OperationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.OperationState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb deleted file mode 100644 index a65a2908a2bd..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service/rest" -require "google/cloud/translate/v3/bindings_override" -require "google/cloud/translate/v3/version" - -module Google - module Cloud - module Translate - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/translate/v3/rest" - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - module V3 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb deleted file mode 100644 index 95ca52623d45..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/version" - -require "google/cloud/translate/v3/translation_service/credentials" -require "google/cloud/translate/v3/translation_service/paths" -require "google/cloud/translate/v3/translation_service/operations" -require "google/cloud/translate/v3/translation_service/client" -require "google/cloud/translate/v3/translation_service/rest" - -module Google - module Cloud - module Translate - module V3 - ## - # Provides natural language translation operations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/translate/v3/translation_service" - # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/translate/v3/translation_service/rest" - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - module TranslationService - end - end - end - end -end - -helper_path = ::File.join __dir__, "translation_service", "helpers.rb" -require "google/cloud/translate/v3/translation_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb deleted file mode 100644 index 98ad81401303..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/client.rb +++ /dev/null @@ -1,4614 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Translate - module V3 - module TranslationService - ## - # Client for the TranslationService service. - # - # Provides natural language translation operations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :translation_service_stub - - ## - # Configure the TranslationService Client class. - # - # See {::Google::Cloud::Translate::V3::TranslationService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TranslationService clients - # ::Google::Cloud::Translate::V3::TranslationService::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", "Translate", "V3"] - 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.translate_text.timeout = 600.0 - - default_config.rpcs.detect_language.timeout = 600.0 - - default_config.rpcs.get_supported_languages.timeout = 600.0 - default_config.rpcs.get_supported_languages.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.translate_document.timeout = 600.0 - - default_config.rpcs.batch_translate_text.timeout = 600.0 - - default_config.rpcs.batch_translate_document.timeout = 600.0 - - default_config.rpcs.create_glossary.timeout = 600.0 - - default_config.rpcs.list_glossaries.timeout = 600.0 - default_config.rpcs.list_glossaries.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_glossary.timeout = 600.0 - default_config.rpcs.get_glossary.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_glossary.timeout = 600.0 - default_config.rpcs.delete_glossary.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TranslationService 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::Translate::V3::TranslationService::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 - @translation_service_stub.universe_domain - end - - ## - # Create a new TranslationService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TranslationService 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/translate/v3/translation_service_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 - - @translation_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Translate::V3::TranslationService::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, - logger: @config.logger - ) - - @translation_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @translation_service_stub.endpoint - config.universe_domain = @translation_service_stub.universe_domain - config.logger = @translation_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @translation_service_stub.endpoint - config.universe_domain = @translation_service_stub.universe_domain - config.logger = @translation_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Translate::V3::TranslationService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @translation_service_stub.logger - end - - # Service calls - - ## - # Translates input text and returns translated text. - # - # @overload translate_text(request, options = nil) - # Pass arguments to `translate_text` via a request object, either of type - # {::Google::Cloud::Translate::V3::TranslateTextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::TranslateTextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload translate_text(contents: nil, mime_type: nil, source_language_code: nil, target_language_code: nil, parent: nil, model: nil, glossary_config: nil, transliteration_config: nil, labels: nil) - # Pass arguments to `translate_text` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param contents [::Array<::String>] - # Required. The content of the input in string format. - # We recommend the total content be less than 30,000 codepoints. The max - # length of this field is 1024. Use BatchTranslateText for larger text. - # @param mime_type [::String] - # Optional. The format of the source text, for example, "text/html", - # "text/plain". If left blank, the MIME type defaults to "text/html". - # @param source_language_code [::String] - # Optional. The ISO-639 language code of the input text if - # known, for example, "en-US" or "sr-Latn". Supported language codes are - # listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). If the source - # language isn't specified, the API attempts to identify the source language - # automatically and returns the source language within the response. - # @param target_language_code [::String] - # Required. The ISO-639 language code to use for translation of the input - # text, set to one of the language codes listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param parent [::String] - # Required. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}` or - # `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for requests using AutoML models or - # custom glossaries. - # - # Models and glossaries must be within the same region (have same - # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - # @param model [::String] - # Optional. The `model` type requested for this translation. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - Translation LLM models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, - # - # For global (non-regionalized) requests, use `location-id` `global`. - # For example, - # `projects/{project-number-or-id}/locations/global/models/general/nmt`. - # - # If not provided, the default Google model (NMT) will be used - # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] - # Optional. Glossary to be applied. The glossary must be - # within the same region (have the same location-id) as the model, otherwise - # an INVALID_ARGUMENT (400) error is returned. - # @param transliteration_config [::Google::Cloud::Translate::V3::TransliterationConfig, ::Hash] - # Optional. Transliteration to be applied. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::TranslateTextResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::TranslateTextResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::TranslateTextRequest.new - # - # # Call the translate_text method. - # result = client.translate_text request - # - # # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. - # p result - # - def translate_text request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateTextRequest - - # Converts hash 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.translate_text.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::Translate::V3::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.translate_text.timeout, - metadata: metadata, - retry_policy: @config.rpcs.translate_text.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :translate_text, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Romanize input text written in non-Latin scripts to Latin text. - # - # @overload romanize_text(request, options = nil) - # Pass arguments to `romanize_text` via a request object, either of type - # {::Google::Cloud::Translate::V3::RomanizeTextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::RomanizeTextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload romanize_text(parent: nil, contents: nil, source_language_code: nil) - # Pass arguments to `romanize_text` via keyword arguments. Note that at - # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}` or - # `projects/{project-number-or-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # @param contents [::Array<::String>] - # Required. The content of the input in string format. - # @param source_language_code [::String] - # Optional. The ISO-639 language code of the input text if - # known, for example, "hi" or "zh". Supported language codes are - # listed in [Language - # Support](https://cloud.google.com/translate/docs/languages#roman). If the - # source language isn't specified, the API attempts to identify the source - # language automatically and returns the source language for each content in - # the response. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::RomanizeTextResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::RomanizeTextResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::RomanizeTextRequest.new - # - # # Call the romanize_text method. - # result = client.romanize_text request - # - # # The returned object is of type Google::Cloud::Translate::V3::RomanizeTextResponse. - # p result - # - def romanize_text request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::RomanizeTextRequest - - # Converts hash 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.romanize_text.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::Translate::V3::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.romanize_text.timeout, - metadata: metadata, - retry_policy: @config.rpcs.romanize_text.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :romanize_text, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Detects the language of text within a request. - # - # @overload detect_language(request, options = nil) - # Pass arguments to `detect_language` via a request object, either of type - # {::Google::Cloud::Translate::V3::DetectLanguageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DetectLanguageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload detect_language(parent: nil, model: nil, content: nil, mime_type: nil, labels: nil) - # Pass arguments to `detect_language` via keyword arguments. Note that at - # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}` or - # `projects/{project-number-or-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Only models within the same region (has same location-id) can be used. - # Otherwise an INVALID_ARGUMENT (400) error is returned. - # @param model [::String] - # Optional. The language detection model to be used. - # - # Format: - # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` - # - # Only one language detection model is currently supported: - # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. - # - # If not specified, the default model is used. - # @param content [::String] - # The content of the input stored as a string. - # @param mime_type [::String] - # Optional. The format of the source text, for example, "text/html", - # "text/plain". If left blank, the MIME type defaults to "text/html". - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::DetectLanguageResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::DetectLanguageResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DetectLanguageRequest.new - # - # # Call the detect_language method. - # result = client.detect_language request - # - # # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. - # p result - # - def detect_language request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DetectLanguageRequest - - # Converts hash 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.detect_language.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::Translate::V3::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.detect_language.timeout, - metadata: metadata, - retry_policy: @config.rpcs.detect_language.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :detect_language, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of supported languages for translation. - # - # @overload get_supported_languages(request, options = nil) - # Pass arguments to `get_supported_languages` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_supported_languages(parent: nil, display_language_code: nil, model: nil) - # Pass arguments to `get_supported_languages` via keyword arguments. Note that at - # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}` or - # `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for AutoML models. - # - # Only models within the same region (have same location-id) can be used, - # otherwise an INVALID_ARGUMENT (400) error is returned. - # @param display_language_code [::String] - # Optional. The language to use to return localized, human readable names - # of supported languages. If missing, then display names are not returned - # in a response. - # @param model [::String] - # Optional. Get supported languages of this model. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # Returns languages supported by the specified model. - # If missing, we get supported languages of Google general NMT model. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::SupportedLanguages] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::SupportedLanguages] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new - # - # # Call the get_supported_languages method. - # result = client.get_supported_languages request - # - # # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. - # p result - # - def get_supported_languages request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest - - # Converts hash 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_supported_languages.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::Translate::V3::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.get_supported_languages.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_supported_languages.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :get_supported_languages, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translates documents in synchronous mode. - # - # @overload translate_document(request, options = nil) - # Pass arguments to `translate_document` via a request object, either of type - # {::Google::Cloud::Translate::V3::TranslateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::TranslateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload translate_document(parent: nil, source_language_code: nil, target_language_code: nil, document_input_config: nil, document_output_config: nil, model: nil, glossary_config: nil, labels: nil, customized_attribution: nil, is_translate_native_pdf_only: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) - # Pass arguments to `translate_document` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for requests using AutoML models or custom - # glossaries. - # - # Models and glossaries must be within the same region (have the same - # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - # @param source_language_code [::String] - # Optional. The ISO-639 language code of the input document if known, for - # example, "en-US" or "sr-Latn". Supported language codes are listed in - # [Language Support](https://cloud.google.com/translate/docs/languages). If - # the source language isn't specified, the API attempts to identify the - # source language automatically and returns the source language within the - # response. Source language must be specified if the request contains a - # glossary or a custom model. - # @param target_language_code [::String] - # Required. The ISO-639 language code to use for translation of the input - # document, set to one of the language codes listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param document_input_config [::Google::Cloud::Translate::V3::DocumentInputConfig, ::Hash] - # Required. Input configurations. - # @param document_output_config [::Google::Cloud::Translate::V3::DocumentOutputConfig, ::Hash] - # Optional. Output configurations. - # Defines if the output file should be stored within Cloud Storage as well - # as the desired output format. If not provided the translated file will - # only be returned through a byte-stream and its output mime type will be - # the same as the input file's mime type. - # @param model [::String] - # Optional. The `model` type requested for this translation. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If not provided, the default Google model (NMT) will be used for - # translation. - # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] - # Optional. Glossary to be applied. The glossary must be within the same - # region (have the same location-id) as the model, otherwise an - # INVALID_ARGUMENT (400) error is returned. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters (Unicode - # codepoints), can only contain lowercase letters, numeric characters, - # underscores and dashes. International characters are allowed. Label values - # are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # @param customized_attribution [::String] - # Optional. This flag is to support user customized attribution. - # If not provided, the default is `Machine Translated by Google`. - # Customized attribution should follow rules in - # https://cloud.google.com/translate/attribution#attribution_and_logos - # @param is_translate_native_pdf_only [::Boolean] - # Optional. is_translate_native_pdf_only field for external customers. - # If true, the page limit of online native pdf translation is 300 and only - # native pdf pages will be translated. - # @param enable_shadow_removal_native_pdf [::Boolean] - # Optional. If true, use the text removal server to remove the shadow text on - # background image for native pdf translation. - # Shadow removal feature can only be enabled when - # is_translate_native_pdf_only: false && pdf_native_only: false - # @param enable_rotation_correction [::Boolean] - # Optional. If true, enable auto rotation correction in DVS. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::TranslateDocumentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::TranslateDocumentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new - # - # # Call the translate_document method. - # result = client.translate_document request - # - # # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. - # p result - # - def translate_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateDocumentRequest - - # Converts hash 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.translate_document.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::Translate::V3::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.translate_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.translate_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :translate_document, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translates a large volume of text in asynchronous batch mode. - # This function provides real-time output as the inputs are being processed. - # If caller cancels a request, the partial results (for an input file, it's - # all or nothing) may still be available on the specified output location. - # - # This call returns immediately and you can - # use google.longrunning.Operation.name to poll the status of the call. - # - # @overload batch_translate_text(request, options = nil) - # Pass arguments to `batch_translate_text` via a request object, either of type - # {::Google::Cloud::Translate::V3::BatchTranslateTextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::BatchTranslateTextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_translate_text(parent: nil, source_language_code: nil, target_language_codes: nil, models: nil, input_configs: nil, output_config: nil, glossaries: nil, labels: nil) - # Pass arguments to `batch_translate_text` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a call. Must refer to a caller's project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # The `global` location is not supported for batch translation. - # - # Only AutoML Translation models or glossaries within the same region (have - # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - # error is returned. - # @param source_language_code [::String] - # Required. Source language code. Supported language codes are listed in - # [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param target_language_codes [::Array<::String>] - # Required. Specify up to 10 language codes here. Supported language codes - # are listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param models [::Hash{::String => ::String}] - # Optional. The models to use for translation. Map's key is target language - # code. Map's value is model name. Value can be a built-in general model, - # or an AutoML Translation model. - # - # The value format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If the map is empty or a specific model is - # not requested for a language pair, then default google model (nmt) is used. - # @param input_configs [::Array<::Google::Cloud::Translate::V3::InputConfig, ::Hash>] - # Required. Input configurations. - # The total number of files matched should be <= 100. - # The total content size should be <= 100M Unicode codepoints. - # The files must use UTF-8 encoding. - # @param output_config [::Google::Cloud::Translate::V3::OutputConfig, ::Hash] - # Required. Output configuration. - # If 2 input configs match to the same file (that is, same input path), - # we don't generate output for duplicate inputs. - # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] - # Optional. Glossaries to be applied for translation. - # It's keyed by target language code. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new - # - # # Call the batch_translate_text method. - # result = client.batch_translate_text 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 batch_translate_text request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateTextRequest - - # Converts hash 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.batch_translate_text.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::Translate::V3::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.batch_translate_text.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_translate_text.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :batch_translate_text, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translates a large volume of document in asynchronous batch mode. - # This function provides real-time output as the inputs are being processed. - # If caller cancels a request, the partial results (for an input file, it's - # all or nothing) may still be available on the specified output location. - # - # This call returns immediately and you can use - # google.longrunning.Operation.name to poll the status of the call. - # - # @overload batch_translate_document(request, options = nil) - # Pass arguments to `batch_translate_document` via a request object, either of type - # {::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_translate_document(parent: nil, source_language_code: nil, target_language_codes: nil, input_configs: nil, output_config: nil, models: nil, glossaries: nil, format_conversions: nil, customized_attribution: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) - # Pass arguments to `batch_translate_document` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # The `global` location is not supported for batch translation. - # - # Only AutoML Translation models or glossaries within the same region (have - # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - # error is returned. - # @param source_language_code [::String] - # Required. The ISO-639 language code of the input document if known, for - # example, "en-US" or "sr-Latn". Supported language codes are listed in - # [Language Support](https://cloud.google.com/translate/docs/languages). - # @param target_language_codes [::Array<::String>] - # Required. The ISO-639 language code to use for translation of the input - # document. Specify up to 10 language codes here. Supported language codes - # are listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param input_configs [::Array<::Google::Cloud::Translate::V3::BatchDocumentInputConfig, ::Hash>] - # Required. Input configurations. - # The total number of files matched should be <= 100. - # The total content size to translate should be <= 100M Unicode codepoints. - # The files must use UTF-8 encoding. - # @param output_config [::Google::Cloud::Translate::V3::BatchDocumentOutputConfig, ::Hash] - # Required. Output configuration. - # If 2 input configs match to the same file (that is, same input path), - # we don't generate output for duplicate inputs. - # @param models [::Hash{::String => ::String}] - # Optional. The models to use for translation. Map's key is target language - # code. Map's value is the model name. Value can be a built-in general model, - # or an AutoML Translation model. - # - # The value format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If the map is empty or a specific model is - # not requested for a language pair, then default google model (nmt) is used. - # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] - # Optional. Glossaries to be applied. It's keyed by target language code. - # @param format_conversions [::Hash{::String => ::String}] - # Optional. The file format conversion map that is applied to all input - # files. The map key is the original mime_type. The map value is the target - # mime_type of translated documents. - # - # Supported file format conversion includes: - # - `application/pdf` to - # `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - # - # If nothing specified, output files will be in the same format as the - # original file. - # @param customized_attribution [::String] - # Optional. This flag is to support user customized attribution. - # If not provided, the default is `Machine Translated by Google`. - # Customized attribution should follow rules in - # https://cloud.google.com/translate/attribution#attribution_and_logos - # @param enable_shadow_removal_native_pdf [::Boolean] - # Optional. If true, use the text removal server to remove the shadow text on - # background image for native pdf translation. - # Shadow removal feature can only be enabled when - # is_translate_native_pdf_only: false && pdf_native_only: false - # @param enable_rotation_correction [::Boolean] - # Optional. If true, enable auto rotation correction in DVS. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new - # - # # Call the batch_translate_document method. - # result = client.batch_translate_document 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 batch_translate_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest - - # Converts hash 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.batch_translate_document.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::Translate::V3::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.batch_translate_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_translate_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :batch_translate_document, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a glossary and returns the long-running operation. Returns - # NOT_FOUND, if the project doesn't exist. - # - # @overload create_glossary(request, options = nil) - # Pass arguments to `create_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(parent: nil, glossary: nil) - # Pass arguments to `create_glossary` via keyword arguments. Note that at - # least one keyword argument is 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 project name. - # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] - # Required. The glossary to create. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new - # - # # Call the create_glossary method. - # result = client.create_glossary 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_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :create_glossary, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a glossary. A LRO is used since the update can be async if the - # glossary's entry file is updated. - # - # @overload update_glossary(request, options = nil) - # Pass arguments to `update_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::UpdateGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(glossary: nil, update_mask: nil) - # Pass arguments to `update_glossary` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] - # Required. The glossary entry to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. Currently only `display_name` and - # 'input_config' - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::UpdateGlossaryRequest.new - # - # # Call the update_glossary method. - # result = client.update_glossary 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_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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.glossary&.name - header_params["glossary.name"] = request.glossary.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_glossary.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :update_glossary, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - # exist. - # - # @overload list_glossaries(request, options = nil) - # Pass arguments to `list_glossaries` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListGlossariesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListGlossariesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossaries(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_glossaries` via keyword arguments. Note that at - # least one keyword argument is 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 name of the project from which to list all of the glossaries. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer glossaries than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of [ListGlossariesResponse.next_page_token] - # returned from the previous call to `ListGlossaries` method. - # The first page is returned if `page_token`is empty or missing. - # @param filter [::String] - # Optional. Filter specifying constraints of a list operation. - # Specify the constraint by the format of "key=value", where key must be - # "src" or "tgt", and the value must be a valid language code. - # For multiple restrictions, concatenate them by "AND" (uppercase only), - # such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used - # here, which means using 'en-US' and 'en' can lead to different results, - # which depends on the language code you used when you create the glossary. - # For the unidirectional glossaries, the "src" and "tgt" add restrictions - # on the source and target language code separately. - # For the equivalent term set glossaries, the "src" and/or "tgt" add - # restrictions on the term set. - # For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional - # glossaries which exactly match the source language code as "en-US" and the - # target language code "zh-CN", but all equivalent term set glossaries which - # contain "en-US" and "zh-CN" in their language set will be picked. - # If missing, no filtering is performed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListGlossariesRequest.new - # - # # Call the list_glossaries method. - # result = client.list_glossaries 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::Translate::V3::Glossary. - # p item - # end - # - def list_glossaries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossariesRequest - - # Converts hash 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_glossaries.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::Translate::V3::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_glossaries.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_glossaries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_glossaries, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_glossaries, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - # exist. - # - # @overload get_glossary(request, options = nil) - # Pass arguments to `get_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(name: nil) - # Pass arguments to `get_glossary` via keyword arguments. Note that at - # least one keyword argument is 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 glossary to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::Glossary] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::Glossary] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetGlossaryRequest.new - # - # # Call the get_glossary method. - # result = client.get_glossary request - # - # # The returned object is of type Google::Cloud::Translate::V3::Glossary. - # p result - # - def get_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :get_glossary, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a glossary, or cancels glossary construction - # if the glossary isn't created yet. - # Returns NOT_FOUND, if the glossary doesn't exist. - # - # @overload delete_glossary(request, options = nil) - # Pass arguments to `delete_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(name: nil) - # Pass arguments to `delete_glossary` via keyword arguments. Note that at - # least one keyword argument is 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 glossary to delete. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new - # - # # Call the delete_glossary method. - # result = client.delete_glossary 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_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :delete_glossary, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a single glossary entry by the given id. - # - # @overload get_glossary_entry(request, options = nil) - # Pass arguments to `get_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) - # Pass arguments to `get_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is 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 glossary entry to get - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::GlossaryEntry] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new - # - # # Call the get_glossary_entry method. - # result = client.get_glossary_entry request - # - # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - # p result - # - def get_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :get_glossary_entry, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List the entries for the glossary. - # - # @overload list_glossary_entries(request, options = nil) - # Pass arguments to `list_glossary_entries` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entries(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_glossary_entries` via keyword arguments. Note that at - # least one keyword argument is 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 glossary resource name for listing the glossary's - # entries. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer glossary entries - # than requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # [ListGlossaryEntriesResponse.next_page_token] returned from the previous - # call. The first page is returned if `page_token`is empty or missing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.new - # - # # Call the list_glossary_entries method. - # result = client.list_glossary_entries 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::Translate::V3::GlossaryEntry. - # p item - # end - # - def list_glossary_entries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest - - # Converts hash 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_glossary_entries.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::Translate::V3::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_glossary_entries.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_glossary_entries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_glossary_entries, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_glossary_entries, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a glossary entry. - # - # @overload create_glossary_entry(request, options = nil) - # Pass arguments to `create_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(parent: nil, glossary_entry: nil) - # Pass arguments to `create_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is 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 glossary to create the entry under. - # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] - # Required. The glossary entry to create - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::GlossaryEntry] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new - # - # # Call the create_glossary_entry method. - # result = client.create_glossary_entry request - # - # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - # p result - # - def create_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :create_glossary_entry, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a glossary entry. - # - # @overload update_glossary_entry(request, options = nil) - # Pass arguments to `update_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(glossary_entry: nil) - # Pass arguments to `update_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] - # Required. The glossary entry to update. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::GlossaryEntry] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new - # - # # Call the update_glossary_entry method. - # result = client.update_glossary_entry request - # - # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - # p result - # - def update_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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.glossary_entry&.name - header_params["glossary_entry.name"] = request.glossary_entry.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_glossary_entry.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :update_glossary_entry, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single entry from the glossary - # - # @overload delete_glossary_entry(request, options = nil) - # Pass arguments to `delete_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) - # Pass arguments to `delete_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is 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 glossary entry 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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new - # - # # Call the delete_glossary_entry method. - # result = client.delete_glossary_entry request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :delete_glossary_entry, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Dataset. - # - # @overload create_dataset(request, options = nil) - # Pass arguments to `create_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(parent: nil, dataset: nil) - # Pass arguments to `create_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 project name. - # @param dataset [::Google::Cloud::Translate::V3::Dataset, ::Hash] - # Required. The Dataset to create. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateDatasetRequest.new - # - # # Call the create_dataset method. - # result = client.create_dataset 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_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateDatasetRequest - - # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :create_dataset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Dataset. - # - # @overload get_dataset(request, options = nil) - # Pass arguments to `get_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `get_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 dataset to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::Dataset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::Dataset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetDatasetRequest.new - # - # # Call the get_dataset method. - # result = client.get_dataset request - # - # # The returned object is of type Google::Cloud::Translate::V3::Dataset. - # p result - # - def get_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetDatasetRequest - - # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :get_dataset, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists datasets. - # - # @overload list_datasets(request, options = nil) - # Pass arguments to `list_datasets` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datasets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_datasets` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @param page_size [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @param page_token [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListDatasets call. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListDatasetsRequest.new - # - # # Call the list_datasets method. - # result = client.list_datasets 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::Translate::V3::Dataset. - # p item - # end - # - def list_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListDatasetsRequest - - # Converts hash 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_datasets.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::Translate::V3::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_datasets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_datasets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_datasets, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a dataset and all of its contents. - # - # @overload delete_dataset(request, options = nil) - # Pass arguments to `delete_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `delete_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 dataset to delete. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteDatasetRequest.new - # - # # Call the delete_dataset method. - # result = client.delete_dataset 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_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteDatasetRequest - - # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :delete_dataset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an Adaptive MT dataset. - # - # @overload create_adaptive_mt_dataset(request, options = nil) - # Pass arguments to `create_adaptive_mt_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(parent: nil, adaptive_mt_dataset: nil) - # Pass arguments to `create_adaptive_mt_dataset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @param adaptive_mt_dataset [::Google::Cloud::Translate::V3::AdaptiveMtDataset, ::Hash] - # Required. The AdaptiveMtDataset to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new - # - # # Call the create_adaptive_mt_dataset method. - # result = client.create_adaptive_mt_dataset request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. - # p result - # - def create_adaptive_mt_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest - - # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_adaptive_mt_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :create_adaptive_mt_dataset, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an Adaptive MT dataset, including all its entries and associated - # metadata. - # - # @overload delete_adaptive_mt_dataset(request, options = nil) - # Pass arguments to `delete_adaptive_mt_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) - # Pass arguments to `delete_adaptive_mt_dataset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the dataset. In the form of - # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new - # - # # Call the delete_adaptive_mt_dataset method. - # result = client.delete_adaptive_mt_dataset request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_adaptive_mt_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest - - # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_adaptive_mt_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :delete_adaptive_mt_dataset, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the Adaptive MT dataset. - # - # @overload get_adaptive_mt_dataset(request, options = nil) - # Pass arguments to `get_adaptive_mt_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) - # Pass arguments to `get_adaptive_mt_dataset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the dataset. In the form of - # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new - # - # # Call the get_adaptive_mt_dataset method. - # result = client.get_adaptive_mt_dataset request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. - # p result - # - def get_adaptive_mt_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest - - # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_adaptive_mt_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :get_adaptive_mt_dataset, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Adaptive MT datasets for which the caller has read permission. - # - # @overload list_adaptive_mt_datasets(request, options = nil) - # Pass arguments to `list_adaptive_mt_datasets` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_datasets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_adaptive_mt_datasets` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list the Adaptive - # MT datasets. `projects/{project-number-or-id}/locations/{location-id}` - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer results than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtDatasetsResponse.next_page_token returned from the - # previous call to `ListAdaptiveMtDatasets` method. The first page is - # returned if `page_token`is empty or missing. - # @param filter [::String] - # Optional. An expression for filtering the results of the request. - # Filter is not supported yet. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.new - # - # # Call the list_adaptive_mt_datasets method. - # result = client.list_adaptive_mt_datasets 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::Translate::V3::AdaptiveMtDataset. - # p item - # end - # - def list_adaptive_mt_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest - - # Converts hash 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_adaptive_mt_datasets.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::Translate::V3::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_adaptive_mt_datasets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_adaptive_mt_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_adaptive_mt_datasets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_datasets, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translate text using Adaptive MT. - # - # @overload adaptive_mt_translate(request, options = nil) - # Pass arguments to `adaptive_mt_translate` via a request object, either of type - # {::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload adaptive_mt_translate(parent: nil, dataset: nil, content: nil, reference_sentence_config: nil, glossary_config: nil) - # Pass arguments to `adaptive_mt_translate` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # @param dataset [::String] - # Required. The resource name for the dataset to use for adaptive MT. - # `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` - # @param content [::Array<::String>] - # Required. The content of the input in string format. - # @param reference_sentence_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig, ::Hash] - # Configuration for caller provided reference sentences. - # @param glossary_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig, ::Hash] - # Optional. Glossary to be applied. The glossary must be - # within the same region (have the same location-id) as the model, otherwise - # an INVALID_ARGUMENT (400) error is returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new - # - # # Call the adaptive_mt_translate method. - # result = client.adaptive_mt_translate request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse. - # p result - # - def adaptive_mt_translate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest - - # Converts hash 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.adaptive_mt_translate.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::Translate::V3::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.adaptive_mt_translate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.adaptive_mt_translate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :adaptive_mt_translate, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets and AdaptiveMtFile - # - # @overload get_adaptive_mt_file(request, options = nil) - # Pass arguments to `get_adaptive_mt_file` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) - # Pass arguments to `get_adaptive_mt_file` via keyword arguments. Note that at - # least one keyword argument is 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 file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::AdaptiveMtFile] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new - # - # # Call the get_adaptive_mt_file method. - # result = client.get_adaptive_mt_file request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtFile. - # p result - # - def get_adaptive_mt_file request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest - - # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_adaptive_mt_file.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :get_adaptive_mt_file, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an AdaptiveMtFile along with its sentences. - # - # @overload delete_adaptive_mt_file(request, options = nil) - # Pass arguments to `delete_adaptive_mt_file` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) - # Pass arguments to `delete_adaptive_mt_file` via keyword arguments. Note that at - # least one keyword argument is 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 file to delete, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new - # - # # Call the delete_adaptive_mt_file method. - # result = client.delete_adaptive_mt_file request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_adaptive_mt_file request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest - - # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_adaptive_mt_file.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :delete_adaptive_mt_file, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports an AdaptiveMtFile and adds all of its sentences into the - # AdaptiveMtDataset. - # - # @overload import_adaptive_mt_file(request, options = nil) - # Pass arguments to `import_adaptive_mt_file` via a request object, either of type - # {::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_adaptive_mt_file(parent: nil, file_input_source: nil, gcs_input_source: nil) - # Pass arguments to `import_adaptive_mt_file` via keyword arguments. Note that at - # least one keyword argument is 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 file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}` - # @param file_input_source [::Google::Cloud::Translate::V3::FileInputSource, ::Hash] - # Inline file source. - # - # Note: The following parameters are mutually exclusive: `file_input_source`, `gcs_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] - # Google Cloud Storage file source. - # - # Note: The following parameters are mutually exclusive: `gcs_input_source`, `file_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new - # - # # Call the import_adaptive_mt_file method. - # result = client.import_adaptive_mt_file request - # - # # The returned object is of type Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse. - # p result - # - def import_adaptive_mt_file request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest - - # Converts hash 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.import_adaptive_mt_file.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::Translate::V3::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.import_adaptive_mt_file.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_adaptive_mt_file.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :import_adaptive_mt_file, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset. - # - # @overload list_adaptive_mt_files(request, options = nil) - # Pass arguments to `list_adaptive_mt_files` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_files(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_adaptive_mt_files` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list the Adaptive - # MT files. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` - # @param page_size [::Integer] - # Optional. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtFilesResponse.next_page_token returned from the - # previous call to `ListAdaptiveMtFiles` method. The first page is - # returned if `page_token`is empty or missing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.new - # - # # Call the list_adaptive_mt_files method. - # result = client.list_adaptive_mt_files 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::Translate::V3::AdaptiveMtFile. - # p item - # end - # - def list_adaptive_mt_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest - - # Converts hash 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_adaptive_mt_files.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::Translate::V3::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_adaptive_mt_files.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_adaptive_mt_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_adaptive_mt_files, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all AdaptiveMtSentences under a given file/dataset. - # - # @overload list_adaptive_mt_sentences(request, options = nil) - # Pass arguments to `list_adaptive_mt_sentences` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_sentences(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_adaptive_mt_sentences` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list the Adaptive - # MT files. The following format lists all sentences under a file. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # The following format lists all sentences within a dataset. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` - # @param page_size [::Integer] - # @param page_token [::String] - # A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtSentencesRequest.next_page_token returned from the - # previous call to `ListTranslationMemories` method. The first page is - # returned if `page_token` is empty or missing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.new - # - # # Call the list_adaptive_mt_sentences method. - # result = client.list_adaptive_mt_sentences 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::Translate::V3::AdaptiveMtSentence. - # p item - # end - # - def list_adaptive_mt_sentences request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest - - # Converts hash 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_adaptive_mt_sentences.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::Translate::V3::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_adaptive_mt_sentences.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_adaptive_mt_sentences.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_adaptive_mt_sentences, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_sentences, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Import sentence pairs into translation Dataset. - # - # @overload import_data(request, options = nil) - # Pass arguments to `import_data` via a request object, either of type - # {::Google::Cloud::Translate::V3::ImportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ImportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_data(dataset: nil, input_config: nil) - # Pass arguments to `import_data` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. Name of the dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @param input_config [::Google::Cloud::Translate::V3::DatasetInputConfig, ::Hash] - # Required. The config for the input content. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ImportDataRequest.new - # - # # Call the import_data method. - # result = client.import_data 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 import_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportDataRequest - - # Converts hash 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.import_data.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::Translate::V3::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.dataset - header_params["dataset"] = request.dataset - 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.import_data.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :import_data, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports dataset's data to the provided output location. - # - # @overload export_data(request, options = nil) - # Pass arguments to `export_data` via a request object, either of type - # {::Google::Cloud::Translate::V3::ExportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ExportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_data(dataset: nil, output_config: nil) - # Pass arguments to `export_data` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. Name of the dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @param output_config [::Google::Cloud::Translate::V3::DatasetOutputConfig, ::Hash] - # Required. The config for the output content. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ExportDataRequest.new - # - # # Call the export_data method. - # result = client.export_data 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 export_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ExportDataRequest - - # Converts hash 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.export_data.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::Translate::V3::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.dataset - header_params["dataset"] = request.dataset - 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.export_data.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :export_data, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists sentence pairs in the dataset. - # - # @overload list_examples(request, options = nil) - # Pass arguments to `list_examples` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListExamplesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListExamplesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_examples(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_examples` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @param filter [::String] - # Optional. An expression for filtering the examples that will be returned. - # Example filter: - # * `usage=TRAIN` - # @param page_size [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @param page_token [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListExamples call. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListExamplesRequest.new - # - # # Call the list_examples method. - # result = client.list_examples 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::Translate::V3::Example. - # p item - # end - # - def list_examples request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListExamplesRequest - - # Converts hash 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_examples.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::Translate::V3::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_examples.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_examples.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_examples, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_examples, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Model. - # - # @overload create_model(request, options = nil) - # Pass arguments to `create_model` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil) - # Pass arguments to `create_model` via keyword arguments. Note that at - # least one keyword argument is 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 project name, in form of - # `projects/{project}/locations/{location}` - # @param model [::Google::Cloud::Translate::V3::Model, ::Hash] - # Required. The Model to create. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateModelRequest.new - # - # # Call the create_model method. - # result = client.create_model 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_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateModelRequest - - # Converts hash 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_model.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::Translate::V3::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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :create_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists models. - # - # @overload list_models(request, options = nil) - # Pass arguments to `list_models` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_models(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_models` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @param filter [::String] - # Optional. An expression for filtering the models that will be returned. - # Supported filter: - # `dataset_id=${dataset_id}` - # @param page_size [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @param page_token [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListModels call. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListModelsRequest.new - # - # # Call the list_models method. - # result = client.list_models 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::Translate::V3::Model. - # p item - # end - # - def list_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListModelsRequest - - # Converts hash 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_models.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::Translate::V3::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_models.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :list_models, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @translation_service_stub, :list_models, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a model. - # - # @overload get_model(request, options = nil) - # Pass arguments to `get_model` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Translate::V3::Model] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Translate::V3::Model] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetModelRequest.new - # - # # Call the get_model method. - # result = client.get_model request - # - # # The returned object is of type Google::Cloud::Translate::V3::Model. - # p result - # - def get_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetModelRequest - - # Converts hash 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_model.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::Translate::V3::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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :get_model, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a model. - # - # @overload delete_model(request, options = nil) - # Pass arguments to `delete_model` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to delete. - # - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteModelRequest.new - # - # # Call the delete_model method. - # result = client.delete_model 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_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteModelRequest - - # Converts hash 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_model.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::Translate::V3::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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.call_rpc :delete_model, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TranslationService API. - # - # This class represents the configuration for TranslationService, - # 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::Translate::V3::TranslationService::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 - # # translate_text to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Translate::V3::TranslationService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.translate_text.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.translate_text.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TranslationService 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 `translate_text` - # @return [::Gapic::Config::Method] - # - attr_reader :translate_text - ## - # RPC-specific configuration for `romanize_text` - # @return [::Gapic::Config::Method] - # - attr_reader :romanize_text - ## - # RPC-specific configuration for `detect_language` - # @return [::Gapic::Config::Method] - # - attr_reader :detect_language - ## - # RPC-specific configuration for `get_supported_languages` - # @return [::Gapic::Config::Method] - # - attr_reader :get_supported_languages - ## - # RPC-specific configuration for `translate_document` - # @return [::Gapic::Config::Method] - # - attr_reader :translate_document - ## - # RPC-specific configuration for `batch_translate_text` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_translate_text - ## - # RPC-specific configuration for `batch_translate_document` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_translate_document - ## - # RPC-specific configuration for `create_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :create_glossary - ## - # RPC-specific configuration for `update_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :update_glossary - ## - # RPC-specific configuration for `list_glossaries` - # @return [::Gapic::Config::Method] - # - attr_reader :list_glossaries - ## - # RPC-specific configuration for `get_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :get_glossary - ## - # RPC-specific configuration for `delete_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_glossary - ## - # RPC-specific configuration for `get_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :get_glossary_entry - ## - # RPC-specific configuration for `list_glossary_entries` - # @return [::Gapic::Config::Method] - # - attr_reader :list_glossary_entries - ## - # RPC-specific configuration for `create_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :create_glossary_entry - ## - # RPC-specific configuration for `update_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :update_glossary_entry - ## - # RPC-specific configuration for `delete_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_glossary_entry - ## - # RPC-specific configuration for `create_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dataset - ## - # RPC-specific configuration for `get_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset - ## - # RPC-specific configuration for `list_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_datasets - ## - # RPC-specific configuration for `delete_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dataset - ## - # RPC-specific configuration for `create_adaptive_mt_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_adaptive_mt_dataset - ## - # RPC-specific configuration for `delete_adaptive_mt_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_adaptive_mt_dataset - ## - # RPC-specific configuration for `get_adaptive_mt_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_adaptive_mt_dataset - ## - # RPC-specific configuration for `list_adaptive_mt_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_adaptive_mt_datasets - ## - # RPC-specific configuration for `adaptive_mt_translate` - # @return [::Gapic::Config::Method] - # - attr_reader :adaptive_mt_translate - ## - # RPC-specific configuration for `get_adaptive_mt_file` - # @return [::Gapic::Config::Method] - # - attr_reader :get_adaptive_mt_file - ## - # RPC-specific configuration for `delete_adaptive_mt_file` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_adaptive_mt_file - ## - # RPC-specific configuration for `import_adaptive_mt_file` - # @return [::Gapic::Config::Method] - # - attr_reader :import_adaptive_mt_file - ## - # RPC-specific configuration for `list_adaptive_mt_files` - # @return [::Gapic::Config::Method] - # - attr_reader :list_adaptive_mt_files - ## - # RPC-specific configuration for `list_adaptive_mt_sentences` - # @return [::Gapic::Config::Method] - # - attr_reader :list_adaptive_mt_sentences - ## - # RPC-specific configuration for `import_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_data - ## - # RPC-specific configuration for `export_data` - # @return [::Gapic::Config::Method] - # - attr_reader :export_data - ## - # RPC-specific configuration for `list_examples` - # @return [::Gapic::Config::Method] - # - attr_reader :list_examples - ## - # RPC-specific configuration for `create_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_model - ## - # RPC-specific configuration for `list_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_models - ## - # RPC-specific configuration for `get_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model - ## - # RPC-specific configuration for `delete_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_model - - # @private - def initialize parent_rpcs = nil - translate_text_config = parent_rpcs.translate_text if parent_rpcs.respond_to? :translate_text - @translate_text = ::Gapic::Config::Method.new translate_text_config - romanize_text_config = parent_rpcs.romanize_text if parent_rpcs.respond_to? :romanize_text - @romanize_text = ::Gapic::Config::Method.new romanize_text_config - detect_language_config = parent_rpcs.detect_language if parent_rpcs.respond_to? :detect_language - @detect_language = ::Gapic::Config::Method.new detect_language_config - get_supported_languages_config = parent_rpcs.get_supported_languages if parent_rpcs.respond_to? :get_supported_languages - @get_supported_languages = ::Gapic::Config::Method.new get_supported_languages_config - translate_document_config = parent_rpcs.translate_document if parent_rpcs.respond_to? :translate_document - @translate_document = ::Gapic::Config::Method.new translate_document_config - batch_translate_text_config = parent_rpcs.batch_translate_text if parent_rpcs.respond_to? :batch_translate_text - @batch_translate_text = ::Gapic::Config::Method.new batch_translate_text_config - batch_translate_document_config = parent_rpcs.batch_translate_document if parent_rpcs.respond_to? :batch_translate_document - @batch_translate_document = ::Gapic::Config::Method.new batch_translate_document_config - create_glossary_config = parent_rpcs.create_glossary if parent_rpcs.respond_to? :create_glossary - @create_glossary = ::Gapic::Config::Method.new create_glossary_config - update_glossary_config = parent_rpcs.update_glossary if parent_rpcs.respond_to? :update_glossary - @update_glossary = ::Gapic::Config::Method.new update_glossary_config - list_glossaries_config = parent_rpcs.list_glossaries if parent_rpcs.respond_to? :list_glossaries - @list_glossaries = ::Gapic::Config::Method.new list_glossaries_config - get_glossary_config = parent_rpcs.get_glossary if parent_rpcs.respond_to? :get_glossary - @get_glossary = ::Gapic::Config::Method.new get_glossary_config - delete_glossary_config = parent_rpcs.delete_glossary if parent_rpcs.respond_to? :delete_glossary - @delete_glossary = ::Gapic::Config::Method.new delete_glossary_config - get_glossary_entry_config = parent_rpcs.get_glossary_entry if parent_rpcs.respond_to? :get_glossary_entry - @get_glossary_entry = ::Gapic::Config::Method.new get_glossary_entry_config - list_glossary_entries_config = parent_rpcs.list_glossary_entries if parent_rpcs.respond_to? :list_glossary_entries - @list_glossary_entries = ::Gapic::Config::Method.new list_glossary_entries_config - create_glossary_entry_config = parent_rpcs.create_glossary_entry if parent_rpcs.respond_to? :create_glossary_entry - @create_glossary_entry = ::Gapic::Config::Method.new create_glossary_entry_config - update_glossary_entry_config = parent_rpcs.update_glossary_entry if parent_rpcs.respond_to? :update_glossary_entry - @update_glossary_entry = ::Gapic::Config::Method.new update_glossary_entry_config - delete_glossary_entry_config = parent_rpcs.delete_glossary_entry if parent_rpcs.respond_to? :delete_glossary_entry - @delete_glossary_entry = ::Gapic::Config::Method.new delete_glossary_entry_config - create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset - @create_dataset = ::Gapic::Config::Method.new create_dataset_config - get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset - @get_dataset = ::Gapic::Config::Method.new get_dataset_config - list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets - @list_datasets = ::Gapic::Config::Method.new list_datasets_config - delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset - @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config - create_adaptive_mt_dataset_config = parent_rpcs.create_adaptive_mt_dataset if parent_rpcs.respond_to? :create_adaptive_mt_dataset - @create_adaptive_mt_dataset = ::Gapic::Config::Method.new create_adaptive_mt_dataset_config - delete_adaptive_mt_dataset_config = parent_rpcs.delete_adaptive_mt_dataset if parent_rpcs.respond_to? :delete_adaptive_mt_dataset - @delete_adaptive_mt_dataset = ::Gapic::Config::Method.new delete_adaptive_mt_dataset_config - get_adaptive_mt_dataset_config = parent_rpcs.get_adaptive_mt_dataset if parent_rpcs.respond_to? :get_adaptive_mt_dataset - @get_adaptive_mt_dataset = ::Gapic::Config::Method.new get_adaptive_mt_dataset_config - list_adaptive_mt_datasets_config = parent_rpcs.list_adaptive_mt_datasets if parent_rpcs.respond_to? :list_adaptive_mt_datasets - @list_adaptive_mt_datasets = ::Gapic::Config::Method.new list_adaptive_mt_datasets_config - adaptive_mt_translate_config = parent_rpcs.adaptive_mt_translate if parent_rpcs.respond_to? :adaptive_mt_translate - @adaptive_mt_translate = ::Gapic::Config::Method.new adaptive_mt_translate_config - get_adaptive_mt_file_config = parent_rpcs.get_adaptive_mt_file if parent_rpcs.respond_to? :get_adaptive_mt_file - @get_adaptive_mt_file = ::Gapic::Config::Method.new get_adaptive_mt_file_config - delete_adaptive_mt_file_config = parent_rpcs.delete_adaptive_mt_file if parent_rpcs.respond_to? :delete_adaptive_mt_file - @delete_adaptive_mt_file = ::Gapic::Config::Method.new delete_adaptive_mt_file_config - import_adaptive_mt_file_config = parent_rpcs.import_adaptive_mt_file if parent_rpcs.respond_to? :import_adaptive_mt_file - @import_adaptive_mt_file = ::Gapic::Config::Method.new import_adaptive_mt_file_config - list_adaptive_mt_files_config = parent_rpcs.list_adaptive_mt_files if parent_rpcs.respond_to? :list_adaptive_mt_files - @list_adaptive_mt_files = ::Gapic::Config::Method.new list_adaptive_mt_files_config - list_adaptive_mt_sentences_config = parent_rpcs.list_adaptive_mt_sentences if parent_rpcs.respond_to? :list_adaptive_mt_sentences - @list_adaptive_mt_sentences = ::Gapic::Config::Method.new list_adaptive_mt_sentences_config - import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data - @import_data = ::Gapic::Config::Method.new import_data_config - export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data - @export_data = ::Gapic::Config::Method.new export_data_config - list_examples_config = parent_rpcs.list_examples if parent_rpcs.respond_to? :list_examples - @list_examples = ::Gapic::Config::Method.new list_examples_config - create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model - @create_model = ::Gapic::Config::Method.new create_model_config - list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models - @list_models = ::Gapic::Config::Method.new list_models_config - get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model - @get_model = ::Gapic::Config::Method.new get_model_config - delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model - @delete_model = ::Gapic::Config::Method.new delete_model_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb deleted file mode 100644 index 8cca11bc3a91..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/credentials.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - module TranslationService - # Credentials for the TranslationService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-translation" - ] - self.env_vars = [ - "TRANSLATE_CREDENTIALS", - "TRANSLATE_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "TRANSLATE_CREDENTIALS_JSON", - "TRANSLATE_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-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb deleted file mode 100644 index 6bd74364f287..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/operations.rb +++ /dev/null @@ -1,849 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - module TranslationService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TranslationService 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 TranslationService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::Translate::V3::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? - throw :response, 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::Translate::V3::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? - throw :response, 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::Translate::V3::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? - 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::Translate::V3::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? - 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::Translate::V3::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.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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb deleted file mode 100644 index 1f51c2c96070..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/paths.rb +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - module TranslationService - # Path helper methods for the TranslationService API. - module Paths - ## - # Create a fully-qualified AdaptiveMtDataset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` - # - # @param project [String] - # @param location [String] - # @param dataset [String] - # - # @return [::String] - def adaptive_mt_dataset_path project:, location:, dataset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/adaptiveMtDatasets/#{dataset}" - end - - ## - # Create a fully-qualified AdaptiveMtFile resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # - # @param project [String] - # @param location [String] - # @param dataset [String] - # @param file [String] - # - # @return [::String] - def adaptive_mt_file_path project:, location:, dataset:, file: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/" - - "projects/#{project}/locations/#{location}/adaptiveMtDatasets/#{dataset}/adaptiveMtFiles/#{file}" - end - - ## - # Create a fully-qualified Dataset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/datasets/{dataset}` - # - # @param project [String] - # @param location [String] - # @param dataset [String] - # - # @return [::String] - def dataset_path project:, location:, dataset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/datasets/#{dataset}" - end - - ## - # Create a fully-qualified Glossary resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/glossaries/{glossary}` - # - # @param project [String] - # @param location [String] - # @param glossary [String] - # - # @return [::String] - def glossary_path project:, location:, glossary: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/glossaries/#{glossary}" - end - - ## - # Create a fully-qualified GlossaryEntry resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/glossaries/{glossary}/glossaryEntries/{glossary_entry}` - # - # @param project [String] - # @param location [String] - # @param glossary [String] - # @param glossary_entry [String] - # - # @return [::String] - def glossary_entry_path project:, location:, glossary:, glossary_entry: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "glossary cannot contain /" if glossary.to_s.include? "/" - - "projects/#{project}/locations/#{location}/glossaries/#{glossary}/glossaryEntries/#{glossary_entry}" - 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 Model resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/models/{model}` - # - # @param project [String] - # @param location [String] - # @param model [String] - # - # @return [::String] - def model_path project:, location:, model: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/models/#{model}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb deleted file mode 100644 index 7aa1906ff964..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/version" -require "google/cloud/translate/v3/bindings_override" - -require "google/cloud/translate/v3/translation_service/credentials" -require "google/cloud/translate/v3/translation_service/paths" -require "google/cloud/translate/v3/translation_service/rest/operations" -require "google/cloud/translate/v3/translation_service/rest/client" - -module Google - module Cloud - module Translate - module V3 - ## - # Provides natural language translation operations. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/translate/v3/translation_service/rest" - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - module TranslationService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/translate/v3/translation_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb deleted file mode 100644 index bd67b608db1b..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/client.rb +++ /dev/null @@ -1,4313 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" -require "google/cloud/translate/v3/translation_service/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Translate - module V3 - module TranslationService - module Rest - ## - # REST client for the TranslationService service. - # - # Provides natural language translation operations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :translation_service_stub - - ## - # Configure the TranslationService Client class. - # - # See {::Google::Cloud::Translate::V3::TranslationService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all TranslationService clients - # ::Google::Cloud::Translate::V3::TranslationService::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", "Translate", "V3"] - 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.translate_text.timeout = 600.0 - - default_config.rpcs.detect_language.timeout = 600.0 - - default_config.rpcs.get_supported_languages.timeout = 600.0 - default_config.rpcs.get_supported_languages.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.translate_document.timeout = 600.0 - - default_config.rpcs.batch_translate_text.timeout = 600.0 - - default_config.rpcs.batch_translate_document.timeout = 600.0 - - default_config.rpcs.create_glossary.timeout = 600.0 - - default_config.rpcs.list_glossaries.timeout = 600.0 - default_config.rpcs.list_glossaries.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_glossary.timeout = 600.0 - default_config.rpcs.get_glossary.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_glossary.timeout = 600.0 - default_config.rpcs.delete_glossary.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the TranslationService 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::Translate::V3::TranslationService::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 - @translation_service_stub.universe_domain - end - - ## - # Create a new TranslationService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the TranslationService 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::Translate::V3::TranslationService::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 - - @translation_service_stub = ::Google::Cloud::Translate::V3::TranslationService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @translation_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @translation_service_stub.endpoint - config.universe_domain = @translation_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @translation_service_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @translation_service_stub.endpoint - config.universe_domain = @translation_service_stub.universe_domain - config.logger = @translation_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Translate::V3::TranslationService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @translation_service_stub.logger - end - - # Service calls - - ## - # Translates input text and returns translated text. - # - # @overload translate_text(request, options = nil) - # Pass arguments to `translate_text` via a request object, either of type - # {::Google::Cloud::Translate::V3::TranslateTextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::TranslateTextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload translate_text(contents: nil, mime_type: nil, source_language_code: nil, target_language_code: nil, parent: nil, model: nil, glossary_config: nil, transliteration_config: nil, labels: nil) - # Pass arguments to `translate_text` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param contents [::Array<::String>] - # Required. The content of the input in string format. - # We recommend the total content be less than 30,000 codepoints. The max - # length of this field is 1024. Use BatchTranslateText for larger text. - # @param mime_type [::String] - # Optional. The format of the source text, for example, "text/html", - # "text/plain". If left blank, the MIME type defaults to "text/html". - # @param source_language_code [::String] - # Optional. The ISO-639 language code of the input text if - # known, for example, "en-US" or "sr-Latn". Supported language codes are - # listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). If the source - # language isn't specified, the API attempts to identify the source language - # automatically and returns the source language within the response. - # @param target_language_code [::String] - # Required. The ISO-639 language code to use for translation of the input - # text, set to one of the language codes listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param parent [::String] - # Required. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}` or - # `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for requests using AutoML models or - # custom glossaries. - # - # Models and glossaries must be within the same region (have same - # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - # @param model [::String] - # Optional. The `model` type requested for this translation. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - Translation LLM models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, - # - # For global (non-regionalized) requests, use `location-id` `global`. - # For example, - # `projects/{project-number-or-id}/locations/global/models/general/nmt`. - # - # If not provided, the default Google model (NMT) will be used - # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] - # Optional. Glossary to be applied. The glossary must be - # within the same region (have the same location-id) as the model, otherwise - # an INVALID_ARGUMENT (400) error is returned. - # @param transliteration_config [::Google::Cloud::Translate::V3::TransliterationConfig, ::Hash] - # Optional. Transliteration to be applied. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::TranslateTextResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::TranslateTextResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::TranslateTextRequest.new - # - # # Call the translate_text method. - # result = client.translate_text request - # - # # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. - # p result - # - def translate_text request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateTextRequest - - # Converts hash 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.translate_text.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::Translate::V3::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.translate_text.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.translate_text.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.translate_text request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Romanize input text written in non-Latin scripts to Latin text. - # - # @overload romanize_text(request, options = nil) - # Pass arguments to `romanize_text` via a request object, either of type - # {::Google::Cloud::Translate::V3::RomanizeTextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::RomanizeTextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload romanize_text(parent: nil, contents: nil, source_language_code: nil) - # Pass arguments to `romanize_text` via keyword arguments. Note that at - # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}` or - # `projects/{project-number-or-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # @param contents [::Array<::String>] - # Required. The content of the input in string format. - # @param source_language_code [::String] - # Optional. The ISO-639 language code of the input text if - # known, for example, "hi" or "zh". Supported language codes are - # listed in [Language - # Support](https://cloud.google.com/translate/docs/languages#roman). If the - # source language isn't specified, the API attempts to identify the source - # language automatically and returns the source language for each content in - # the response. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::RomanizeTextResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::RomanizeTextResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::RomanizeTextRequest.new - # - # # Call the romanize_text method. - # result = client.romanize_text request - # - # # The returned object is of type Google::Cloud::Translate::V3::RomanizeTextResponse. - # p result - # - def romanize_text request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::RomanizeTextRequest - - # Converts hash 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.romanize_text.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::Translate::V3::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.romanize_text.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.romanize_text.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.romanize_text request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Detects the language of text within a request. - # - # @overload detect_language(request, options = nil) - # Pass arguments to `detect_language` via a request object, either of type - # {::Google::Cloud::Translate::V3::DetectLanguageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DetectLanguageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload detect_language(parent: nil, model: nil, content: nil, mime_type: nil, labels: nil) - # Pass arguments to `detect_language` via keyword arguments. Note that at - # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}` or - # `projects/{project-number-or-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Only models within the same region (has same location-id) can be used. - # Otherwise an INVALID_ARGUMENT (400) error is returned. - # @param model [::String] - # Optional. The language detection model to be used. - # - # Format: - # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` - # - # Only one language detection model is currently supported: - # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. - # - # If not specified, the default model is used. - # @param content [::String] - # The content of the input stored as a string. - # @param mime_type [::String] - # Optional. The format of the source text, for example, "text/html", - # "text/plain". If left blank, the MIME type defaults to "text/html". - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::DetectLanguageResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::DetectLanguageResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DetectLanguageRequest.new - # - # # Call the detect_language method. - # result = client.detect_language request - # - # # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. - # p result - # - def detect_language request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DetectLanguageRequest - - # Converts hash 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.detect_language.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::Translate::V3::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.detect_language.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.detect_language.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.detect_language request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of supported languages for translation. - # - # @overload get_supported_languages(request, options = nil) - # Pass arguments to `get_supported_languages` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_supported_languages(parent: nil, display_language_code: nil, model: nil) - # Pass arguments to `get_supported_languages` via keyword arguments. Note that at - # least one keyword argument is 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. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}` or - # `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for AutoML models. - # - # Only models within the same region (have same location-id) can be used, - # otherwise an INVALID_ARGUMENT (400) error is returned. - # @param display_language_code [::String] - # Optional. The language to use to return localized, human readable names - # of supported languages. If missing, then display names are not returned - # in a response. - # @param model [::String] - # Optional. Get supported languages of this model. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # Returns languages supported by the specified model. - # If missing, we get supported languages of Google general NMT model. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::SupportedLanguages] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::SupportedLanguages] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new - # - # # Call the get_supported_languages method. - # result = client.get_supported_languages request - # - # # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. - # p result - # - def get_supported_languages request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest - - # Converts hash 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_supported_languages.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::Translate::V3::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_supported_languages.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_supported_languages.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.get_supported_languages request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translates documents in synchronous mode. - # - # @overload translate_document(request, options = nil) - # Pass arguments to `translate_document` via a request object, either of type - # {::Google::Cloud::Translate::V3::TranslateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::TranslateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload translate_document(parent: nil, source_language_code: nil, target_language_code: nil, document_input_config: nil, document_output_config: nil, model: nil, glossary_config: nil, labels: nil, customized_attribution: nil, is_translate_native_pdf_only: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) - # Pass arguments to `translate_document` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for requests using AutoML models or custom - # glossaries. - # - # Models and glossaries must be within the same region (have the same - # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - # @param source_language_code [::String] - # Optional. The ISO-639 language code of the input document if known, for - # example, "en-US" or "sr-Latn". Supported language codes are listed in - # [Language Support](https://cloud.google.com/translate/docs/languages). If - # the source language isn't specified, the API attempts to identify the - # source language automatically and returns the source language within the - # response. Source language must be specified if the request contains a - # glossary or a custom model. - # @param target_language_code [::String] - # Required. The ISO-639 language code to use for translation of the input - # document, set to one of the language codes listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param document_input_config [::Google::Cloud::Translate::V3::DocumentInputConfig, ::Hash] - # Required. Input configurations. - # @param document_output_config [::Google::Cloud::Translate::V3::DocumentOutputConfig, ::Hash] - # Optional. Output configurations. - # Defines if the output file should be stored within Cloud Storage as well - # as the desired output format. If not provided the translated file will - # only be returned through a byte-stream and its output mime type will be - # the same as the input file's mime type. - # @param model [::String] - # Optional. The `model` type requested for this translation. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If not provided, the default Google model (NMT) will be used for - # translation. - # @param glossary_config [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash] - # Optional. Glossary to be applied. The glossary must be within the same - # region (have the same location-id) as the model, otherwise an - # INVALID_ARGUMENT (400) error is returned. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters (Unicode - # codepoints), can only contain lowercase letters, numeric characters, - # underscores and dashes. International characters are allowed. Label values - # are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # @param customized_attribution [::String] - # Optional. This flag is to support user customized attribution. - # If not provided, the default is `Machine Translated by Google`. - # Customized attribution should follow rules in - # https://cloud.google.com/translate/attribution#attribution_and_logos - # @param is_translate_native_pdf_only [::Boolean] - # Optional. is_translate_native_pdf_only field for external customers. - # If true, the page limit of online native pdf translation is 300 and only - # native pdf pages will be translated. - # @param enable_shadow_removal_native_pdf [::Boolean] - # Optional. If true, use the text removal server to remove the shadow text on - # background image for native pdf translation. - # Shadow removal feature can only be enabled when - # is_translate_native_pdf_only: false && pdf_native_only: false - # @param enable_rotation_correction [::Boolean] - # Optional. If true, enable auto rotation correction in DVS. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::TranslateDocumentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::TranslateDocumentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new - # - # # Call the translate_document method. - # result = client.translate_document request - # - # # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. - # p result - # - def translate_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::TranslateDocumentRequest - - # Converts hash 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.translate_document.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::Translate::V3::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.translate_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.translate_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.translate_document request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translates a large volume of text in asynchronous batch mode. - # This function provides real-time output as the inputs are being processed. - # If caller cancels a request, the partial results (for an input file, it's - # all or nothing) may still be available on the specified output location. - # - # This call returns immediately and you can - # use google.longrunning.Operation.name to poll the status of the call. - # - # @overload batch_translate_text(request, options = nil) - # Pass arguments to `batch_translate_text` via a request object, either of type - # {::Google::Cloud::Translate::V3::BatchTranslateTextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::BatchTranslateTextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_translate_text(parent: nil, source_language_code: nil, target_language_codes: nil, models: nil, input_configs: nil, output_config: nil, glossaries: nil, labels: nil) - # Pass arguments to `batch_translate_text` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a call. Must refer to a caller's project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # The `global` location is not supported for batch translation. - # - # Only AutoML Translation models or glossaries within the same region (have - # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - # error is returned. - # @param source_language_code [::String] - # Required. Source language code. Supported language codes are listed in - # [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param target_language_codes [::Array<::String>] - # Required. Specify up to 10 language codes here. Supported language codes - # are listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param models [::Hash{::String => ::String}] - # Optional. The models to use for translation. Map's key is target language - # code. Map's value is model name. Value can be a built-in general model, - # or an AutoML Translation model. - # - # The value format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If the map is empty or a specific model is - # not requested for a language pair, then default google model (nmt) is used. - # @param input_configs [::Array<::Google::Cloud::Translate::V3::InputConfig, ::Hash>] - # Required. Input configurations. - # The total number of files matched should be <= 100. - # The total content size should be <= 100M Unicode codepoints. - # The files must use UTF-8 encoding. - # @param output_config [::Google::Cloud::Translate::V3::OutputConfig, ::Hash] - # Required. Output configuration. - # If 2 input configs match to the same file (that is, same input path), - # we don't generate output for duplicate inputs. - # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] - # Optional. Glossaries to be applied for translation. - # It's keyed by target language code. - # @param labels [::Hash{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new - # - # # Call the batch_translate_text method. - # result = client.batch_translate_text 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 batch_translate_text request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateTextRequest - - # Converts hash 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.batch_translate_text.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::Translate::V3::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.batch_translate_text.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_translate_text.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.batch_translate_text request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translates a large volume of document in asynchronous batch mode. - # This function provides real-time output as the inputs are being processed. - # If caller cancels a request, the partial results (for an input file, it's - # all or nothing) may still be available on the specified output location. - # - # This call returns immediately and you can use - # google.longrunning.Operation.name to poll the status of the call. - # - # @overload batch_translate_document(request, options = nil) - # Pass arguments to `batch_translate_document` via a request object, either of type - # {::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_translate_document(parent: nil, source_language_code: nil, target_language_codes: nil, input_configs: nil, output_config: nil, models: nil, glossaries: nil, format_conversions: nil, customized_attribution: nil, enable_shadow_removal_native_pdf: nil, enable_rotation_correction: nil) - # Pass arguments to `batch_translate_document` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # The `global` location is not supported for batch translation. - # - # Only AutoML Translation models or glossaries within the same region (have - # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - # error is returned. - # @param source_language_code [::String] - # Required. The ISO-639 language code of the input document if known, for - # example, "en-US" or "sr-Latn". Supported language codes are listed in - # [Language Support](https://cloud.google.com/translate/docs/languages). - # @param target_language_codes [::Array<::String>] - # Required. The ISO-639 language code to use for translation of the input - # document. Specify up to 10 language codes here. Supported language codes - # are listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @param input_configs [::Array<::Google::Cloud::Translate::V3::BatchDocumentInputConfig, ::Hash>] - # Required. Input configurations. - # The total number of files matched should be <= 100. - # The total content size to translate should be <= 100M Unicode codepoints. - # The files must use UTF-8 encoding. - # @param output_config [::Google::Cloud::Translate::V3::BatchDocumentOutputConfig, ::Hash] - # Required. Output configuration. - # If 2 input configs match to the same file (that is, same input path), - # we don't generate output for duplicate inputs. - # @param models [::Hash{::String => ::String}] - # Optional. The models to use for translation. Map's key is target language - # code. Map's value is the model name. Value can be a built-in general model, - # or an AutoML Translation model. - # - # The value format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If the map is empty or a specific model is - # not requested for a language pair, then default google model (nmt) is used. - # @param glossaries [::Hash{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig, ::Hash}] - # Optional. Glossaries to be applied. It's keyed by target language code. - # @param format_conversions [::Hash{::String => ::String}] - # Optional. The file format conversion map that is applied to all input - # files. The map key is the original mime_type. The map value is the target - # mime_type of translated documents. - # - # Supported file format conversion includes: - # - `application/pdf` to - # `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - # - # If nothing specified, output files will be in the same format as the - # original file. - # @param customized_attribution [::String] - # Optional. This flag is to support user customized attribution. - # If not provided, the default is `Machine Translated by Google`. - # Customized attribution should follow rules in - # https://cloud.google.com/translate/attribution#attribution_and_logos - # @param enable_shadow_removal_native_pdf [::Boolean] - # Optional. If true, use the text removal server to remove the shadow text on - # background image for native pdf translation. - # Shadow removal feature can only be enabled when - # is_translate_native_pdf_only: false && pdf_native_only: false - # @param enable_rotation_correction [::Boolean] - # Optional. If true, enable auto rotation correction in DVS. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new - # - # # Call the batch_translate_document method. - # result = client.batch_translate_document 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 batch_translate_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest - - # Converts hash 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.batch_translate_document.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::Translate::V3::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.batch_translate_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_translate_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.batch_translate_document request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a glossary and returns the long-running operation. Returns - # NOT_FOUND, if the project doesn't exist. - # - # @overload create_glossary(request, options = nil) - # Pass arguments to `create_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(parent: nil, glossary: nil) - # Pass arguments to `create_glossary` via keyword arguments. Note that at - # least one keyword argument is 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 project name. - # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] - # Required. The glossary to create. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new - # - # # Call the create_glossary method. - # result = client.create_glossary 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_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.create_glossary request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a glossary. A LRO is used since the update can be async if the - # glossary's entry file is updated. - # - # @overload update_glossary(request, options = nil) - # Pass arguments to `update_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::UpdateGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(glossary: nil, update_mask: nil) - # Pass arguments to `update_glossary` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param glossary [::Google::Cloud::Translate::V3::Glossary, ::Hash] - # Required. The glossary entry to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. Currently only `display_name` and - # 'input_config' - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::UpdateGlossaryRequest.new - # - # # Call the update_glossary method. - # result = client.update_glossary 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_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.update_glossary request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - # exist. - # - # @overload list_glossaries(request, options = nil) - # Pass arguments to `list_glossaries` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListGlossariesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListGlossariesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossaries(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_glossaries` via keyword arguments. Note that at - # least one keyword argument is 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 name of the project from which to list all of the glossaries. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer glossaries than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of [ListGlossariesResponse.next_page_token] - # returned from the previous call to `ListGlossaries` method. - # The first page is returned if `page_token`is empty or missing. - # @param filter [::String] - # Optional. Filter specifying constraints of a list operation. - # Specify the constraint by the format of "key=value", where key must be - # "src" or "tgt", and the value must be a valid language code. - # For multiple restrictions, concatenate them by "AND" (uppercase only), - # such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used - # here, which means using 'en-US' and 'en' can lead to different results, - # which depends on the language code you used when you create the glossary. - # For the unidirectional glossaries, the "src" and "tgt" add restrictions - # on the source and target language code separately. - # For the equivalent term set glossaries, the "src" and/or "tgt" add - # restrictions on the term set. - # For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional - # glossaries which exactly match the source language code as "en-US" and the - # target language code "zh-CN", but all equivalent term set glossaries which - # contain "en-US" and "zh-CN" in their language set will be picked. - # If missing, no filtering is performed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Glossary>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListGlossariesRequest.new - # - # # Call the list_glossaries method. - # result = client.list_glossaries 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::Translate::V3::Glossary. - # p item - # end - # - def list_glossaries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossariesRequest - - # Converts hash 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_glossaries.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::Translate::V3::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_glossaries.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_glossaries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_glossaries request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_glossaries, "glossaries", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - # exist. - # - # @overload get_glossary(request, options = nil) - # Pass arguments to `get_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(name: nil) - # Pass arguments to `get_glossary` via keyword arguments. Note that at - # least one keyword argument is 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 glossary to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::Glossary] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::Glossary] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetGlossaryRequest.new - # - # # Call the get_glossary method. - # result = client.get_glossary request - # - # # The returned object is of type Google::Cloud::Translate::V3::Glossary. - # p result - # - def get_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.get_glossary request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a glossary, or cancels glossary construction - # if the glossary isn't created yet. - # Returns NOT_FOUND, if the glossary doesn't exist. - # - # @overload delete_glossary(request, options = nil) - # Pass arguments to `delete_glossary` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteGlossaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary(name: nil) - # Pass arguments to `delete_glossary` via keyword arguments. Note that at - # least one keyword argument is 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 glossary to delete. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new - # - # # Call the delete_glossary method. - # result = client.delete_glossary 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_glossary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryRequest - - # Converts hash 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_glossary.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::Translate::V3::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_glossary.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_glossary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.delete_glossary request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a single glossary entry by the given id. - # - # @overload get_glossary_entry(request, options = nil) - # Pass arguments to `get_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) - # Pass arguments to `get_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is 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 glossary entry to get - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new - # - # # Call the get_glossary_entry method. - # result = client.get_glossary_entry request - # - # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - # p result - # - def get_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.get_glossary_entry request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List the entries for the glossary. - # - # @overload list_glossary_entries(request, options = nil) - # Pass arguments to `list_glossary_entries` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entries(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_glossary_entries` via keyword arguments. Note that at - # least one keyword argument is 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 glossary resource name for listing the glossary's - # entries. - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer glossary entries - # than requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # [ListGlossaryEntriesResponse.next_page_token] returned from the previous - # call. The first page is returned if `page_token`is empty or missing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::GlossaryEntry>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.new - # - # # Call the list_glossary_entries method. - # result = client.list_glossary_entries 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::Translate::V3::GlossaryEntry. - # p item - # end - # - def list_glossary_entries request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest - - # Converts hash 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_glossary_entries.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::Translate::V3::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_glossary_entries.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_glossary_entries.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_glossary_entries request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_glossary_entries, "glossary_entries", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a glossary entry. - # - # @overload create_glossary_entry(request, options = nil) - # Pass arguments to `create_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(parent: nil, glossary_entry: nil) - # Pass arguments to `create_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is 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 glossary to create the entry under. - # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] - # Required. The glossary entry to create - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new - # - # # Call the create_glossary_entry method. - # result = client.create_glossary_entry request - # - # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - # p result - # - def create_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.create_glossary_entry request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a glossary entry. - # - # @overload update_glossary_entry(request, options = nil) - # Pass arguments to `update_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(glossary_entry: nil) - # Pass arguments to `update_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param glossary_entry [::Google::Cloud::Translate::V3::GlossaryEntry, ::Hash] - # Required. The glossary entry to update. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::GlossaryEntry] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new - # - # # Call the update_glossary_entry method. - # result = client.update_glossary_entry request - # - # # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - # p result - # - def update_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.update_glossary_entry request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single entry from the glossary - # - # @overload delete_glossary_entry(request, options = nil) - # Pass arguments to `delete_glossary_entry` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_glossary_entry(name: nil) - # Pass arguments to `delete_glossary_entry` via keyword arguments. Note that at - # least one keyword argument is 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 glossary entry 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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new - # - # # Call the delete_glossary_entry method. - # result = client.delete_glossary_entry request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_glossary_entry request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest - - # Converts hash 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_glossary_entry.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::Translate::V3::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_glossary_entry.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_glossary_entry.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.delete_glossary_entry request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Dataset. - # - # @overload create_dataset(request, options = nil) - # Pass arguments to `create_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(parent: nil, dataset: nil) - # Pass arguments to `create_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 project name. - # @param dataset [::Google::Cloud::Translate::V3::Dataset, ::Hash] - # Required. The Dataset to create. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateDatasetRequest.new - # - # # Call the create_dataset method. - # result = client.create_dataset 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_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateDatasetRequest - - # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.create_dataset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a Dataset. - # - # @overload get_dataset(request, options = nil) - # Pass arguments to `get_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `get_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 dataset to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::Dataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::Dataset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetDatasetRequest.new - # - # # Call the get_dataset method. - # result = client.get_dataset request - # - # # The returned object is of type Google::Cloud::Translate::V3::Dataset. - # p result - # - def get_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetDatasetRequest - - # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.get_dataset request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists datasets. - # - # @overload list_datasets(request, options = nil) - # Pass arguments to `list_datasets` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datasets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_datasets` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @param page_size [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @param page_token [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListDatasets call. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Dataset>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListDatasetsRequest.new - # - # # Call the list_datasets method. - # result = client.list_datasets 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::Translate::V3::Dataset. - # p item - # end - # - def list_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListDatasetsRequest - - # Converts hash 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_datasets.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::Translate::V3::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_datasets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_datasets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_datasets, "datasets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a dataset and all of its contents. - # - # @overload delete_dataset(request, options = nil) - # Pass arguments to `delete_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `delete_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 dataset to delete. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteDatasetRequest.new - # - # # Call the delete_dataset method. - # result = client.delete_dataset 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_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteDatasetRequest - - # Converts hash 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_dataset.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::Translate::V3::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_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.delete_dataset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an Adaptive MT dataset. - # - # @overload create_adaptive_mt_dataset(request, options = nil) - # Pass arguments to `create_adaptive_mt_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(parent: nil, adaptive_mt_dataset: nil) - # Pass arguments to `create_adaptive_mt_dataset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @param adaptive_mt_dataset [::Google::Cloud::Translate::V3::AdaptiveMtDataset, ::Hash] - # Required. The AdaptiveMtDataset to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new - # - # # Call the create_adaptive_mt_dataset method. - # result = client.create_adaptive_mt_dataset request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. - # p result - # - def create_adaptive_mt_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest - - # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_adaptive_mt_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.create_adaptive_mt_dataset request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an Adaptive MT dataset, including all its entries and associated - # metadata. - # - # @overload delete_adaptive_mt_dataset(request, options = nil) - # Pass arguments to `delete_adaptive_mt_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) - # Pass arguments to `delete_adaptive_mt_dataset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the dataset. In the form of - # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new - # - # # Call the delete_adaptive_mt_dataset method. - # result = client.delete_adaptive_mt_dataset request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_adaptive_mt_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest - - # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_adaptive_mt_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.delete_adaptive_mt_dataset request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the Adaptive MT dataset. - # - # @overload get_adaptive_mt_dataset(request, options = nil) - # Pass arguments to `get_adaptive_mt_dataset` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_dataset(name: nil) - # Pass arguments to `get_adaptive_mt_dataset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the dataset. In the form of - # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new - # - # # Call the get_adaptive_mt_dataset method. - # result = client.get_adaptive_mt_dataset request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. - # p result - # - def get_adaptive_mt_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest - - # Converts hash 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_adaptive_mt_dataset.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::Translate::V3::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_adaptive_mt_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_adaptive_mt_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.get_adaptive_mt_dataset request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all Adaptive MT datasets for which the caller has read permission. - # - # @overload list_adaptive_mt_datasets(request, options = nil) - # Pass arguments to `list_adaptive_mt_datasets` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_datasets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_adaptive_mt_datasets` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list the Adaptive - # MT datasets. `projects/{project-number-or-id}/locations/{location-id}` - # @param page_size [::Integer] - # Optional. Requested page size. The server may return fewer results than - # requested. If unspecified, the server picks an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtDatasetsResponse.next_page_token returned from the - # previous call to `ListAdaptiveMtDatasets` method. The first page is - # returned if `page_token`is empty or missing. - # @param filter [::String] - # Optional. An expression for filtering the results of the request. - # Filter is not supported yet. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.new - # - # # Call the list_adaptive_mt_datasets method. - # result = client.list_adaptive_mt_datasets 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::Translate::V3::AdaptiveMtDataset. - # p item - # end - # - def list_adaptive_mt_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest - - # Converts hash 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_adaptive_mt_datasets.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::Translate::V3::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_adaptive_mt_datasets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_adaptive_mt_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_adaptive_mt_datasets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_datasets, "adaptive_mt_datasets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Translate text using Adaptive MT. - # - # @overload adaptive_mt_translate(request, options = nil) - # Pass arguments to `adaptive_mt_translate` via a request object, either of type - # {::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload adaptive_mt_translate(parent: nil, dataset: nil, content: nil, reference_sentence_config: nil, glossary_config: nil) - # Pass arguments to `adaptive_mt_translate` via keyword arguments. Note that at - # least one keyword argument is 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. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # @param dataset [::String] - # Required. The resource name for the dataset to use for adaptive MT. - # `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` - # @param content [::Array<::String>] - # Required. The content of the input in string format. - # @param reference_sentence_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig, ::Hash] - # Configuration for caller provided reference sentences. - # @param glossary_config [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig, ::Hash] - # Optional. Glossary to be applied. The glossary must be - # within the same region (have the same location-id) as the model, otherwise - # an INVALID_ARGUMENT (400) error is returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new - # - # # Call the adaptive_mt_translate method. - # result = client.adaptive_mt_translate request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse. - # p result - # - def adaptive_mt_translate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest - - # Converts hash 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.adaptive_mt_translate.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::Translate::V3::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.adaptive_mt_translate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.adaptive_mt_translate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.adaptive_mt_translate request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets and AdaptiveMtFile - # - # @overload get_adaptive_mt_file(request, options = nil) - # Pass arguments to `get_adaptive_mt_file` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) - # Pass arguments to `get_adaptive_mt_file` via keyword arguments. Note that at - # least one keyword argument is 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 file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::AdaptiveMtFile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new - # - # # Call the get_adaptive_mt_file method. - # result = client.get_adaptive_mt_file request - # - # # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtFile. - # p result - # - def get_adaptive_mt_file request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest - - # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_adaptive_mt_file.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.get_adaptive_mt_file request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an AdaptiveMtFile along with its sentences. - # - # @overload delete_adaptive_mt_file(request, options = nil) - # Pass arguments to `delete_adaptive_mt_file` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_file(name: nil) - # Pass arguments to `delete_adaptive_mt_file` via keyword arguments. Note that at - # least one keyword argument is 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 file to delete, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new - # - # # Call the delete_adaptive_mt_file method. - # result = client.delete_adaptive_mt_file request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_adaptive_mt_file request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest - - # Converts hash 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_adaptive_mt_file.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::Translate::V3::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_adaptive_mt_file.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_adaptive_mt_file.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.delete_adaptive_mt_file request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports an AdaptiveMtFile and adds all of its sentences into the - # AdaptiveMtDataset. - # - # @overload import_adaptive_mt_file(request, options = nil) - # Pass arguments to `import_adaptive_mt_file` via a request object, either of type - # {::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_adaptive_mt_file(parent: nil, file_input_source: nil, gcs_input_source: nil) - # Pass arguments to `import_adaptive_mt_file` via keyword arguments. Note that at - # least one keyword argument is 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 file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}` - # @param file_input_source [::Google::Cloud::Translate::V3::FileInputSource, ::Hash] - # Inline file source. - # - # Note: The following parameters are mutually exclusive: `file_input_source`, `gcs_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param gcs_input_source [::Google::Cloud::Translate::V3::GcsInputSource, ::Hash] - # Google Cloud Storage file source. - # - # Note: The following parameters are mutually exclusive: `gcs_input_source`, `file_input_source`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new - # - # # Call the import_adaptive_mt_file method. - # result = client.import_adaptive_mt_file request - # - # # The returned object is of type Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse. - # p result - # - def import_adaptive_mt_file request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest - - # Converts hash 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.import_adaptive_mt_file.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::Translate::V3::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.import_adaptive_mt_file.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_adaptive_mt_file.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.import_adaptive_mt_file request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset. - # - # @overload list_adaptive_mt_files(request, options = nil) - # Pass arguments to `list_adaptive_mt_files` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_files(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_adaptive_mt_files` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list the Adaptive - # MT files. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` - # @param page_size [::Integer] - # Optional. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtFilesResponse.next_page_token returned from the - # previous call to `ListAdaptiveMtFiles` method. The first page is - # returned if `page_token`is empty or missing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtFile>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.new - # - # # Call the list_adaptive_mt_files method. - # result = client.list_adaptive_mt_files 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::Translate::V3::AdaptiveMtFile. - # p item - # end - # - def list_adaptive_mt_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest - - # Converts hash 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_adaptive_mt_files.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::Translate::V3::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_adaptive_mt_files.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_adaptive_mt_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_adaptive_mt_files request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_files, "adaptive_mt_files", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all AdaptiveMtSentences under a given file/dataset. - # - # @overload list_adaptive_mt_sentences(request, options = nil) - # Pass arguments to `list_adaptive_mt_sentences` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_adaptive_mt_sentences(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_adaptive_mt_sentences` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list the Adaptive - # MT files. The following format lists all sentences under a file. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # The following format lists all sentences within a dataset. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` - # @param page_size [::Integer] - # @param page_token [::String] - # A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtSentencesRequest.next_page_token returned from the - # previous call to `ListTranslationMemories` method. The first page is - # returned if `page_token` is empty or missing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.new - # - # # Call the list_adaptive_mt_sentences method. - # result = client.list_adaptive_mt_sentences 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::Translate::V3::AdaptiveMtSentence. - # p item - # end - # - def list_adaptive_mt_sentences request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest - - # Converts hash 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_adaptive_mt_sentences.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::Translate::V3::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_adaptive_mt_sentences.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_adaptive_mt_sentences.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_adaptive_mt_sentences request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_adaptive_mt_sentences, "adaptive_mt_sentences", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Import sentence pairs into translation Dataset. - # - # @overload import_data(request, options = nil) - # Pass arguments to `import_data` via a request object, either of type - # {::Google::Cloud::Translate::V3::ImportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ImportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_data(dataset: nil, input_config: nil) - # Pass arguments to `import_data` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. Name of the dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @param input_config [::Google::Cloud::Translate::V3::DatasetInputConfig, ::Hash] - # Required. The config for the input content. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ImportDataRequest.new - # - # # Call the import_data method. - # result = client.import_data 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 import_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ImportDataRequest - - # Converts hash 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.import_data.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::Translate::V3::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.import_data.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.import_data request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports dataset's data to the provided output location. - # - # @overload export_data(request, options = nil) - # Pass arguments to `export_data` via a request object, either of type - # {::Google::Cloud::Translate::V3::ExportDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ExportDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_data(dataset: nil, output_config: nil) - # Pass arguments to `export_data` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dataset [::String] - # Required. Name of the dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @param output_config [::Google::Cloud::Translate::V3::DatasetOutputConfig, ::Hash] - # Required. The config for the output content. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ExportDataRequest.new - # - # # Call the export_data method. - # result = client.export_data 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 export_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ExportDataRequest - - # Converts hash 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.export_data.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::Translate::V3::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.export_data.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.export_data request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists sentence pairs in the dataset. - # - # @overload list_examples(request, options = nil) - # Pass arguments to `list_examples` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListExamplesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListExamplesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_examples(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_examples` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @param filter [::String] - # Optional. An expression for filtering the examples that will be returned. - # Example filter: - # * `usage=TRAIN` - # @param page_size [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @param page_token [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListExamples call. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Example>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListExamplesRequest.new - # - # # Call the list_examples method. - # result = client.list_examples 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::Translate::V3::Example. - # p item - # end - # - def list_examples request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListExamplesRequest - - # Converts hash 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_examples.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::Translate::V3::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_examples.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_examples.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_examples request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_examples, "examples", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Model. - # - # @overload create_model(request, options = nil) - # Pass arguments to `create_model` via a request object, either of type - # {::Google::Cloud::Translate::V3::CreateModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::CreateModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, model: nil) - # Pass arguments to `create_model` via keyword arguments. Note that at - # least one keyword argument is 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 project name, in form of - # `projects/{project}/locations/{location}` - # @param model [::Google::Cloud::Translate::V3::Model, ::Hash] - # Required. The Model to create. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::CreateModelRequest.new - # - # # Call the create_model method. - # result = client.create_model 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_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::CreateModelRequest - - # Converts hash 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_model.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::Translate::V3::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_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.create_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists models. - # - # @overload list_models(request, options = nil) - # Pass arguments to `list_models` via a request object, either of type - # {::Google::Cloud::Translate::V3::ListModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::ListModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_models(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_models` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @param filter [::String] - # Optional. An expression for filtering the models that will be returned. - # Supported filter: - # `dataset_id=${dataset_id}` - # @param page_size [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @param page_token [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListModels call. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Translate::V3::Model>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::ListModelsRequest.new - # - # # Call the list_models method. - # result = client.list_models 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::Translate::V3::Model. - # p item - # end - # - def list_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::ListModelsRequest - - # Converts hash 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_models.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::Translate::V3::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_models.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.list_models request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @translation_service_stub, :list_models, "models", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a model. - # - # @overload get_model(request, options = nil) - # Pass arguments to `get_model` via a request object, either of type - # {::Google::Cloud::Translate::V3::GetModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::GetModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Translate::V3::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::Model] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::GetModelRequest.new - # - # # Call the get_model method. - # result = client.get_model request - # - # # The returned object is of type Google::Cloud::Translate::V3::Model. - # p result - # - def get_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::GetModelRequest - - # Converts hash 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_model.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::Translate::V3::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_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.get_model request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a model. - # - # @overload delete_model(request, options = nil) - # Pass arguments to `delete_model` via a request object, either of type - # {::Google::Cloud::Translate::V3::DeleteModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Translate::V3::DeleteModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_model` via keyword arguments. Note that at - # least one keyword argument is 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 model to delete. - # @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/translate/v3" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Translate::V3::TranslationService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Translate::V3::DeleteModelRequest.new - # - # # Call the delete_model method. - # result = client.delete_model 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_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Translate::V3::DeleteModelRequest - - # Converts hash 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_model.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::Translate::V3::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_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @translation_service_stub.delete_model request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the TranslationService REST API. - # - # This class represents the configuration for TranslationService 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::Translate::V3::TranslationService::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 - # # translate_text to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.translate_text.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.translate_text.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 TranslationService 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 `translate_text` - # @return [::Gapic::Config::Method] - # - attr_reader :translate_text - ## - # RPC-specific configuration for `romanize_text` - # @return [::Gapic::Config::Method] - # - attr_reader :romanize_text - ## - # RPC-specific configuration for `detect_language` - # @return [::Gapic::Config::Method] - # - attr_reader :detect_language - ## - # RPC-specific configuration for `get_supported_languages` - # @return [::Gapic::Config::Method] - # - attr_reader :get_supported_languages - ## - # RPC-specific configuration for `translate_document` - # @return [::Gapic::Config::Method] - # - attr_reader :translate_document - ## - # RPC-specific configuration for `batch_translate_text` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_translate_text - ## - # RPC-specific configuration for `batch_translate_document` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_translate_document - ## - # RPC-specific configuration for `create_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :create_glossary - ## - # RPC-specific configuration for `update_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :update_glossary - ## - # RPC-specific configuration for `list_glossaries` - # @return [::Gapic::Config::Method] - # - attr_reader :list_glossaries - ## - # RPC-specific configuration for `get_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :get_glossary - ## - # RPC-specific configuration for `delete_glossary` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_glossary - ## - # RPC-specific configuration for `get_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :get_glossary_entry - ## - # RPC-specific configuration for `list_glossary_entries` - # @return [::Gapic::Config::Method] - # - attr_reader :list_glossary_entries - ## - # RPC-specific configuration for `create_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :create_glossary_entry - ## - # RPC-specific configuration for `update_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :update_glossary_entry - ## - # RPC-specific configuration for `delete_glossary_entry` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_glossary_entry - ## - # RPC-specific configuration for `create_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dataset - ## - # RPC-specific configuration for `get_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dataset - ## - # RPC-specific configuration for `list_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_datasets - ## - # RPC-specific configuration for `delete_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dataset - ## - # RPC-specific configuration for `create_adaptive_mt_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_adaptive_mt_dataset - ## - # RPC-specific configuration for `delete_adaptive_mt_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_adaptive_mt_dataset - ## - # RPC-specific configuration for `get_adaptive_mt_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_adaptive_mt_dataset - ## - # RPC-specific configuration for `list_adaptive_mt_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_adaptive_mt_datasets - ## - # RPC-specific configuration for `adaptive_mt_translate` - # @return [::Gapic::Config::Method] - # - attr_reader :adaptive_mt_translate - ## - # RPC-specific configuration for `get_adaptive_mt_file` - # @return [::Gapic::Config::Method] - # - attr_reader :get_adaptive_mt_file - ## - # RPC-specific configuration for `delete_adaptive_mt_file` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_adaptive_mt_file - ## - # RPC-specific configuration for `import_adaptive_mt_file` - # @return [::Gapic::Config::Method] - # - attr_reader :import_adaptive_mt_file - ## - # RPC-specific configuration for `list_adaptive_mt_files` - # @return [::Gapic::Config::Method] - # - attr_reader :list_adaptive_mt_files - ## - # RPC-specific configuration for `list_adaptive_mt_sentences` - # @return [::Gapic::Config::Method] - # - attr_reader :list_adaptive_mt_sentences - ## - # RPC-specific configuration for `import_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_data - ## - # RPC-specific configuration for `export_data` - # @return [::Gapic::Config::Method] - # - attr_reader :export_data - ## - # RPC-specific configuration for `list_examples` - # @return [::Gapic::Config::Method] - # - attr_reader :list_examples - ## - # RPC-specific configuration for `create_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_model - ## - # RPC-specific configuration for `list_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_models - ## - # RPC-specific configuration for `get_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_model - ## - # RPC-specific configuration for `delete_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_model - - # @private - def initialize parent_rpcs = nil - translate_text_config = parent_rpcs.translate_text if parent_rpcs.respond_to? :translate_text - @translate_text = ::Gapic::Config::Method.new translate_text_config - romanize_text_config = parent_rpcs.romanize_text if parent_rpcs.respond_to? :romanize_text - @romanize_text = ::Gapic::Config::Method.new romanize_text_config - detect_language_config = parent_rpcs.detect_language if parent_rpcs.respond_to? :detect_language - @detect_language = ::Gapic::Config::Method.new detect_language_config - get_supported_languages_config = parent_rpcs.get_supported_languages if parent_rpcs.respond_to? :get_supported_languages - @get_supported_languages = ::Gapic::Config::Method.new get_supported_languages_config - translate_document_config = parent_rpcs.translate_document if parent_rpcs.respond_to? :translate_document - @translate_document = ::Gapic::Config::Method.new translate_document_config - batch_translate_text_config = parent_rpcs.batch_translate_text if parent_rpcs.respond_to? :batch_translate_text - @batch_translate_text = ::Gapic::Config::Method.new batch_translate_text_config - batch_translate_document_config = parent_rpcs.batch_translate_document if parent_rpcs.respond_to? :batch_translate_document - @batch_translate_document = ::Gapic::Config::Method.new batch_translate_document_config - create_glossary_config = parent_rpcs.create_glossary if parent_rpcs.respond_to? :create_glossary - @create_glossary = ::Gapic::Config::Method.new create_glossary_config - update_glossary_config = parent_rpcs.update_glossary if parent_rpcs.respond_to? :update_glossary - @update_glossary = ::Gapic::Config::Method.new update_glossary_config - list_glossaries_config = parent_rpcs.list_glossaries if parent_rpcs.respond_to? :list_glossaries - @list_glossaries = ::Gapic::Config::Method.new list_glossaries_config - get_glossary_config = parent_rpcs.get_glossary if parent_rpcs.respond_to? :get_glossary - @get_glossary = ::Gapic::Config::Method.new get_glossary_config - delete_glossary_config = parent_rpcs.delete_glossary if parent_rpcs.respond_to? :delete_glossary - @delete_glossary = ::Gapic::Config::Method.new delete_glossary_config - get_glossary_entry_config = parent_rpcs.get_glossary_entry if parent_rpcs.respond_to? :get_glossary_entry - @get_glossary_entry = ::Gapic::Config::Method.new get_glossary_entry_config - list_glossary_entries_config = parent_rpcs.list_glossary_entries if parent_rpcs.respond_to? :list_glossary_entries - @list_glossary_entries = ::Gapic::Config::Method.new list_glossary_entries_config - create_glossary_entry_config = parent_rpcs.create_glossary_entry if parent_rpcs.respond_to? :create_glossary_entry - @create_glossary_entry = ::Gapic::Config::Method.new create_glossary_entry_config - update_glossary_entry_config = parent_rpcs.update_glossary_entry if parent_rpcs.respond_to? :update_glossary_entry - @update_glossary_entry = ::Gapic::Config::Method.new update_glossary_entry_config - delete_glossary_entry_config = parent_rpcs.delete_glossary_entry if parent_rpcs.respond_to? :delete_glossary_entry - @delete_glossary_entry = ::Gapic::Config::Method.new delete_glossary_entry_config - create_dataset_config = parent_rpcs.create_dataset if parent_rpcs.respond_to? :create_dataset - @create_dataset = ::Gapic::Config::Method.new create_dataset_config - get_dataset_config = parent_rpcs.get_dataset if parent_rpcs.respond_to? :get_dataset - @get_dataset = ::Gapic::Config::Method.new get_dataset_config - list_datasets_config = parent_rpcs.list_datasets if parent_rpcs.respond_to? :list_datasets - @list_datasets = ::Gapic::Config::Method.new list_datasets_config - delete_dataset_config = parent_rpcs.delete_dataset if parent_rpcs.respond_to? :delete_dataset - @delete_dataset = ::Gapic::Config::Method.new delete_dataset_config - create_adaptive_mt_dataset_config = parent_rpcs.create_adaptive_mt_dataset if parent_rpcs.respond_to? :create_adaptive_mt_dataset - @create_adaptive_mt_dataset = ::Gapic::Config::Method.new create_adaptive_mt_dataset_config - delete_adaptive_mt_dataset_config = parent_rpcs.delete_adaptive_mt_dataset if parent_rpcs.respond_to? :delete_adaptive_mt_dataset - @delete_adaptive_mt_dataset = ::Gapic::Config::Method.new delete_adaptive_mt_dataset_config - get_adaptive_mt_dataset_config = parent_rpcs.get_adaptive_mt_dataset if parent_rpcs.respond_to? :get_adaptive_mt_dataset - @get_adaptive_mt_dataset = ::Gapic::Config::Method.new get_adaptive_mt_dataset_config - list_adaptive_mt_datasets_config = parent_rpcs.list_adaptive_mt_datasets if parent_rpcs.respond_to? :list_adaptive_mt_datasets - @list_adaptive_mt_datasets = ::Gapic::Config::Method.new list_adaptive_mt_datasets_config - adaptive_mt_translate_config = parent_rpcs.adaptive_mt_translate if parent_rpcs.respond_to? :adaptive_mt_translate - @adaptive_mt_translate = ::Gapic::Config::Method.new adaptive_mt_translate_config - get_adaptive_mt_file_config = parent_rpcs.get_adaptive_mt_file if parent_rpcs.respond_to? :get_adaptive_mt_file - @get_adaptive_mt_file = ::Gapic::Config::Method.new get_adaptive_mt_file_config - delete_adaptive_mt_file_config = parent_rpcs.delete_adaptive_mt_file if parent_rpcs.respond_to? :delete_adaptive_mt_file - @delete_adaptive_mt_file = ::Gapic::Config::Method.new delete_adaptive_mt_file_config - import_adaptive_mt_file_config = parent_rpcs.import_adaptive_mt_file if parent_rpcs.respond_to? :import_adaptive_mt_file - @import_adaptive_mt_file = ::Gapic::Config::Method.new import_adaptive_mt_file_config - list_adaptive_mt_files_config = parent_rpcs.list_adaptive_mt_files if parent_rpcs.respond_to? :list_adaptive_mt_files - @list_adaptive_mt_files = ::Gapic::Config::Method.new list_adaptive_mt_files_config - list_adaptive_mt_sentences_config = parent_rpcs.list_adaptive_mt_sentences if parent_rpcs.respond_to? :list_adaptive_mt_sentences - @list_adaptive_mt_sentences = ::Gapic::Config::Method.new list_adaptive_mt_sentences_config - import_data_config = parent_rpcs.import_data if parent_rpcs.respond_to? :import_data - @import_data = ::Gapic::Config::Method.new import_data_config - export_data_config = parent_rpcs.export_data if parent_rpcs.respond_to? :export_data - @export_data = ::Gapic::Config::Method.new export_data_config - list_examples_config = parent_rpcs.list_examples if parent_rpcs.respond_to? :list_examples - @list_examples = ::Gapic::Config::Method.new list_examples_config - create_model_config = parent_rpcs.create_model if parent_rpcs.respond_to? :create_model - @create_model = ::Gapic::Config::Method.new create_model_config - list_models_config = parent_rpcs.list_models if parent_rpcs.respond_to? :list_models - @list_models = ::Gapic::Config::Method.new list_models_config - get_model_config = parent_rpcs.get_model if parent_rpcs.respond_to? :get_model - @get_model = ::Gapic::Config::Method.new get_model_config - delete_model_config = parent_rpcs.delete_model if parent_rpcs.respond_to? :delete_model - @delete_model = ::Gapic::Config::Method.new delete_model_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb deleted file mode 100644 index fe150ccbe903..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/operations.rb +++ /dev/null @@ -1,1093 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - module TranslationService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "translate.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the TranslationService 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 TranslationService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @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::Translate::V3::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? - throw :response, 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::Translate::V3::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? - throw :response, 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::Translate::V3::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? - 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::Translate::V3::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? - end - rescue ::Gapic::Rest::Error => 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 [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::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 - call_metadata = @config.rpcs.wait_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::Translate::V3::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.wait_operation.timeout, - metadata: call_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.wait_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "translate.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 - ## - # 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 - - ## - # @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, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the wait_operation REST call - # - # @param request_pb [::Google::Longrunning::WaitOperationRequest] - # 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 wait_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_wait_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, - method_name: "wait_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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: "/v3/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v3/{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: "/v3/{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: "/v3/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the wait_operation REST call - # - # @param request_pb [::Google::Longrunning::WaitOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_wait_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{name}:wait", - body: "*", - 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-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb deleted file mode 100644 index 2bee326ee72a..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb +++ /dev/null @@ -1,2454 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" - -module Google - module Cloud - module Translate - module V3 - module TranslationService - module Rest - ## - # REST service stub for the TranslationService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the translate_text REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::TranslateTextRequest] - # 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::Translate::V3::TranslateTextResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::TranslateTextResponse] - # A result object deserialized from the server's reply - def translate_text request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_translate_text_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, - method_name: "translate_text", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::TranslateTextResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the romanize_text REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::RomanizeTextRequest] - # 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::Translate::V3::RomanizeTextResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::RomanizeTextResponse] - # A result object deserialized from the server's reply - def romanize_text request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_romanize_text_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, - method_name: "romanize_text", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::RomanizeTextResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the detect_language REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DetectLanguageRequest] - # 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::Translate::V3::DetectLanguageResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::DetectLanguageResponse] - # A result object deserialized from the server's reply - def detect_language request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_detect_language_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, - method_name: "detect_language", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::DetectLanguageResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_supported_languages REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest] - # 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::Translate::V3::SupportedLanguages] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::SupportedLanguages] - # A result object deserialized from the server's reply - def get_supported_languages request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_supported_languages_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, - method_name: "get_supported_languages", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::SupportedLanguages.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the translate_document REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::TranslateDocumentRequest] - # 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::Translate::V3::TranslateDocumentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::TranslateDocumentResponse] - # A result object deserialized from the server's reply - def translate_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_translate_document_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, - method_name: "translate_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_translate_text REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateTextRequest] - # 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 batch_translate_text request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_translate_text_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, - method_name: "batch_translate_text", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_translate_document REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest] - # 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 batch_translate_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_translate_document_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, - method_name: "batch_translate_document", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryRequest] - # 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_glossary request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_glossary_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, - method_name: "create_glossary", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryRequest] - # 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_glossary request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_glossary_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, - method_name: "update_glossary", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_glossaries REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListGlossariesRequest] - # 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::Translate::V3::ListGlossariesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListGlossariesResponse] - # A result object deserialized from the server's reply - def list_glossaries request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_glossaries_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, - method_name: "list_glossaries", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListGlossariesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryRequest] - # 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::Translate::V3::Glossary] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::Glossary] - # A result object deserialized from the server's reply - def get_glossary request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_glossary_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, - method_name: "get_glossary", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::Glossary.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryRequest] - # 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_glossary request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_glossary_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, - method_name: "delete_glossary", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest] - # 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::Translate::V3::GlossaryEntry] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # A result object deserialized from the server's reply - def get_glossary_entry request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_glossary_entry_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, - method_name: "get_glossary_entry", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::GlossaryEntry.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_glossary_entries REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest] - # 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::Translate::V3::ListGlossaryEntriesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse] - # A result object deserialized from the server's reply - def list_glossary_entries request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_glossary_entries_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, - method_name: "list_glossary_entries", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest] - # 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::Translate::V3::GlossaryEntry] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # A result object deserialized from the server's reply - def create_glossary_entry request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_glossary_entry_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, - method_name: "create_glossary_entry", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::GlossaryEntry.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest] - # 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::Translate::V3::GlossaryEntry] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # A result object deserialized from the server's reply - def update_glossary_entry request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_glossary_entry_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, - method_name: "update_glossary_entry", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::GlossaryEntry.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest] - # 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_glossary_entry request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_glossary_entry_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, - method_name: "delete_glossary_entry", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateDatasetRequest] - # 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_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_dataset_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, - method_name: "create_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetDatasetRequest] - # 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::Translate::V3::Dataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::Dataset] - # A result object deserialized from the server's reply - def get_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_dataset_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, - method_name: "get_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::Dataset.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_datasets REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListDatasetsRequest] - # 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::Translate::V3::ListDatasetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListDatasetsResponse] - # A result object deserialized from the server's reply - def list_datasets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_datasets_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, - method_name: "list_datasets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListDatasetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteDatasetRequest] - # 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_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_dataset_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, - method_name: "delete_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_adaptive_mt_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest] - # 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::Translate::V3::AdaptiveMtDataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # A result object deserialized from the server's reply - def create_adaptive_mt_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_adaptive_mt_dataset_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, - method_name: "create_adaptive_mt_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_adaptive_mt_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest] - # 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_adaptive_mt_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_adaptive_mt_dataset_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, - method_name: "delete_adaptive_mt_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_adaptive_mt_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest] - # 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::Translate::V3::AdaptiveMtDataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # A result object deserialized from the server's reply - def get_adaptive_mt_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_adaptive_mt_dataset_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, - method_name: "get_adaptive_mt_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_adaptive_mt_datasets REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest] - # 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::Translate::V3::ListAdaptiveMtDatasetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse] - # A result object deserialized from the server's reply - def list_adaptive_mt_datasets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_adaptive_mt_datasets_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, - method_name: "list_adaptive_mt_datasets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the adaptive_mt_translate REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest] - # 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::Translate::V3::AdaptiveMtTranslateResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse] - # A result object deserialized from the server's reply - def adaptive_mt_translate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_adaptive_mt_translate_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, - method_name: "adaptive_mt_translate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_adaptive_mt_file REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest] - # 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::Translate::V3::AdaptiveMtFile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] - # A result object deserialized from the server's reply - def get_adaptive_mt_file request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_adaptive_mt_file_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, - method_name: "get_adaptive_mt_file", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::AdaptiveMtFile.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_adaptive_mt_file REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest] - # 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_adaptive_mt_file request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_adaptive_mt_file_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, - method_name: "delete_adaptive_mt_file", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_adaptive_mt_file REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest] - # 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::Translate::V3::ImportAdaptiveMtFileResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse] - # A result object deserialized from the server's reply - def import_adaptive_mt_file request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_adaptive_mt_file_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, - method_name: "import_adaptive_mt_file", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_adaptive_mt_files REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest] - # 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::Translate::V3::ListAdaptiveMtFilesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse] - # A result object deserialized from the server's reply - def list_adaptive_mt_files request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_adaptive_mt_files_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, - method_name: "list_adaptive_mt_files", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_adaptive_mt_sentences REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest] - # 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::Translate::V3::ListAdaptiveMtSentencesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse] - # A result object deserialized from the server's reply - def list_adaptive_mt_sentences request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_adaptive_mt_sentences_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, - method_name: "list_adaptive_mt_sentences", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_data REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ImportDataRequest] - # 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 import_data request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_data_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, - method_name: "import_data", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the export_data REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ExportDataRequest] - # 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 export_data request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_data_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, - method_name: "export_data", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_examples REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListExamplesRequest] - # 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::Translate::V3::ListExamplesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListExamplesResponse] - # A result object deserialized from the server's reply - def list_examples request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_examples_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, - method_name: "list_examples", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListExamplesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_model REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateModelRequest] - # 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_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_model_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, - method_name: "create_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_models REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListModelsRequest] - # 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::Translate::V3::ListModelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::ListModelsResponse] - # A result object deserialized from the server's reply - def list_models request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_models_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, - method_name: "list_models", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::ListModelsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_model REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetModelRequest] - # 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::Translate::V3::Model] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Translate::V3::Model] - # A result object deserialized from the server's reply - def get_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_model_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, - method_name: "get_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Translate::V3::Model.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_model REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteModelRequest] - # 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_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_model_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, - method_name: "delete_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the translate_text REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::TranslateTextRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_translate_text_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:translateText", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:translateText", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the romanize_text REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::RomanizeTextRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_romanize_text_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:romanizeText", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:romanizeText", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the detect_language REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DetectLanguageRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_detect_language_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:detectLanguage", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:detectLanguage", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_supported_languages REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest] - # 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_supported_languages_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/supportedLanguages", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/supportedLanguages", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the translate_document REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::TranslateDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_translate_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:translateDocument", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_translate_text REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateTextRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_translate_text_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:batchTranslateText", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_translate_document REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_translate_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:batchTranslateDocument", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryRequest] - # 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_glossary_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/glossaries", - body: "glossary", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryRequest] - # 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_glossary_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{glossary.name}", - body: "glossary", - matches: [ - ["glossary.name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_glossaries REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListGlossariesRequest] - # 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_glossaries_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/glossaries", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryRequest] - # 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_glossary_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_glossary REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryRequest] - # 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_glossary_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetGlossaryEntryRequest] - # 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_glossary_entry_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_glossary_entries REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest] - # 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_glossary_entries_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/glossaryEntries", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest] - # 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_glossary_entry_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/glossaryEntries", - body: "glossary_entry", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest] - # 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_glossary_entry_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3/{glossary_entry.name}", - body: "glossary_entry", - matches: [ - ["glossary_entry.name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_glossary_entry REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest] - # 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_glossary_entry_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/glossaries/[^/]+/glossaryEntries/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateDatasetRequest] - # 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_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/datasets", - body: "dataset", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetDatasetRequest] - # 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_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_datasets REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListDatasetsRequest] - # 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_datasets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/datasets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteDatasetRequest] - # 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_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_adaptive_mt_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest] - # 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_adaptive_mt_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/adaptiveMtDatasets", - body: "adaptive_mt_dataset", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_adaptive_mt_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest] - # 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_adaptive_mt_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_adaptive_mt_dataset REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest] - # 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_adaptive_mt_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_adaptive_mt_datasets REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest] - # 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_adaptive_mt_datasets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/adaptiveMtDatasets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the adaptive_mt_translate REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_adaptive_mt_translate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:adaptiveMtTranslate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_adaptive_mt_file REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest] - # 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_adaptive_mt_file_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/adaptiveMtFiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_adaptive_mt_file REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest] - # 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_adaptive_mt_file_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/adaptiveMtFiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_adaptive_mt_file REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_adaptive_mt_file_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}:importAdaptiveMtFile", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_adaptive_mt_files REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest] - # 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_adaptive_mt_files_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/adaptiveMtFiles", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_adaptive_mt_sentences REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest] - # 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_adaptive_mt_sentences_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/adaptiveMtSentences", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/adaptiveMtFiles/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/adaptiveMtSentences", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/adaptiveMtDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_data REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ImportDataRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_data_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{dataset}:importData", - body: "*", - matches: [ - ["dataset", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_data REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ExportDataRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_data_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{dataset}:exportData", - body: "*", - matches: [ - ["dataset", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_examples REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListExamplesRequest] - # 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_examples_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/examples", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/datasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_model REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::CreateModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3/{parent}/models", - body: "model", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_models REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::ListModelsRequest] - # 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_models_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{parent}/models", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_model REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::GetModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_model REST call - # - # @param request_pb [::Google::Cloud::Translate::V3::DeleteModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/models/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb deleted file mode 100644 index 06eda86109d1..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_pb.rb +++ /dev/null @@ -1,112 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/translate/v3/translation_service.proto - -require 'google/protobuf' - -require 'google/cloud/translate/v3/adaptive_mt_pb' -require 'google/cloud/translate/v3/automl_translation_pb' -require 'google/cloud/translate/v3/common_pb' -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n3google/cloud/translate/v3/translation_service.proto\x12\x1bgoogle.cloud.translation.v3\x1a+google/cloud/translate/v3/adaptive_mt.proto\x1a\x32google/cloud/translate/v3/automl_translation.proto\x1a&google/cloud/translate/v3/common.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"7\n\x15TransliterationConfig\x12\x1e\n\x16\x65nable_transliteration\x18\x01 \x01(\x08\"\x8e\x04\n\x14TranslateTextRequest\x12\x15\n\x08\x63ontents\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14source_language_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14target_language_code\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x08 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfigB\x03\xe0\x41\x01\x12W\n\x16transliteration_config\x18\r \x01(\x0b\x32\x32.google.cloud.translation.v3.TransliterationConfigB\x03\xe0\x41\x01\x12R\n\x06labels\x18\n \x03(\x0b\x32=.google.cloud.translation.v3.TranslateTextRequest.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\"\xa0\x01\n\x15TranslateTextResponse\x12>\n\x0ctranslations\x18\x01 \x03(\x0b\x32(.google.cloud.translation.v3.Translation\x12G\n\x15glossary_translations\x18\x03 \x03(\x0b\x32(.google.cloud.translation.v3.Translation\"\xa8\x01\n\x0bTranslation\x12\x17\n\x0ftranslated_text\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x04 \x01(\t\x12Q\n\x0fglossary_config\x18\x03 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig\"\x8a\x01\n\x13RomanizeTextRequest\x12\x39\n\x06parent\x18\x04 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x15\n\x08\x63ontents\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\"F\n\x0cRomanization\x12\x16\n\x0eromanized_text\x18\x01 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x02 \x01(\t\"X\n\x14RomanizeTextResponse\x12@\n\rromanizations\x18\x01 \x03(\x0b\x32).google.cloud.translation.v3.Romanization\"\x9f\x02\n\x15\x44\x65tectLanguageRequest\x12\x39\n\x06parent\x18\x05 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x12\n\x05model\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x07\x63ontent\x18\x01 \x01(\tH\x00\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12S\n\x06labels\x18\x06 \x03(\x0b\x32>.google.cloud.translation.v3.DetectLanguageRequest.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\x42\x08\n\x06source\"=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\"Z\n\x16\x44\x65tectLanguageResponse\x12@\n\tlanguages\x18\x01 \x03(\x0b\x32-.google.cloud.translation.v3.DetectedLanguage\"\x91\x01\n\x1cGetSupportedLanguagesRequest\x12\x39\n\x06parent\x18\x03 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\"\n\x15\x64isplay_language_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x02 \x01(\tB\x03\xe0\x41\x01\"W\n\x12SupportedLanguages\x12\x41\n\tlanguages\x18\x01 \x03(\x0b\x32..google.cloud.translation.v3.SupportedLanguage\"p\n\x11SupportedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x16\n\x0esupport_source\x18\x03 \x01(\x08\x12\x16\n\x0esupport_target\x18\x04 \x01(\x08\"#\n\tGcsSource\x12\x16\n\tinput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"m\n\x0bInputConfig\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12<\n\ngcs_source\x18\x02 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source\"0\n\x0eGcsDestination\x12\x1e\n\x11output_uri_prefix\x18\x01 \x01(\tB\x03\xe0\x41\x02\"e\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination\"\x83\x01\n\x13\x44ocumentInputConfig\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12<\n\ngcs_source\x18\x02 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x12\x11\n\tmime_type\x18\x04 \x01(\tB\x08\n\x06source\"\x8a\x01\n\x14\x44ocumentOutputConfig\x12K\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.GcsDestinationB\x03\xe0\x41\x01H\x00\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x42\r\n\x0b\x64\x65stination\"\xbe\x05\n\x18TranslateDocumentRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14target_language_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12T\n\x15\x64ocument_input_config\x18\x04 \x01(\x0b\x32\x30.google.cloud.translation.v3.DocumentInputConfigB\x03\xe0\x41\x02\x12V\n\x16\x64ocument_output_config\x18\x05 \x01(\x0b\x32\x31.google.cloud.translation.v3.DocumentOutputConfigB\x03\xe0\x41\x01\x12\x12\n\x05model\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12V\n\x0fglossary_config\x18\x07 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfigB\x03\xe0\x41\x01\x12V\n\x06labels\x18\x08 \x03(\x0b\x32\x41.google.cloud.translation.v3.TranslateDocumentRequest.LabelsEntryB\x03\xe0\x41\x01\x12#\n\x16\x63ustomized_attribution\x18\n \x01(\tB\x03\xe0\x41\x01\x12)\n\x1cis_translate_native_pdf_only\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12-\n enable_shadow_removal_native_pdf\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_rotation_correction\x18\r \x01(\x08\x42\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\"e\n\x13\x44ocumentTranslation\x12\x1b\n\x13\x62yte_stream_outputs\x18\x01 \x03(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x65tected_language_code\x18\x03 \x01(\t\"\xa6\x02\n\x19TranslateDocumentResponse\x12N\n\x14\x64ocument_translation\x18\x01 \x01(\x0b\x32\x30.google.cloud.translation.v3.DocumentTranslation\x12W\n\x1dglossary_document_translation\x18\x02 \x01(\x0b\x32\x30.google.cloud.translation.v3.DocumentTranslation\x12\r\n\x05model\x18\x03 \x01(\t\x12Q\n\x0fglossary_config\x18\x04 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig\"\x88\x06\n\x19\x42\x61tchTranslateTextRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15target_language_codes\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12W\n\x06models\x18\x04 \x03(\x0b\x32\x42.google.cloud.translation.v3.BatchTranslateTextRequest.ModelsEntryB\x03\xe0\x41\x01\x12\x44\n\rinput_configs\x18\x05 \x03(\x0b\x32(.google.cloud.translation.v3.InputConfigB\x03\xe0\x41\x02\x12\x45\n\routput_config\x18\x06 \x01(\x0b\x32).google.cloud.translation.v3.OutputConfigB\x03\xe0\x41\x02\x12_\n\nglossaries\x18\x07 \x03(\x0b\x32\x46.google.cloud.translation.v3.BatchTranslateTextRequest.GlossariesEntryB\x03\xe0\x41\x01\x12W\n\x06labels\x18\t \x03(\x0b\x32\x42.google.cloud.translation.v3.BatchTranslateTextRequest.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ak\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xce\x02\n\x16\x42\x61tchTranslateMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.translation.v3.BatchTranslateMetadata.State\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12\x18\n\x10total_characters\x18\x04 \x01(\x03\x12/\n\x0bsubmit_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xcb\x01\n\x16\x42\x61tchTranslateResponse\x12\x18\n\x10total_characters\x18\x01 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x02 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x03 \x01(\x03\x12/\n\x0bsubmit_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"]\n\x13GlossaryInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source\"\x9a\x05\n\x08Glossary\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\rlanguage_pair\x18\x03 \x01(\x0b\x32\x36.google.cloud.translation.v3.Glossary.LanguageCodePairH\x00\x12T\n\x12language_codes_set\x18\x04 \x01(\x0b\x32\x36.google.cloud.translation.v3.Glossary.LanguageCodesSetH\x00\x12\x46\n\x0cinput_config\x18\x05 \x01(\x0b\x32\x30.google.cloud.translation.v3.GlossaryInputConfig\x12\x18\n\x0b\x65ntry_count\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0bsubmit_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\t \x01(\tB\x03\xe0\x41\x01\x1aN\n\x10LanguageCodePair\x12\x1c\n\x14source_language_code\x18\x01 \x01(\t\x12\x1c\n\x14target_language_code\x18\x02 \x01(\t\x1a*\n\x10LanguageCodesSet\x12\x16\n\x0elanguage_codes\x18\x01 \x03(\t:e\xea\x41\x62\n!translate.googleapis.com/Glossary\x12=projects/{project}/locations/{location}/glossaries/{glossary}B\x0b\n\tlanguages\"\x90\x01\n\x15\x43reateGlossaryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x08glossary\x18\x02 \x01(\x0b\x32%.google.cloud.translation.v3.GlossaryB\x03\xe0\x41\x02\"\x86\x01\n\x15UpdateGlossaryRequest\x12<\n\x08glossary\x18\x01 \x01(\x0b\x32%.google.cloud.translation.v3.GlossaryB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"M\n\x12GetGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\"P\n\x15\x44\x65leteGlossaryRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\"\x98\x01\n\x15ListGlossariesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\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\"l\n\x16ListGlossariesResponse\x12\x39\n\nglossaries\x18\x01 \x03(\x0b\x32%.google.cloud.translation.v3.Glossary\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x17GetGlossaryEntryRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&translate.googleapis.com/GlossaryEntry\"Z\n\x1a\x44\x65leteGlossaryEntryRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&translate.googleapis.com/GlossaryEntry\"\x88\x01\n\x1aListGlossaryEntriesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\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\"\x86\x01\n\x1bListGlossaryEntriesResponse\x12I\n\x10glossary_entries\x18\x01 \x03(\x0b\x32*.google.cloud.translation.v3.GlossaryEntryB\x03\xe0\x41\x01\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x1a\x43reateGlossaryEntryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12G\n\x0eglossary_entry\x18\x02 \x01(\x0b\x32*.google.cloud.translation.v3.GlossaryEntryB\x03\xe0\x41\x02\"e\n\x1aUpdateGlossaryEntryRequest\x12G\n\x0eglossary_entry\x18\x01 \x01(\x0b\x32*.google.cloud.translation.v3.GlossaryEntryB\x03\xe0\x41\x02\"\x88\x02\n\x16\x43reateGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.CreateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xb3\x02\n\x16UpdateGlossaryMetadata\x12\x37\n\x08glossary\x18\x01 \x01(\x0b\x32%.google.cloud.translation.v3.Glossary\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.UpdateGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\x88\x02\n\x16\x44\x65leteGlossaryMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x05state\x18\x02 \x01(\x0e\x32\x39.google.cloud.translation.v3.DeleteGlossaryMetadata.State\x12/\n\x0bsubmit_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\x85\x01\n\x16\x44\x65leteGlossaryResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd1\x07\n\x1d\x42\x61tchTranslateDocumentRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12!\n\x14source_language_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15target_language_codes\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12Q\n\rinput_configs\x18\x04 \x03(\x0b\x32\x35.google.cloud.translation.v3.BatchDocumentInputConfigB\x03\xe0\x41\x02\x12R\n\routput_config\x18\x05 \x01(\x0b\x32\x36.google.cloud.translation.v3.BatchDocumentOutputConfigB\x03\xe0\x41\x02\x12[\n\x06models\x18\x06 \x03(\x0b\x32\x46.google.cloud.translation.v3.BatchTranslateDocumentRequest.ModelsEntryB\x03\xe0\x41\x01\x12\x63\n\nglossaries\x18\x07 \x03(\x0b\x32J.google.cloud.translation.v3.BatchTranslateDocumentRequest.GlossariesEntryB\x03\xe0\x41\x01\x12r\n\x12\x66ormat_conversions\x18\x08 \x03(\x0b\x32Q.google.cloud.translation.v3.BatchTranslateDocumentRequest.FormatConversionsEntryB\x03\xe0\x41\x01\x12#\n\x16\x63ustomized_attribution\x18\n \x01(\tB\x03\xe0\x41\x01\x12-\n enable_shadow_removal_native_pdf\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_rotation_correction\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a-\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1ak\n\x0fGlossariesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0b\x32\x38.google.cloud.translation.v3.TranslateTextGlossaryConfig:\x02\x38\x01\x1a\x38\n\x16\x46ormatConversionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"b\n\x18\x42\x61tchDocumentInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.translation.v3.GcsSourceH\x00\x42\x08\n\x06source\"r\n\x19\x42\x61tchDocumentOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32+.google.cloud.translation.v3.GcsDestinationH\x00\x42\r\n\x0b\x64\x65stination\"\xd9\x02\n\x1e\x42\x61tchTranslateDocumentResponse\x12\x13\n\x0btotal_pages\x18\x01 \x01(\x03\x12\x18\n\x10translated_pages\x18\x02 \x01(\x03\x12\x14\n\x0c\x66\x61iled_pages\x18\x03 \x01(\x03\x12\x1c\n\x14total_billable_pages\x18\x04 \x01(\x03\x12\x18\n\x10total_characters\x18\x05 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x06 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x07 \x01(\x03\x12!\n\x19total_billable_characters\x18\x08 \x01(\x03\x12/\n\x0bsubmit_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe4\x03\n\x1e\x42\x61tchTranslateDocumentMetadata\x12P\n\x05state\x18\x01 \x01(\x0e\x32\x41.google.cloud.translation.v3.BatchTranslateDocumentMetadata.State\x12\x13\n\x0btotal_pages\x18\x02 \x01(\x03\x12\x18\n\x10translated_pages\x18\x03 \x01(\x03\x12\x14\n\x0c\x66\x61iled_pages\x18\x04 \x01(\x03\x12\x1c\n\x14total_billable_pages\x18\x05 \x01(\x03\x12\x18\n\x10total_characters\x18\x06 \x01(\x03\x12\x1d\n\x15translated_characters\x18\x07 \x01(\x03\x12\x19\n\x11\x66\x61iled_characters\x18\x08 \x01(\x03\x12!\n\x19total_billable_characters\x18\t \x01(\x03\x12/\n\x0bsubmit_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\r\n\tCANCELLED\x10\x05\"\xa1\x01\n\x1bTranslateTextGlossaryConfig\x12;\n\x08glossary\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!translate.googleapis.com/Glossary\x12\x18\n\x0bignore_case\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1e\x63ontextual_translation_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x32\xbd\x43\n\x12TranslationService\x12\xd4\x02\n\rTranslateText\x12\x31.google.cloud.translation.v3.TranslateTextRequest\x1a\x32.google.cloud.translation.v3.TranslateTextResponse\"\xdb\x01\xda\x41$parent,target_language_code,contents\xda\x41Iparent,model,mime_type,source_language_code,target_language_code,contents\x82\xd3\xe4\x93\x02\x62\"1/v3/{parent=projects/*/locations/*}:translateText:\x01*Z*\"%/v3/{parent=projects/*}:translateText:\x01*\x12\xed\x01\n\x0cRomanizeText\x12\x30.google.cloud.translation.v3.RomanizeTextRequest\x1a\x31.google.cloud.translation.v3.RomanizeTextResponse\"x\xda\x41\x0fparent,contents\x82\xd3\xe4\x93\x02`\"0/v3/{parent=projects/*/locations/*}:romanizeText:\x01*Z)\"$/v3/{parent=projects/*}:romanizeText:\x01*\x12\x87\x02\n\x0e\x44\x65tectLanguage\x12\x32.google.cloud.translation.v3.DetectLanguageRequest\x1a\x33.google.cloud.translation.v3.DetectLanguageResponse\"\x8b\x01\xda\x41\x1eparent,model,mime_type,content\x82\xd3\xe4\x93\x02\x64\"2/v3/{parent=projects/*/locations/*}:detectLanguage:\x01*Z+\"&/v3/{parent=projects/*}:detectLanguage:\x01*\x12\x97\x02\n\x15GetSupportedLanguages\x12\x39.google.cloud.translation.v3.GetSupportedLanguagesRequest\x1a/.google.cloud.translation.v3.SupportedLanguages\"\x91\x01\xda\x41\"parent,model,display_language_code\x82\xd3\xe4\x93\x02\x66\x12\x36/v3/{parent=projects/*/locations/*}/supportedLanguagesZ,\x12*/v3/{parent=projects/*}/supportedLanguages\x12\xc4\x01\n\x11TranslateDocument\x12\x35.google.cloud.translation.v3.TranslateDocumentRequest\x1a\x36.google.cloud.translation.v3.TranslateDocumentResponse\"@\x82\xd3\xe4\x93\x02:\"5/v3/{parent=projects/*/locations/*}:translateDocument:\x01*\x12\xe1\x01\n\x12\x42\x61tchTranslateText\x12\x36.google.cloud.translation.v3.BatchTranslateTextRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41\x30\n\x16\x42\x61tchTranslateResponse\x12\x16\x42\x61tchTranslateMetadata\x82\xd3\xe4\x93\x02;\"6/v3/{parent=projects/*/locations/*}:batchTranslateText:\x01*\x12\xce\x02\n\x16\x42\x61tchTranslateDocument\x12:.google.cloud.translation.v3.BatchTranslateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x01\xca\x41@\n\x1e\x42\x61tchTranslateDocumentResponse\x12\x1e\x42\x61tchTranslateDocumentMetadata\xda\x41Mparent,source_language_code,target_language_codes,input_configs,output_config\x82\xd3\xe4\x93\x02?\":/v3/{parent=projects/*/locations/*}:batchTranslateDocument:\x01*\x12\xdc\x01\n\x0e\x43reateGlossary\x12\x32.google.cloud.translation.v3.CreateGlossaryRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41\"\n\x08Glossary\x12\x16\x43reateGlossaryMetadata\xda\x41\x0fparent,glossary\x82\xd3\xe4\x93\x02:\"./v3/{parent=projects/*/locations/*}/glossaries:\x08glossary\x12\xeb\x01\n\x0eUpdateGlossary\x12\x32.google.cloud.translation.v3.UpdateGlossaryRequest\x1a\x1d.google.longrunning.Operation\"\x85\x01\xca\x41\"\n\x08Glossary\x12\x16UpdateGlossaryMetadata\xda\x41\x14glossary,update_mask\x82\xd3\xe4\x93\x02\x43\x32\x37/v3/{glossary.name=projects/*/locations/*/glossaries/*}:\x08glossary\x12\xba\x01\n\x0eListGlossaries\x12\x32.google.cloud.translation.v3.ListGlossariesRequest\x1a\x33.google.cloud.translation.v3.ListGlossariesResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v3/{parent=projects/*/locations/*}/glossaries\x12\xa4\x01\n\x0bGetGlossary\x12/.google.cloud.translation.v3.GetGlossaryRequest\x1a%.google.cloud.translation.v3.Glossary\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v3/{name=projects/*/locations/*/glossaries/*}\x12\xd5\x01\n\x0e\x44\x65leteGlossary\x12\x32.google.cloud.translation.v3.DeleteGlossaryRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x30\n\x16\x44\x65leteGlossaryResponse\x12\x16\x44\x65leteGlossaryMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v3/{name=projects/*/locations/*/glossaries/*}\x12\xc5\x01\n\x10GetGlossaryEntry\x12\x34.google.cloud.translation.v3.GetGlossaryEntryRequest\x1a*.google.cloud.translation.v3.GlossaryEntry\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42\x12@/v3/{name=projects/*/locations/*/glossaries/*/glossaryEntries/*}\x12\xdb\x01\n\x13ListGlossaryEntries\x12\x37.google.cloud.translation.v3.ListGlossaryEntriesRequest\x1a\x38.google.cloud.translation.v3.ListGlossaryEntriesResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v3/{parent=projects/*/locations/*/glossaries/*}/glossaryEntries\x12\xec\x01\n\x13\x43reateGlossaryEntry\x12\x37.google.cloud.translation.v3.CreateGlossaryEntryRequest\x1a*.google.cloud.translation.v3.GlossaryEntry\"p\xda\x41\x15parent,glossary_entry\x82\xd3\xe4\x93\x02R\"@/v3/{parent=projects/*/locations/*/glossaries/*}/glossaryEntries:\x0eglossary_entry\x12\xf4\x01\n\x13UpdateGlossaryEntry\x12\x37.google.cloud.translation.v3.UpdateGlossaryEntryRequest\x1a*.google.cloud.translation.v3.GlossaryEntry\"x\xda\x41\x0eglossary_entry\x82\xd3\xe4\x93\x02\x61\x32O/v3/{glossary_entry.name=projects/*/locations/*/glossaries/*/glossaryEntries/*}:\x0eglossary_entry\x12\xb7\x01\n\x13\x44\x65leteGlossaryEntry\x12\x37.google.cloud.translation.v3.DeleteGlossaryEntryRequest\x1a\x16.google.protobuf.Empty\"O\xda\x41\x04name\x82\xd3\xe4\x93\x02\x42*@/v3/{name=projects/*/locations/*/glossaries/*/glossaryEntries/*}\x12\xd4\x01\n\rCreateDataset\x12\x31.google.cloud.translation.v3.CreateDatasetRequest\x1a\x1d.google.longrunning.Operation\"q\xca\x41 \n\x07\x44\x61taset\x12\x15\x43reateDatasetMetadata\xda\x41\x0eparent,dataset\x82\xd3\xe4\x93\x02\x37\",/v3/{parent=projects/*/locations/*}/datasets:\x07\x64\x61taset\x12\x9f\x01\n\nGetDataset\x12..google.cloud.translation.v3.GetDatasetRequest\x1a$.google.cloud.translation.v3.Dataset\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v3/{name=projects/*/locations/*/datasets/*}\x12\xb2\x01\n\x0cListDatasets\x12\x30.google.cloud.translation.v3.ListDatasetsRequest\x1a\x31.google.cloud.translation.v3.ListDatasetsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v3/{parent=projects/*/locations/*}/datasets\x12\xcf\x01\n\rDeleteDataset\x12\x31.google.cloud.translation.v3.DeleteDatasetRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41.\n\x15google.protobuf.Empty\x12\x15\x44\x65leteDatasetMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v3/{name=projects/*/locations/*/datasets/*}\x12\xf8\x01\n\x17\x43reateAdaptiveMtDataset\x12;.google.cloud.translation.v3.CreateAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"p\xda\x41\x1aparent,adaptive_mt_dataset\x82\xd3\xe4\x93\x02M\"6/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets:\x13\x61\x64\x61ptive_mt_dataset\x12\xb5\x01\n\x17\x44\x65leteAdaptiveMtDataset\x12;.google.cloud.translation.v3.DeleteAdaptiveMtDatasetRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\x12\xc7\x01\n\x14GetAdaptiveMtDataset\x12\x38.google.cloud.translation.v3.GetAdaptiveMtDatasetRequest\x1a..google.cloud.translation.v3.AdaptiveMtDataset\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*}\x12\xda\x01\n\x16ListAdaptiveMtDatasets\x12:.google.cloud.translation.v3.ListAdaptiveMtDatasetsRequest\x1a;.google.cloud.translation.v3.ListAdaptiveMtDatasetsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v3/{parent=projects/*/locations/*}/adaptiveMtDatasets\x12\xdd\x01\n\x13\x41\x64\x61ptiveMtTranslate\x12\x37.google.cloud.translation.v3.AdaptiveMtTranslateRequest\x1a\x38.google.cloud.translation.v3.AdaptiveMtTranslateResponse\"S\xda\x41\x0eparent,content\x82\xd3\xe4\x93\x02<\"7/v3/{parent=projects/*/locations/*}:adaptiveMtTranslate:\x01*\x12\xd0\x01\n\x11GetAdaptiveMtFile\x12\x35.google.cloud.translation.v3.GetAdaptiveMtFileRequest\x1a+.google.cloud.translation.v3.AdaptiveMtFile\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\x12H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\x12\xc1\x01\n\x14\x44\x65leteAdaptiveMtFile\x12\x38.google.cloud.translation.v3.DeleteAdaptiveMtFileRequest\x1a\x16.google.protobuf.Empty\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J*H/v3/{name=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}\x12\xee\x01\n\x14ImportAdaptiveMtFile\x12\x38.google.cloud.translation.v3.ImportAdaptiveMtFileRequest\x1a\x39.google.cloud.translation.v3.ImportAdaptiveMtFileResponse\"a\xda\x41\x06parent\x82\xd3\xe4\x93\x02R\"M/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}:importAdaptiveMtFile:\x01*\x12\xe3\x01\n\x13ListAdaptiveMtFiles\x12\x37.google.cloud.translation.v3.ListAdaptiveMtFilesRequest\x1a\x38.google.cloud.translation.v3.ListAdaptiveMtFilesResponse\"Y\xda\x41\x06parent\x82\xd3\xe4\x93\x02J\x12H/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtFiles\x12\xd7\x02\n\x17ListAdaptiveMtSentences\x12;.google.cloud.translation.v3.ListAdaptiveMtSentencesRequest\x1a<.google.cloud.translation.v3.ListAdaptiveMtSentencesResponse\"\xc0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb0\x01\x12^/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*/adaptiveMtFiles/*}/adaptiveMtSentencesZN\x12L/v3/{parent=projects/*/locations/*/adaptiveMtDatasets/*}/adaptiveMtSentences\x12\xe8\x01\n\nImportData\x12..google.cloud.translation.v3.ImportDataRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41+\n\x15google.protobuf.Empty\x12\x12ImportDataMetadata\xda\x41\x14\x64\x61taset,input_config\x82\xd3\xe4\x93\x02?\":/v3/{dataset=projects/*/locations/*/datasets/*}:importData:\x01*\x12\xe9\x01\n\nExportData\x12..google.cloud.translation.v3.ExportDataRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41+\n\x15google.protobuf.Empty\x12\x12\x45xportDataMetadata\xda\x41\x15\x64\x61taset,output_config\x82\xd3\xe4\x93\x02?\":/v3/{dataset=projects/*/locations/*/datasets/*}:exportData:\x01*\x12\xbd\x01\n\x0cListExamples\x12\x30.google.cloud.translation.v3.ListExamplesRequest\x1a\x31.google.cloud.translation.v3.ListExamplesResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/datasets/*}/examples\x12\xc6\x01\n\x0b\x43reateModel\x12/.google.cloud.translation.v3.CreateModelRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41\x1c\n\x05Model\x12\x13\x43reateModelMetadata\xda\x41\x0cparent,model\x82\xd3\xe4\x93\x02\x33\"*/v3/{parent=projects/*/locations/*}/models:\x05model\x12\xaa\x01\n\nListModels\x12..google.cloud.translation.v3.ListModelsRequest\x1a/.google.cloud.translation.v3.ListModelsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v3/{parent=projects/*/locations/*}/models\x12\x97\x01\n\x08GetModel\x12,.google.cloud.translation.v3.GetModelRequest\x1a\".google.cloud.translation.v3.Model\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v3/{name=projects/*/locations/*/models/*}\x12\xc7\x01\n\x0b\x44\x65leteModel\x12/.google.cloud.translation.v3.DeleteModelRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41,\n\x15google.protobuf.Empty\x12\x13\x44\x65leteModelMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v3/{name=projects/*/locations/*/models/*}\x1a~\xca\x41\x18translate.googleapis.com\xd2\x41`https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-translationB\xd6\x01\n\x1d\x63om.google.cloud.translate.v3B\x17TranslationServiceProtoP\x01Z;cloud.google.com/go/translate/apiv3/translatepb;translatepb\xa2\x02\x05\x43TRL3\xaa\x02\x19Google.Cloud.Translate.V3\xca\x02\x19Google\\Cloud\\Translate\\V3\xea\x02\x1cGoogle::Cloud::Translate::V3P\x00P\x01P\x02\x62\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"], - ["google.cloud.translation.v3.GlossaryEntry", "google/cloud/translate/v3/common.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 Translate - module V3 - TransliterationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TransliterationConfig").msgclass - TranslateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextRequest").msgclass - TranslateTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextResponse").msgclass - Translation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Translation").msgclass - RomanizeTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.RomanizeTextRequest").msgclass - Romanization = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Romanization").msgclass - RomanizeTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.RomanizeTextResponse").msgclass - DetectLanguageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectLanguageRequest").msgclass - DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectedLanguage").msgclass - DetectLanguageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DetectLanguageResponse").msgclass - GetSupportedLanguagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetSupportedLanguagesRequest").msgclass - SupportedLanguages = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.SupportedLanguages").msgclass - SupportedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.SupportedLanguage").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsSource").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.InputConfig").msgclass - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GcsDestination").msgclass - OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.OutputConfig").msgclass - DocumentInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DocumentInputConfig").msgclass - DocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DocumentOutputConfig").msgclass - TranslateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateDocumentRequest").msgclass - DocumentTranslation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DocumentTranslation").msgclass - TranslateDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateDocumentResponse").msgclass - BatchTranslateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateTextRequest").msgclass - BatchTranslateMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateMetadata").msgclass - BatchTranslateMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateMetadata.State").enummodule - BatchTranslateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateResponse").msgclass - GlossaryInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GlossaryInputConfig").msgclass - Glossary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary").msgclass - Glossary::LanguageCodePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary.LanguageCodePair").msgclass - Glossary::LanguageCodesSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.Glossary.LanguageCodesSet").msgclass - CreateGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryRequest").msgclass - UpdateGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryRequest").msgclass - GetGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetGlossaryRequest").msgclass - DeleteGlossaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryRequest").msgclass - ListGlossariesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossariesRequest").msgclass - ListGlossariesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossariesResponse").msgclass - GetGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.GetGlossaryEntryRequest").msgclass - DeleteGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryEntryRequest").msgclass - ListGlossaryEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossaryEntriesRequest").msgclass - ListGlossaryEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.ListGlossaryEntriesResponse").msgclass - CreateGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryEntryRequest").msgclass - UpdateGlossaryEntryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryEntryRequest").msgclass - CreateGlossaryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryMetadata").msgclass - CreateGlossaryMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.CreateGlossaryMetadata.State").enummodule - UpdateGlossaryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryMetadata").msgclass - UpdateGlossaryMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.UpdateGlossaryMetadata.State").enummodule - DeleteGlossaryMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryMetadata").msgclass - DeleteGlossaryMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryMetadata.State").enummodule - DeleteGlossaryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.DeleteGlossaryResponse").msgclass - BatchTranslateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentRequest").msgclass - BatchDocumentInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchDocumentInputConfig").msgclass - BatchDocumentOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchDocumentOutputConfig").msgclass - BatchTranslateDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentResponse").msgclass - BatchTranslateDocumentMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentMetadata").msgclass - BatchTranslateDocumentMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.BatchTranslateDocumentMetadata.State").enummodule - TranslateTextGlossaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.translation.v3.TranslateTextGlossaryConfig").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb deleted file mode 100644 index d7dd9d8ae961..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/translation_service_services_pb.rb +++ /dev/null @@ -1,141 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/translate/v3/translation_service.proto for package 'Google.Cloud.Translate.V3' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/translate/v3/translation_service_pb' - -module Google - module Cloud - module Translate - module V3 - module TranslationService - # Proto file for the Cloud Translation API (v3 GA). - # - # Provides natural language translation operations. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.translation.v3.TranslationService' - - # Translates input text and returns translated text. - rpc :TranslateText, ::Google::Cloud::Translate::V3::TranslateTextRequest, ::Google::Cloud::Translate::V3::TranslateTextResponse - # Romanize input text written in non-Latin scripts to Latin text. - rpc :RomanizeText, ::Google::Cloud::Translate::V3::RomanizeTextRequest, ::Google::Cloud::Translate::V3::RomanizeTextResponse - # Detects the language of text within a request. - rpc :DetectLanguage, ::Google::Cloud::Translate::V3::DetectLanguageRequest, ::Google::Cloud::Translate::V3::DetectLanguageResponse - # Returns a list of supported languages for translation. - rpc :GetSupportedLanguages, ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, ::Google::Cloud::Translate::V3::SupportedLanguages - # Translates documents in synchronous mode. - rpc :TranslateDocument, ::Google::Cloud::Translate::V3::TranslateDocumentRequest, ::Google::Cloud::Translate::V3::TranslateDocumentResponse - # Translates a large volume of text in asynchronous batch mode. - # This function provides real-time output as the inputs are being processed. - # If caller cancels a request, the partial results (for an input file, it's - # all or nothing) may still be available on the specified output location. - # - # This call returns immediately and you can - # use google.longrunning.Operation.name to poll the status of the call. - rpc :BatchTranslateText, ::Google::Cloud::Translate::V3::BatchTranslateTextRequest, ::Google::Longrunning::Operation - # Translates a large volume of document in asynchronous batch mode. - # This function provides real-time output as the inputs are being processed. - # If caller cancels a request, the partial results (for an input file, it's - # all or nothing) may still be available on the specified output location. - # - # This call returns immediately and you can use - # google.longrunning.Operation.name to poll the status of the call. - rpc :BatchTranslateDocument, ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, ::Google::Longrunning::Operation - # Creates a glossary and returns the long-running operation. Returns - # NOT_FOUND, if the project doesn't exist. - rpc :CreateGlossary, ::Google::Cloud::Translate::V3::CreateGlossaryRequest, ::Google::Longrunning::Operation - # Updates a glossary. A LRO is used since the update can be async if the - # glossary's entry file is updated. - rpc :UpdateGlossary, ::Google::Cloud::Translate::V3::UpdateGlossaryRequest, ::Google::Longrunning::Operation - # Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't - # exist. - rpc :ListGlossaries, ::Google::Cloud::Translate::V3::ListGlossariesRequest, ::Google::Cloud::Translate::V3::ListGlossariesResponse - # Gets a glossary. Returns NOT_FOUND, if the glossary doesn't - # exist. - rpc :GetGlossary, ::Google::Cloud::Translate::V3::GetGlossaryRequest, ::Google::Cloud::Translate::V3::Glossary - # Deletes a glossary, or cancels glossary construction - # if the glossary isn't created yet. - # Returns NOT_FOUND, if the glossary doesn't exist. - rpc :DeleteGlossary, ::Google::Cloud::Translate::V3::DeleteGlossaryRequest, ::Google::Longrunning::Operation - # Gets a single glossary entry by the given id. - rpc :GetGlossaryEntry, ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, ::Google::Cloud::Translate::V3::GlossaryEntry - # List the entries for the glossary. - rpc :ListGlossaryEntries, ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse - # Creates a glossary entry. - rpc :CreateGlossaryEntry, ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, ::Google::Cloud::Translate::V3::GlossaryEntry - # Updates a glossary entry. - rpc :UpdateGlossaryEntry, ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, ::Google::Cloud::Translate::V3::GlossaryEntry - # Deletes a single entry from the glossary - rpc :DeleteGlossaryEntry, ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, ::Google::Protobuf::Empty - # Creates a Dataset. - rpc :CreateDataset, ::Google::Cloud::Translate::V3::CreateDatasetRequest, ::Google::Longrunning::Operation - # Gets a Dataset. - rpc :GetDataset, ::Google::Cloud::Translate::V3::GetDatasetRequest, ::Google::Cloud::Translate::V3::Dataset - # Lists datasets. - rpc :ListDatasets, ::Google::Cloud::Translate::V3::ListDatasetsRequest, ::Google::Cloud::Translate::V3::ListDatasetsResponse - # Deletes a dataset and all of its contents. - rpc :DeleteDataset, ::Google::Cloud::Translate::V3::DeleteDatasetRequest, ::Google::Longrunning::Operation - # Creates an Adaptive MT dataset. - rpc :CreateAdaptiveMtDataset, ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, ::Google::Cloud::Translate::V3::AdaptiveMtDataset - # Deletes an Adaptive MT dataset, including all its entries and associated - # metadata. - rpc :DeleteAdaptiveMtDataset, ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, ::Google::Protobuf::Empty - # Gets the Adaptive MT dataset. - rpc :GetAdaptiveMtDataset, ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, ::Google::Cloud::Translate::V3::AdaptiveMtDataset - # Lists all Adaptive MT datasets for which the caller has read permission. - rpc :ListAdaptiveMtDatasets, ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse - # Translate text using Adaptive MT. - rpc :AdaptiveMtTranslate, ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse - # Gets and AdaptiveMtFile - rpc :GetAdaptiveMtFile, ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, ::Google::Cloud::Translate::V3::AdaptiveMtFile - # Deletes an AdaptiveMtFile along with its sentences. - rpc :DeleteAdaptiveMtFile, ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, ::Google::Protobuf::Empty - # Imports an AdaptiveMtFile and adds all of its sentences into the - # AdaptiveMtDataset. - rpc :ImportAdaptiveMtFile, ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse - # Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset. - rpc :ListAdaptiveMtFiles, ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse - # Lists all AdaptiveMtSentences under a given file/dataset. - rpc :ListAdaptiveMtSentences, ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse - # Import sentence pairs into translation Dataset. - rpc :ImportData, ::Google::Cloud::Translate::V3::ImportDataRequest, ::Google::Longrunning::Operation - # Exports dataset's data to the provided output location. - rpc :ExportData, ::Google::Cloud::Translate::V3::ExportDataRequest, ::Google::Longrunning::Operation - # Lists sentence pairs in the dataset. - rpc :ListExamples, ::Google::Cloud::Translate::V3::ListExamplesRequest, ::Google::Cloud::Translate::V3::ListExamplesResponse - # Creates a Model. - rpc :CreateModel, ::Google::Cloud::Translate::V3::CreateModelRequest, ::Google::Longrunning::Operation - # Lists models. - rpc :ListModels, ::Google::Cloud::Translate::V3::ListModelsRequest, ::Google::Cloud::Translate::V3::ListModelsResponse - # Gets a model. - rpc :GetModel, ::Google::Cloud::Translate::V3::GetModelRequest, ::Google::Cloud::Translate::V3::Model - # Deletes a model. - rpc :DeleteModel, ::Google::Cloud::Translate::V3::DeleteModelRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb b/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb deleted file mode 100644 index dacb619abd34..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/lib/google/cloud/translate/v3/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md b/owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md deleted file mode 100644 index 4a5eb6a2d169..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Translation V3 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-translate-v3/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb deleted file mode 100644 index 9c20fdd4d804..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/adaptive_mt.rb +++ /dev/null @@ -1,405 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - # An Adaptive MT Dataset. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the dataset, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset_id}` - # @!attribute [rw] display_name - # @return [::String] - # The name of the dataset to show in the interface. The name can be - # up to 32 characters long and can consist only of ASCII Latin letters A-Z - # and a-z, underscores (_), and ASCII digits 0-9. - # @!attribute [rw] source_language_code - # @return [::String] - # The BCP-47 language code of the source language. - # @!attribute [rw] target_language_code - # @return [::String] - # The BCP-47 language code of the target language. - # @!attribute [rw] example_count - # @return [::Integer] - # The number of examples in the dataset. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this dataset was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this dataset was last updated. - class AdaptiveMtDataset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - #  Request message for creating an AdaptiveMtDataset. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @!attribute [rw] adaptive_mt_dataset - # @return [::Google::Cloud::Translate::V3::AdaptiveMtDataset] - # Required. The AdaptiveMtDataset to be created. - class CreateAdaptiveMtDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting an AdaptiveMtDataset. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the dataset. In the form of - # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` - class DeleteAdaptiveMtDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting an Adaptive MT dataset. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the dataset. In the form of - # `projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}` - class GetAdaptiveMtDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing all Adaptive MT datasets that the requestor has - # access to. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project from which to list the Adaptive - # MT datasets. `projects/{project-number-or-id}/locations/{location-id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server may return fewer results than - # requested. If unspecified, the server picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtDatasetsResponse.next_page_token returned from the - # previous call to `ListAdaptiveMtDatasets` method. The first page is - # returned if `page_token`is empty or missing. - # @!attribute [rw] filter - # @return [::String] - # Optional. An expression for filtering the results of the request. - # Filter is not supported yet. - class ListAdaptiveMtDatasetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of AdaptiveMtDatasets. - # @!attribute [r] adaptive_mt_datasets - # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtDataset>] - # Output only. A list of Adaptive MT datasets. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. A token to retrieve a page of results. Pass this value in the - # [ListAdaptiveMtDatasetsRequest.page_token] field in the subsequent call to - # `ListAdaptiveMtDatasets` method to retrieve the next page of results. - class ListAdaptiveMtDatasetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for sending an AdaptiveMt translation query. - # @!attribute [rw] parent - # @return [::String] - # Required. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # @!attribute [rw] dataset - # @return [::String] - # Required. The resource name for the dataset to use for adaptive MT. - # `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}` - # @!attribute [rw] content - # @return [::Array<::String>] - # Required. The content of the input in string format. - # @!attribute [rw] reference_sentence_config - # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig] - # Configuration for caller provided reference sentences. - # @!attribute [rw] glossary_config - # @return [::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig] - # Optional. Glossary to be applied. The glossary must be - # within the same region (have the same location-id) as the model, otherwise - # an INVALID_ARGUMENT (400) error is returned. - class AdaptiveMtTranslateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A pair of sentences used as reference in source and target languages. - # @!attribute [rw] source_sentence - # @return [::String] - # Source sentence in the sentence pair. - # @!attribute [rw] target_sentence - # @return [::String] - # Target sentence in the sentence pair. - class ReferenceSentencePair - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of reference sentence pairs. - # @!attribute [rw] reference_sentence_pairs - # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentencePair>] - # Reference sentence pairs. - class ReferenceSentencePairList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message of caller-provided reference configuration. - # @!attribute [rw] reference_sentence_pair_lists - # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentencePairList>] - # Reference sentences pair lists. Each list will be used as the references - # to translate the sentence under "content" field at the corresponding - # index. Length of the list is required to be equal to the length of - # "content" field. - # @!attribute [rw] source_language_code - # @return [::String] - # Source language code. - # @!attribute [rw] target_language_code - # @return [::String] - # Target language code. - class ReferenceSentenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configures which glossary is used for a specific target language and - # defines - # options for applying that glossary. - # @!attribute [rw] glossary - # @return [::String] - # Required. The `glossary` to be applied for this translation. - # - # The format depends on the glossary: - # - # - User-provided custom glossary: - # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` - # @!attribute [rw] ignore_case - # @return [::Boolean] - # Optional. Indicates match is case insensitive. The default value is - # `false` if missing. - # @!attribute [rw] contextual_translation_enabled - # @return [::Boolean] - # Optional. If set to true, the glossary will be used for contextual - # translation. - class GlossaryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # An AdaptiveMt translation. - # @!attribute [r] translated_text - # @return [::String] - # Output only. The translated text. - class AdaptiveMtTranslation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AdaptiveMtTranslate response. - # @!attribute [r] translations - # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslation>] - # Output only. The translation. - # @!attribute [r] language_code - # @return [::String] - # Output only. The translation's language code. - # @!attribute [rw] glossary_translations - # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtTranslation>] - # Text translation response if a glossary is provided in the request. This - # could be the same as 'translation' above if no terms apply. - class AdaptiveMtTranslateResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AdaptiveMtFile. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # @!attribute [rw] display_name - # @return [::String] - # The file's display name. - # @!attribute [rw] entry_count - # @return [::Integer] - # The number of entries that the file contains. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this file was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this file was last updated. - class AdaptiveMtFile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for getting an AdaptiveMtFile. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - class GetAdaptiveMtFileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for deleting an AdaptiveMt file. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the file to delete, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - class DeleteAdaptiveMtFileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for importing an AdaptiveMt file along with its sentences. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}` - # @!attribute [rw] file_input_source - # @return [::Google::Cloud::Translate::V3::FileInputSource] - # Inline file source. - # - # Note: The following fields are mutually exclusive: `file_input_source`, `gcs_input_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_input_source - # @return [::Google::Cloud::Translate::V3::GcsInputSource] - # Google Cloud Storage file source. - # - # Note: The following fields are mutually exclusive: `gcs_input_source`, `file_input_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ImportAdaptiveMtFileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for importing an AdaptiveMtFile - # @!attribute [r] adaptive_mt_file - # @return [::Google::Cloud::Translate::V3::AdaptiveMtFile] - # Output only. The Adaptive MT file that was imported. - class ImportAdaptiveMtFileResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to list all AdaptiveMt files under a given dataset. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project from which to list the Adaptive - # MT files. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtFilesResponse.next_page_token returned from the - # previous call to `ListAdaptiveMtFiles` method. The first page is - # returned if `page_token`is empty or missing. - class ListAdaptiveMtFilesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for listing all AdaptiveMt files under a given dataset. - # @!attribute [r] adaptive_mt_files - # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtFile>] - # Output only. The Adaptive MT files. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. A token to retrieve a page of results. Pass this value in the - # ListAdaptiveMtFilesRequest.page_token field in the subsequent call to - # `ListAdaptiveMtFiles` method to retrieve the next page of results. - class ListAdaptiveMtFilesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An AdaptiveMt sentence entry. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the file, in form of - # `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}` - # @!attribute [rw] source_sentence - # @return [::String] - # Required. The source sentence. - # @!attribute [rw] target_sentence - # @return [::String] - # Required. The target sentence. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this sentence was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this sentence was last updated. - class AdaptiveMtSentence - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request for listing Adaptive MT sentences from a Dataset/File. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project from which to list the Adaptive - # MT files. The following format lists all sentences under a file. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}` - # The following format lists all sentences within a dataset. - # `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}` - # @!attribute [rw] page_size - # @return [::Integer] - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # Typically, this is the value of - # ListAdaptiveMtSentencesRequest.next_page_token returned from the - # previous call to `ListTranslationMemories` method. The first page is - # returned if `page_token` is empty or missing. - class ListAdaptiveMtSentencesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List AdaptiveMt sentences response. - # @!attribute [r] adaptive_mt_sentences - # @return [::Array<::Google::Cloud::Translate::V3::AdaptiveMtSentence>] - # Output only. The list of AdaptiveMtSentences. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. - class ListAdaptiveMtSentencesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb deleted file mode 100644 index 0c1912d9abd3..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/automl_translation.rb +++ /dev/null @@ -1,487 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - # Request message for ImportData. - # @!attribute [rw] dataset - # @return [::String] - # Required. Name of the dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @!attribute [rw] input_config - # @return [::Google::Cloud::Translate::V3::DatasetInputConfig] - # Required. The config for the input content. - class ImportDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input configuration for datasets. - # @!attribute [rw] input_files - # @return [::Array<::Google::Cloud::Translate::V3::DatasetInputConfig::InputFile>] - # Files containing the sentence pairs to be imported to the dataset. - class DatasetInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An input file. - # @!attribute [rw] usage - # @return [::String] - # Optional. Usage of the file contents. Options are TRAIN|VALIDATION|TEST, - # or UNASSIGNED (by default) for auto split. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Translate::V3::GcsInputSource] - # Google Cloud Storage file source. - class InputFile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata of import data operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::OperationState] - # The current state of the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Only populated when operation doesn't succeed. - class ImportDataMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ExportData. - # @!attribute [rw] dataset - # @return [::String] - # Required. Name of the dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @!attribute [rw] output_config - # @return [::Google::Cloud::Translate::V3::DatasetOutputConfig] - # Required. The config for the output content. - class ExportDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configuration for datasets. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Translate::V3::GcsOutputDestination] - # Google Cloud Storage destination to write the output. - class DatasetOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of export data operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::OperationState] - # The current state of the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Only populated when operation doesn't succeed. - class ExportDataMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteDataset. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the dataset to delete. - class DeleteDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of delete dataset operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::OperationState] - # The current state of the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Only populated when operation doesn't succeed. - class DeleteDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetDataset. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the dataset to retrieve. - class GetDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListDatasets. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListDatasets call. - class ListDatasetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListDatasets. - # @!attribute [rw] datasets - # @return [::Array<::Google::Cloud::Translate::V3::Dataset>] - # The datasets read. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # Pass this token to the page_token field in the ListDatasetsRequest to - # obtain the corresponding page. - class ListDatasetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateDataset. - # @!attribute [rw] parent - # @return [::String] - # Required. The project name. - # @!attribute [rw] dataset - # @return [::Google::Cloud::Translate::V3::Dataset] - # Required. The Dataset to create. - class CreateDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of create dataset operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::OperationState] - # The current state of the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Only populated when operation doesn't succeed. - class CreateDatasetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListExamples. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent dataset. In form of - # `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}` - # @!attribute [rw] filter - # @return [::String] - # Optional. An expression for filtering the examples that will be returned. - # Example filter: - # * `usage=TRAIN` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListExamples call. - class ListExamplesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListExamples. - # @!attribute [rw] examples - # @return [::Array<::Google::Cloud::Translate::V3::Example>] - # The sentence pairs. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # Pass this token to the page_token field in the ListExamplesRequest to - # obtain the corresponding page. - class ListExamplesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A sentence pair. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the example, in form of - # `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}/examples/{example_id}` - # @!attribute [rw] source_text - # @return [::String] - # Sentence in source language. - # @!attribute [rw] target_text - # @return [::String] - # Sentence in target language. - # @!attribute [r] usage - # @return [::String] - # Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST. - class Example - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for BatchTransferResources. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Translate::V3::BatchTransferResourcesResponse::TransferResourceResponse>] - # Responses of the transfer for individual resources. - class BatchTransferResourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Transfer response for a single resource. - # @!attribute [rw] source - # @return [::String] - # Full name of the resource to transfer as specified in the request. - # @!attribute [rw] target - # @return [::String] - # Full name of the new resource successfully transferred from the source - # hosted by Translation API. Target will be empty if the transfer failed. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result in case of failure. - class TransferResourceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A dataset that hosts the examples (sentence pairs) used for translation - # models. - # @!attribute [rw] name - # @return [::String] - # The resource name of the dataset, in form of - # `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}` - # @!attribute [rw] display_name - # @return [::String] - # The name of the dataset to show in the interface. The name can be - # up to 32 characters long and can consist only of ASCII Latin letters A-Z - # and a-z, underscores (_), and ASCII digits 0-9. - # @!attribute [rw] source_language_code - # @return [::String] - # The BCP-47 language code of the source language. - # @!attribute [rw] target_language_code - # @return [::String] - # The BCP-47 language code of the target language. - # @!attribute [r] example_count - # @return [::Integer] - # Output only. The number of examples in the dataset. - # @!attribute [r] train_example_count - # @return [::Integer] - # Output only. Number of training examples (sentence pairs). - # @!attribute [r] validate_example_count - # @return [::Integer] - # Output only. Number of validation examples (sentence pairs). - # @!attribute [r] test_example_count - # @return [::Integer] - # Output only. Number of test examples (sentence pairs). - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this dataset was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this dataset was last updated. - class Dataset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateModel. - # @!attribute [rw] parent - # @return [::String] - # Required. The project name, in form of - # `projects/{project}/locations/{location}` - # @!attribute [rw] model - # @return [::Google::Cloud::Translate::V3::Model] - # Required. The Model to create. - class CreateModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of create model operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::OperationState] - # The current state of the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Only populated when operation doesn't succeed. - class CreateModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListModels. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the parent project. In form of - # `projects/{project-number-or-id}/locations/{location-id}` - # @!attribute [rw] filter - # @return [::String] - # Optional. An expression for filtering the models that will be returned. - # Supported filter: - # `dataset_id=${dataset_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server can return fewer results than - # requested. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results for the server to return. - # Typically obtained from next_page_token field in the response of a - # ListModels call. - class ListModelsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListModels. - # @!attribute [rw] models - # @return [::Array<::Google::Cloud::Translate::V3::Model>] - # The models read. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # Pass this token to the page_token field in the ListModelsRequest to - # obtain the corresponding page. - class ListModelsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetModel. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the model to retrieve. - class GetModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteModel. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the model to delete. - class DeleteModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata of delete model operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::OperationState] - # The current state of the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The last update time of the operation. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Only populated when operation doesn't succeed. - class DeleteModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A trained translation model. - # @!attribute [rw] name - # @return [::String] - # The resource name of the model, in form of - # `projects/{project-number-or-id}/locations/{location_id}/models/{model_id}` - # @!attribute [rw] display_name - # @return [::String] - # The name of the model to show in the interface. The name can be - # up to 32 characters long and can consist only of ASCII Latin letters A-Z - # and a-z, underscores (_), and ASCII digits 0-9. - # @!attribute [rw] dataset - # @return [::String] - # The dataset from which the model is trained, in form of - # `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}` - # @!attribute [r] source_language_code - # @return [::String] - # Output only. The BCP-47 language code of the source language. - # @!attribute [r] target_language_code - # @return [::String] - # Output only. The BCP-47 language code of the target language. - # @!attribute [r] train_example_count - # @return [::Integer] - # Output only. Number of examples (sentence pairs) used to train the model. - # @!attribute [r] validate_example_count - # @return [::Integer] - # Output only. Number of examples (sentence pairs) used to validate the - # model. - # @!attribute [r] test_example_count - # @return [::Integer] - # Output only. Number of examples (sentence pairs) used to test the model. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the model resource was created, which is also - # when the training started. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when this model was last updated. - class Model - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb deleted file mode 100644 index 2309b07edac1..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/common.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - # The Google Cloud Storage location for the input content. - # @!attribute [rw] input_uri - # @return [::String] - # Required. Source data URI. For example, `gs://my_bucket/my_object`. - class GcsInputSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An inlined file. - # @!attribute [rw] mime_type - # @return [::String] - # Required. The file's mime type. - # @!attribute [rw] content - # @return [::String] - # Required. The file's byte contents. - # @!attribute [rw] display_name - # @return [::String] - # Required. The file's display name. - class FileInputSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location for the output content. - # @!attribute [rw] output_uri_prefix - # @return [::String] - # Required. Google Cloud Storage URI to output directory. For example, - # `gs://bucket/directory`. The requesting user must have write permission to - # the bucket. The directory will be created if it doesn't exist. - class GcsOutputDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a single entry in a glossary. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the entry. - # Format: - # `projects/*/locations/*/glossaries/*/glossaryEntries/*` - # @!attribute [rw] terms_pair - # @return [::Google::Cloud::Translate::V3::GlossaryEntry::GlossaryTermsPair] - # Used for an unidirectional glossary. - # - # Note: The following fields are mutually exclusive: `terms_pair`, `terms_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] terms_set - # @return [::Google::Cloud::Translate::V3::GlossaryEntry::GlossaryTermsSet] - # Used for an equivalent term sets glossary. - # - # Note: The following fields are mutually exclusive: `terms_set`, `terms_pair`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] description - # @return [::String] - # Describes the glossary entry. - class GlossaryEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a single entry for an unidirectional glossary. - # @!attribute [rw] source_term - # @return [::Google::Cloud::Translate::V3::GlossaryTerm] - # The source term is the term that will get match in the text, - # @!attribute [rw] target_term - # @return [::Google::Cloud::Translate::V3::GlossaryTerm] - # The term that will replace the match source term. - class GlossaryTermsPair - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a single entry for an equivalent term set glossary. This is used - # for equivalent term sets where each term can be replaced by the other terms - # in the set. - # @!attribute [rw] terms - # @return [::Array<::Google::Cloud::Translate::V3::GlossaryTerm>] - # Each term in the set represents a term that can be replaced by the other - # terms. - class GlossaryTermsSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents a single glossary term - # @!attribute [rw] language_code - # @return [::String] - # The language for this glossary term. - # @!attribute [rw] text - # @return [::String] - # The text for the glossary term. - class GlossaryTerm - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible states of long running operations. - module OperationState - # Invalid. - OPERATION_STATE_UNSPECIFIED = 0 - - # Request is being processed. - OPERATION_STATE_RUNNING = 1 - - # The operation was successful. - OPERATION_STATE_SUCCEEDED = 2 - - # Failed to process operation. - OPERATION_STATE_FAILED = 3 - - # Request is in the process of being canceled after caller invoked - # longrunning.Operations.CancelOperation on the request id. - OPERATION_STATE_CANCELLING = 4 - - # The operation request was successfully canceled. - OPERATION_STATE_CANCELLED = 5 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb deleted file mode 100644 index 314073d5ff59..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/cloud/translate/v3/translation_service.rb +++ /dev/null @@ -1,1657 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - module V3 - # Configures transliteration feature on top of translation. - # @!attribute [rw] enable_transliteration - # @return [::Boolean] - # If true, source text in romanized form can be translated to the target - # language. - class TransliterationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for synchronous translation. - # @!attribute [rw] contents - # @return [::Array<::String>] - # Required. The content of the input in string format. - # We recommend the total content be less than 30,000 codepoints. The max - # length of this field is 1024. Use BatchTranslateText for larger text. - # @!attribute [rw] mime_type - # @return [::String] - # Optional. The format of the source text, for example, "text/html", - # "text/plain". If left blank, the MIME type defaults to "text/html". - # @!attribute [rw] source_language_code - # @return [::String] - # Optional. The ISO-639 language code of the input text if - # known, for example, "en-US" or "sr-Latn". Supported language codes are - # listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). If the source - # language isn't specified, the API attempts to identify the source language - # automatically and returns the source language within the response. - # @!attribute [rw] target_language_code - # @return [::String] - # Required. The ISO-639 language code to use for translation of the input - # text, set to one of the language codes listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @!attribute [rw] parent - # @return [::String] - # Required. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}` or - # `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for requests using AutoML models or - # custom glossaries. - # - # Models and glossaries must be within the same region (have same - # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - # @!attribute [rw] model - # @return [::String] - # Optional. The `model` type requested for this translation. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - Translation LLM models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm`, - # - # For global (non-regionalized) requests, use `location-id` `global`. - # For example, - # `projects/{project-number-or-id}/locations/global/models/general/nmt`. - # - # If not provided, the default Google model (NMT) will be used - # @!attribute [rw] glossary_config - # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] - # Optional. Glossary to be applied. The glossary must be - # within the same region (have the same location-id) as the model, otherwise - # an INVALID_ARGUMENT (400) error is returned. - # @!attribute [rw] transliteration_config - # @return [::Google::Cloud::Translate::V3::TransliterationConfig] - # Optional. Transliteration to be applied. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - class TranslateTextRequest - 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 - - # @!attribute [rw] translations - # @return [::Array<::Google::Cloud::Translate::V3::Translation>] - # Text translation responses with no glossary applied. - # This field has the same length as - # {::Google::Cloud::Translate::V3::TranslateTextRequest#contents `contents`}. - # @!attribute [rw] glossary_translations - # @return [::Array<::Google::Cloud::Translate::V3::Translation>] - # Text translation responses if a glossary is provided in the request. - # This can be the same as - # {::Google::Cloud::Translate::V3::TranslateTextResponse#translations `translations`} - # if no terms apply. This field has the same length as - # {::Google::Cloud::Translate::V3::TranslateTextRequest#contents `contents`}. - class TranslateTextResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single translation response. - # @!attribute [rw] translated_text - # @return [::String] - # Text translated into the target language. - # If an error occurs during translation, this field might be excluded from - # the response. - # @!attribute [rw] model - # @return [::String] - # Only present when `model` is present in the request. - # `model` here is normalized to have project number. - # - # For example: - # If the `model` requested in TranslationTextRequest is - # `projects/{project-id}/locations/{location-id}/models/general/nmt` then - # `model` here would be normalized to - # `projects/{project-number}/locations/{location-id}/models/general/nmt`. - # @!attribute [rw] detected_language_code - # @return [::String] - # The ISO-639 language code of source text in the initial request, detected - # automatically, if no source language was passed within the initial - # request. If the source language was passed, auto-detection of the language - # does not occur and this field is empty. - # @!attribute [rw] glossary_config - # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] - # The `glossary_config` used for this translation. - class Translation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for synchronous romanization. - # @!attribute [rw] parent - # @return [::String] - # Required. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}` or - # `projects/{project-number-or-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # @!attribute [rw] contents - # @return [::Array<::String>] - # Required. The content of the input in string format. - # @!attribute [rw] source_language_code - # @return [::String] - # Optional. The ISO-639 language code of the input text if - # known, for example, "hi" or "zh". Supported language codes are - # listed in [Language - # Support](https://cloud.google.com/translate/docs/languages#roman). If the - # source language isn't specified, the API attempts to identify the source - # language automatically and returns the source language for each content in - # the response. - class RomanizeTextRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single romanization response. - # @!attribute [rw] romanized_text - # @return [::String] - # Romanized text. - # If an error occurs during romanization, this field might be excluded from - # the response. - # @!attribute [rw] detected_language_code - # @return [::String] - # The ISO-639 language code of source text in the initial request, detected - # automatically, if no source language was passed within the initial - # request. If the source language was passed, auto-detection of the language - # does not occur and this field is empty. - class Romanization - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for synchronous romanization. - # @!attribute [rw] romanizations - # @return [::Array<::Google::Cloud::Translate::V3::Romanization>] - # Text romanization responses. - # This field has the same length as - # {::Google::Cloud::Translate::V3::RomanizeTextRequest#contents `contents`}. - class RomanizeTextResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for language detection. - # @!attribute [rw] parent - # @return [::String] - # Required. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}` or - # `projects/{project-number-or-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Only models within the same region (has same location-id) can be used. - # Otherwise an INVALID_ARGUMENT (400) error is returned. - # @!attribute [rw] model - # @return [::String] - # Optional. The language detection model to be used. - # - # Format: - # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}` - # - # Only one language detection model is currently supported: - # `projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default`. - # - # If not specified, the default model is used. - # @!attribute [rw] content - # @return [::String] - # The content of the input stored as a string. - # @!attribute [rw] mime_type - # @return [::String] - # Optional. The format of the source text, for example, "text/html", - # "text/plain". If left blank, the MIME type defaults to "text/html". - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - class DetectLanguageRequest - 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 response message for language detection. - # @!attribute [rw] language_code - # @return [::String] - # The ISO-639 language code of the source content in the request, detected - # automatically. - # @!attribute [rw] confidence - # @return [::Float] - # The confidence of the detection result for this language. - class DetectedLanguage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for language detection. - # @!attribute [rw] languages - # @return [::Array<::Google::Cloud::Translate::V3::DetectedLanguage>] - # The most probable language detected by the Translation API. For each - # request, the Translation API will always return only one result. - class DetectLanguageResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for discovering supported languages. - # @!attribute [rw] parent - # @return [::String] - # Required. Project or location to make a call. Must refer to a caller's - # project. - # - # Format: `projects/{project-number-or-id}` or - # `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for AutoML models. - # - # Only models within the same region (have same location-id) can be used, - # otherwise an INVALID_ARGUMENT (400) error is returned. - # @!attribute [rw] display_language_code - # @return [::String] - # Optional. The language to use to return localized, human readable names - # of supported languages. If missing, then display names are not returned - # in a response. - # @!attribute [rw] model - # @return [::String] - # Optional. Get supported languages of this model. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # Returns languages supported by the specified model. - # If missing, we get supported languages of Google general NMT model. - class GetSupportedLanguagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for discovering supported languages. - # @!attribute [rw] languages - # @return [::Array<::Google::Cloud::Translate::V3::SupportedLanguage>] - # A list of supported language responses. This list contains an entry - # for each language the Translation API supports. - class SupportedLanguages - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single supported language response corresponds to information related - # to one supported language. - # @!attribute [rw] language_code - # @return [::String] - # Supported language code, generally consisting of its ISO 639-1 - # identifier, for example, 'en', 'ja'. In certain cases, ISO-639 codes - # including language and region identifiers are returned (for example, - # 'zh-TW' and 'zh-CN'). - # @!attribute [rw] display_name - # @return [::String] - # Human-readable name of the language localized in the display language - # specified in the request. - # @!attribute [rw] support_source - # @return [::Boolean] - # Can be used as a source language. - # @!attribute [rw] support_target - # @return [::Boolean] - # Can be used as a target language. - class SupportedLanguage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location for the input content. - # @!attribute [rw] input_uri - # @return [::String] - # Required. Source data URI. For example, `gs://my_bucket/my_object`. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input configuration for BatchTranslateText request. - # @!attribute [rw] mime_type - # @return [::String] - # Optional. Can be "text/plain" or "text/html". - # For `.tsv`, "text/html" is used if mime_type is missing. - # For `.html`, this field must be "text/html" or empty. - # For `.txt`, this field must be "text/plain" or empty. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Translate::V3::GcsSource] - # Required. Google Cloud Storage location for the source input. - # This can be a single file (for example, - # `gs://translation-test/input.tsv`) or a wildcard (for example, - # `gs://translation-test/*`). If a file extension is `.tsv`, it can - # contain either one or two columns. The first column (optional) is the id - # of the text request. If the first column is missing, we use the row - # number (0-based) from the input file as the ID in the output file. The - # second column is the actual text to be - # translated. We recommend each row be <= 10K Unicode codepoints, - # otherwise an error might be returned. - # Note that the input tsv must be RFC 4180 compliant. - # - # You could use https://github.com/Clever/csvlint to check potential - # formatting errors in your tsv file. - # csvlint --delimiter='\t' your_input_file.tsv - # - # The other supported file extensions are `.txt` or `.html`, which is - # treated as a single large chunk of text. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location for the output content. - # @!attribute [rw] output_uri_prefix - # @return [::String] - # Required. The bucket used in 'output_uri_prefix' must exist and there must - # be no files under 'output_uri_prefix'. 'output_uri_prefix' must end with - # "/" and start with "gs://". One 'output_uri_prefix' can only be used by one - # batch translation job at a time. Otherwise an INVALID_ARGUMENT (400) error - # is returned. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configuration for BatchTranslateText request. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Translate::V3::GcsDestination] - # Google Cloud Storage destination for output content. - # For every single input file (for example, gs://a/b/c.[extension]), we - # generate at most 2 * n output files. (n is the # of target_language_codes - # in the BatchTranslateTextRequest). - # - # Output files (tsv) generated are compliant with RFC 4180 except that - # record delimiters are '\n' instead of '\r\n'. We don't provide any way to - # change record delimiters. - # - # While the input files are being processed, we write/update an index file - # 'index.csv' under 'output_uri_prefix' (for example, - # gs://translation-test/index.csv) The index file is generated/updated as - # new files are being translated. The format is: - # - # input_file,target_language_code,translations_file,errors_file, - # glossary_translations_file,glossary_errors_file - # - # input_file is one file we matched using gcs_source.input_uri. - # target_language_code is provided in the request. - # translations_file contains the translations. (details provided below) - # errors_file contains the errors during processing of the file. (details - # below). Both translations_file and errors_file could be empty - # strings if we have no content to output. - # glossary_translations_file and glossary_errors_file are always empty - # strings if the input_file is tsv. They could also be empty if we have no - # content to output. - # - # Once a row is present in index.csv, the input/output matching never - # changes. Callers should also expect all the content in input_file are - # processed and ready to be consumed (that is, no partial output file is - # written). - # - # Since index.csv will be keeping updated during the process, please make - # sure there is no custom retention policy applied on the output bucket - # that may avoid file updating. - # (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) - # - # The format of translations_file (for target language code 'trg') is: - # `gs://translation_test/a_b_c_'trg'_translations.[extension]` - # - # If the input file extension is tsv, the output has the following - # columns: - # Column 1: ID of the request provided in the input, if it's not - # provided in the input, then the input row number is used (0-based). - # Column 2: source sentence. - # Column 3: translation without applying a glossary. Empty string if there - # is an error. - # Column 4 (only present if a glossary is provided in the request): - # translation after applying the glossary. Empty string if there is an - # error applying the glossary. Could be same string as column 3 if there is - # no glossary applied. - # - # If input file extension is a txt or html, the translation is directly - # written to the output file. If glossary is requested, a separate - # glossary_translations_file has format of - # `gs://translation_test/a_b_c_'trg'_glossary_translations.[extension]` - # - # The format of errors file (for target language code 'trg') is: - # `gs://translation_test/a_b_c_'trg'_errors.[extension]` - # - # If the input file extension is tsv, errors_file contains the following: - # Column 1: ID of the request provided in the input, if it's not - # provided in the input, then the input row number is used (0-based). - # Column 2: source sentence. - # Column 3: Error detail for the translation. Could be empty. - # Column 4 (only present if a glossary is provided in the request): - # Error when applying the glossary. - # - # If the input file extension is txt or html, glossary_error_file will be - # generated that contains error details. glossary_error_file has format of - # `gs://translation_test/a_b_c_'trg'_glossary_errors.[extension]` - class OutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A document translation request input config. - # @!attribute [rw] content - # @return [::String] - # Document's content represented as a stream of bytes. - # - # Note: The following fields are mutually exclusive: `content`, `gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Translate::V3::GcsSource] - # Google Cloud Storage location. This must be a single file. - # For example: gs://example_bucket/example_file.pdf - # - # Note: The following fields are mutually exclusive: `gcs_source`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] mime_type - # @return [::String] - # Specifies the input document's mime_type. - # - # If not specified it will be determined using the file extension for - # gcs_source provided files. For a file provided through bytes content the - # mime_type must be provided. - # Currently supported mime types are: - # - application/pdf - # - application/vnd.openxmlformats-officedocument.wordprocessingml.document - # - application/vnd.openxmlformats-officedocument.presentationml.presentation - # - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - class DocumentInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A document translation request output config. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Translate::V3::GcsDestination] - # Optional. Google Cloud Storage destination for the translation output, - # e.g., `gs://my_bucket/my_directory/`. - # - # The destination directory provided does not have to be empty, but the - # bucket must exist. If a file with the same name as the output file - # already exists in the destination an error will be returned. - # - # For a DocumentInputConfig.contents provided document, the output file - # will have the name "output_[trg]_translations.[ext]", where - # - [trg] corresponds to the translated file's language code, - # - [ext] corresponds to the translated file's extension according to its - # mime type. - # - # - # For a DocumentInputConfig.gcs_uri provided document, the output file will - # have a name according to its URI. For example: an input file with URI: - # `gs://a/b/c.[extension]` stored in a gcs_destination bucket with name - # "my_bucket" will have an output URI: - # `gs://my_bucket/a_b_c_[trg]_translations.[ext]`, where - # - [trg] corresponds to the translated file's language code, - # - [ext] corresponds to the translated file's extension according to its - # mime type. - # - # - # If the document was directly provided through the request, then the - # output document will have the format: - # `gs://my_bucket/translated_document_[trg]_translations.[ext]`, where - # - [trg] corresponds to the translated file's language code, - # - [ext] corresponds to the translated file's extension according to its - # mime type. - # - # If a glossary was provided, then the output URI for the glossary - # translation will be equal to the default output URI but have - # `glossary_translations` instead of `translations`. For the previous - # example, its glossary URI would be: - # `gs://my_bucket/a_b_c_[trg]_glossary_translations.[ext]`. - # - # Thus the max number of output files will be 2 (Translated document, - # Glossary translated document). - # - # Callers should expect no partial outputs. If there is any error during - # document translation, no output will be stored in the Cloud Storage - # bucket. - # @!attribute [rw] mime_type - # @return [::String] - # Optional. Specifies the translated document's mime_type. - # If not specified, the translated file's mime type will be the same as the - # input file's mime type. - # Currently only support the output mime type to be the same as input mime - # type. - # - application/pdf - # - application/vnd.openxmlformats-officedocument.wordprocessingml.document - # - application/vnd.openxmlformats-officedocument.presentationml.presentation - # - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - class DocumentOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A document translation request. - # @!attribute [rw] parent - # @return [::String] - # Required. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # For global calls, use `projects/{project-number-or-id}/locations/global` or - # `projects/{project-number-or-id}`. - # - # Non-global location is required for requests using AutoML models or custom - # glossaries. - # - # Models and glossaries must be within the same region (have the same - # location-id), otherwise an INVALID_ARGUMENT (400) error is returned. - # @!attribute [rw] source_language_code - # @return [::String] - # Optional. The ISO-639 language code of the input document if known, for - # example, "en-US" or "sr-Latn". Supported language codes are listed in - # [Language Support](https://cloud.google.com/translate/docs/languages). If - # the source language isn't specified, the API attempts to identify the - # source language automatically and returns the source language within the - # response. Source language must be specified if the request contains a - # glossary or a custom model. - # @!attribute [rw] target_language_code - # @return [::String] - # Required. The ISO-639 language code to use for translation of the input - # document, set to one of the language codes listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @!attribute [rw] document_input_config - # @return [::Google::Cloud::Translate::V3::DocumentInputConfig] - # Required. Input configurations. - # @!attribute [rw] document_output_config - # @return [::Google::Cloud::Translate::V3::DocumentOutputConfig] - # Optional. Output configurations. - # Defines if the output file should be stored within Cloud Storage as well - # as the desired output format. If not provided the translated file will - # only be returned through a byte-stream and its output mime type will be - # the same as the input file's mime type. - # @!attribute [rw] model - # @return [::String] - # Optional. The `model` type requested for this translation. - # - # The format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If not provided, the default Google model (NMT) will be used for - # translation. - # @!attribute [rw] glossary_config - # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] - # Optional. Glossary to be applied. The glossary must be within the same - # region (have the same location-id) as the model, otherwise an - # INVALID_ARGUMENT (400) error is returned. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters (Unicode - # codepoints), can only contain lowercase letters, numeric characters, - # underscores and dashes. International characters are allowed. Label values - # are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - # @!attribute [rw] customized_attribution - # @return [::String] - # Optional. This flag is to support user customized attribution. - # If not provided, the default is `Machine Translated by Google`. - # Customized attribution should follow rules in - # https://cloud.google.com/translate/attribution#attribution_and_logos - # @!attribute [rw] is_translate_native_pdf_only - # @return [::Boolean] - # Optional. is_translate_native_pdf_only field for external customers. - # If true, the page limit of online native pdf translation is 300 and only - # native pdf pages will be translated. - # @!attribute [rw] enable_shadow_removal_native_pdf - # @return [::Boolean] - # Optional. If true, use the text removal server to remove the shadow text on - # background image for native pdf translation. - # Shadow removal feature can only be enabled when - # is_translate_native_pdf_only: false && pdf_native_only: false - # @!attribute [rw] enable_rotation_correction - # @return [::Boolean] - # Optional. If true, enable auto rotation correction in DVS. - class TranslateDocumentRequest - 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 translated document message. - # @!attribute [rw] byte_stream_outputs - # @return [::Array<::String>] - # The array of translated documents. It is expected to be size 1 for now. We - # may produce multiple translated documents in the future for other type of - # file formats. - # @!attribute [rw] mime_type - # @return [::String] - # The translated document's mime type. - # @!attribute [rw] detected_language_code - # @return [::String] - # The detected language for the input document. - # If the user did not provide the source language for the input document, - # this field will have the language code automatically detected. If the - # source language was passed, auto-detection of the language does not occur - # and this field is empty. - class DocumentTranslation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A translated document response message. - # @!attribute [rw] document_translation - # @return [::Google::Cloud::Translate::V3::DocumentTranslation] - # Translated document. - # @!attribute [rw] glossary_document_translation - # @return [::Google::Cloud::Translate::V3::DocumentTranslation] - # The document's translation output if a glossary is provided in the request. - # This can be the same as [TranslateDocumentResponse.document_translation] - # if no glossary terms apply. - # @!attribute [rw] model - # @return [::String] - # Only present when 'model' is present in the request. - # 'model' is normalized to have a project number. - # - # For example: - # If the 'model' field in TranslateDocumentRequest is: - # `projects/{project-id}/locations/{location-id}/models/general/nmt` then - # `model` here would be normalized to - # `projects/{project-number}/locations/{location-id}/models/general/nmt`. - # @!attribute [rw] glossary_config - # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] - # The `glossary_config` used for this translation. - class TranslateDocumentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The batch translation request. - # @!attribute [rw] parent - # @return [::String] - # Required. Location to make a call. Must refer to a caller's project. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # The `global` location is not supported for batch translation. - # - # Only AutoML Translation models or glossaries within the same region (have - # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - # error is returned. - # @!attribute [rw] source_language_code - # @return [::String] - # Required. Source language code. Supported language codes are listed in - # [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @!attribute [rw] target_language_codes - # @return [::Array<::String>] - # Required. Specify up to 10 language codes here. Supported language codes - # are listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @!attribute [rw] models - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The models to use for translation. Map's key is target language - # code. Map's value is model name. Value can be a built-in general model, - # or an AutoML Translation model. - # - # The value format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If the map is empty or a specific model is - # not requested for a language pair, then default google model (nmt) is used. - # @!attribute [rw] input_configs - # @return [::Array<::Google::Cloud::Translate::V3::InputConfig>] - # Required. Input configurations. - # The total number of files matched should be <= 100. - # The total content size should be <= 100M Unicode codepoints. - # The files must use UTF-8 encoding. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Translate::V3::OutputConfig] - # Required. Output configuration. - # If 2 input configs match to the same file (that is, same input path), - # we don't generate output for duplicate inputs. - # @!attribute [rw] glossaries - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig}] - # Optional. Glossaries to be applied for translation. - # It's keyed by target language code. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels with user-defined metadata for the request. - # - # Label keys and values can be no longer than 63 characters - # (Unicode codepoints), can only contain lowercase letters, numeric - # characters, underscores and dashes. International characters are allowed. - # Label values are optional. Label keys must start with a letter. - # - # See https://cloud.google.com/translate/docs/advanced/labels for more - # information. - class BatchTranslateTextRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ModelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] - class GlossariesEntry - 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 - end - - # State metadata for the batch translation operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::BatchTranslateMetadata::State] - # The state of the operation. - # @!attribute [rw] translated_characters - # @return [::Integer] - # Number of successfully translated characters so far (Unicode codepoints). - # @!attribute [rw] failed_characters - # @return [::Integer] - # Number of characters that have failed to process so far (Unicode - # codepoints). - # @!attribute [rw] total_characters - # @return [::Integer] - # Total number of characters (Unicode codepoints). - # This is the total number of codepoints from input files times the number of - # target languages and appears here shortly after the call is submitted. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # Time when the operation was submitted. - class BatchTranslateMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the job. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is being processed. - RUNNING = 1 - - # The batch is processed, and at least one item was successfully - # processed. - SUCCEEDED = 2 - - # The batch is done and no item was successfully processed. - FAILED = 3 - - # Request is in the process of being canceled after caller invoked - # longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4 - - # The batch is done after the user has called the - # longrunning.Operations.CancelOperation. Any records processed before the - # cancel command are output as specified in the request. - CANCELLED = 5 - end - end - - # Stored in the - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # field returned by BatchTranslateText if at least one sentence is translated - # successfully. - # @!attribute [rw] total_characters - # @return [::Integer] - # Total number of characters (Unicode codepoints). - # @!attribute [rw] translated_characters - # @return [::Integer] - # Number of successfully translated characters (Unicode codepoints). - # @!attribute [rw] failed_characters - # @return [::Integer] - # Number of characters that have failed to process (Unicode codepoints). - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # Time when the operation was submitted. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to true. - class BatchTranslateResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input configuration for glossaries. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Translate::V3::GcsSource] - # Required. Google Cloud Storage location of glossary data. - # File format is determined based on the filename extension. API returns - # [google.rpc.Code.INVALID_ARGUMENT] for unsupported URI-s and file - # formats. Wildcards are not allowed. This must be a single file in one of - # the following formats: - # - # For unidirectional glossaries: - # - # - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated. - # The first column is source text. The second column is target text. - # No headers in this file. The first row contains data and not column - # names. - # - # - TMX (`.tmx`): TMX file with parallel data defining source/target term - # pairs. - # - # For equivalent term sets glossaries: - # - # - CSV (`.csv`): Multi-column CSV file defining equivalent glossary terms - # in multiple languages. See documentation for more information - - # [glossaries](https://cloud.google.com/translate/docs/advanced/glossary). - class GlossaryInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a glossary built from user-provided data. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the glossary. Glossary names have the form - # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`. - # @!attribute [rw] language_pair - # @return [::Google::Cloud::Translate::V3::Glossary::LanguageCodePair] - # Used with unidirectional glossaries. - # - # Note: The following fields are mutually exclusive: `language_pair`, `language_codes_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] language_codes_set - # @return [::Google::Cloud::Translate::V3::Glossary::LanguageCodesSet] - # Used with equivalent term set glossaries. - # - # Note: The following fields are mutually exclusive: `language_codes_set`, `language_pair`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Translate::V3::GlossaryInputConfig] - # Required. Provides examples to build the glossary from. - # Total glossary must not exceed 10M Unicode codepoints. - # @!attribute [r] entry_count - # @return [::Integer] - # Output only. The number of entries defined in the glossary. - # @!attribute [r] submit_time - # @return [::Google::Protobuf::Timestamp] - # Output only. When CreateGlossary was called. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. When the glossary creation was finished. - # @!attribute [rw] display_name - # @return [::String] - # Optional. The display name of the glossary. - class Glossary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Used with unidirectional glossaries. - # @!attribute [rw] source_language_code - # @return [::String] - # Required. The ISO-639 language code of the input text, for example, - # "en-US". Expected to be an exact match for GlossaryTerm.language_code. - # @!attribute [rw] target_language_code - # @return [::String] - # Required. The ISO-639 language code for translation output, for example, - # "zh-CN". Expected to be an exact match for GlossaryTerm.language_code. - class LanguageCodePair - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Used with equivalent term set glossaries. - # @!attribute [rw] language_codes - # @return [::Array<::String>] - # The ISO-639 language code(s) for terms defined in the glossary. - # All entries are unique. The list contains at least two entries. - # Expected to be an exact match for GlossaryTerm.language_code. - class LanguageCodesSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for CreateGlossary. - # @!attribute [rw] parent - # @return [::String] - # Required. The project name. - # @!attribute [rw] glossary - # @return [::Google::Cloud::Translate::V3::Glossary] - # Required. The glossary to create. - class CreateGlossaryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the update glossary flow - # @!attribute [rw] glossary - # @return [::Google::Cloud::Translate::V3::Glossary] - # Required. The glossary entry to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. Currently only `display_name` and - # 'input_config' - class UpdateGlossaryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetGlossary. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the glossary to retrieve. - class GetGlossaryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteGlossary. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the glossary to delete. - class DeleteGlossaryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListGlossaries. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project from which to list all of the glossaries. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server may return fewer glossaries than - # requested. If unspecified, the server picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of [ListGlossariesResponse.next_page_token] - # returned from the previous call to `ListGlossaries` method. - # The first page is returned if `page_token`is empty or missing. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter specifying constraints of a list operation. - # Specify the constraint by the format of "key=value", where key must be - # "src" or "tgt", and the value must be a valid language code. - # For multiple restrictions, concatenate them by "AND" (uppercase only), - # such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used - # here, which means using 'en-US' and 'en' can lead to different results, - # which depends on the language code you used when you create the glossary. - # For the unidirectional glossaries, the "src" and "tgt" add restrictions - # on the source and target language code separately. - # For the equivalent term set glossaries, the "src" and/or "tgt" add - # restrictions on the term set. - # For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional - # glossaries which exactly match the source language code as "en-US" and the - # target language code "zh-CN", but all equivalent term set glossaries which - # contain "en-US" and "zh-CN" in their language set will be picked. - # If missing, no filtering is performed. - class ListGlossariesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListGlossaries. - # @!attribute [rw] glossaries - # @return [::Array<::Google::Cloud::Translate::V3::Glossary>] - # The list of glossaries for a project. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve a page of results. Pass this value in the - # [ListGlossariesRequest.page_token] field in the subsequent call to - # `ListGlossaries` method to retrieve the next page of results. - class ListGlossariesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the Get Glossary Entry Api - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the glossary entry to get - class GetGlossaryEntryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for Delete Glossary Entry - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the glossary entry to delete - class DeleteGlossaryEntryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListGlossaryEntries - # @!attribute [rw] parent - # @return [::String] - # Required. The parent glossary resource name for listing the glossary's - # entries. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. The server may return fewer glossary entries - # than requested. If unspecified, the server picks an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # Typically, this is the value of - # [ListGlossaryEntriesResponse.next_page_token] returned from the previous - # call. The first page is returned if `page_token`is empty or missing. - class ListGlossaryEntriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListGlossaryEntries - # @!attribute [rw] glossary_entries - # @return [::Array<::Google::Cloud::Translate::V3::GlossaryEntry>] - # Optional. The Glossary Entries - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. A token to retrieve a page of results. Pass this value in the - # [ListGLossaryEntriesRequest.page_token] field in the subsequent calls. - class ListGlossaryEntriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateGlossaryEntry - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the glossary to create the entry under. - # @!attribute [rw] glossary_entry - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # Required. The glossary entry to create - class CreateGlossaryEntryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateGlossaryEntry - # @!attribute [rw] glossary_entry - # @return [::Google::Cloud::Translate::V3::GlossaryEntry] - # Required. The glossary entry to update. - class UpdateGlossaryEntryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Stored in the - # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata} - # field returned by CreateGlossary. - # @!attribute [rw] name - # @return [::String] - # The name of the glossary that is being created. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::CreateGlossaryMetadata::State] - # The current state of the glossary creation operation. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation was submitted to the server. - class CreateGlossaryMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumerates the possible states that the creation request can be in. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is being processed. - RUNNING = 1 - - # The glossary was successfully created. - SUCCEEDED = 2 - - # Failed to create the glossary. - FAILED = 3 - - # Request is in the process of being canceled after caller invoked - # longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4 - - # The glossary creation request was successfully canceled. - CANCELLED = 5 - end - end - - # Stored in the - # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata} - # field returned by UpdateGlossary. - # @!attribute [rw] glossary - # @return [::Google::Cloud::Translate::V3::Glossary] - # The updated glossary object. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::UpdateGlossaryMetadata::State] - # The current state of the glossary update operation. If the glossary input - # file was not updated this will be completed immediately - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation was submitted to the server. - class UpdateGlossaryMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumerates the possible states that the update request can be in. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is being processed. - RUNNING = 1 - - # The glossary was successfully updated. - SUCCEEDED = 2 - - # Failed to update the glossary. - FAILED = 3 - - # Request is in the process of being canceled after caller invoked - # longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4 - - # The glossary update request was successfully canceled. - CANCELLED = 5 - end - end - - # Stored in the - # {::Google::Longrunning::Operation#metadata google.longrunning.Operation.metadata} - # field returned by DeleteGlossary. - # @!attribute [rw] name - # @return [::String] - # The name of the glossary that is being deleted. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::DeleteGlossaryMetadata::State] - # The current state of the glossary deletion operation. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation was submitted to the server. - class DeleteGlossaryMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumerates the possible states that the creation request can be in. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is being processed. - RUNNING = 1 - - # The glossary was successfully deleted. - SUCCEEDED = 2 - - # Failed to delete the glossary. - FAILED = 3 - - # Request is in the process of being canceled after caller invoked - # longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4 - - # The glossary deletion request was successfully canceled. - CANCELLED = 5 - end - end - - # Stored in the - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # field returned by DeleteGlossary. - # @!attribute [rw] name - # @return [::String] - # The name of the deleted glossary. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation was submitted to the server. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the glossary deletion is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to true. - class DeleteGlossaryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The BatchTranslateDocument request. - # @!attribute [rw] parent - # @return [::String] - # Required. Location to make a regional call. - # - # Format: `projects/{project-number-or-id}/locations/{location-id}`. - # - # The `global` location is not supported for batch translation. - # - # Only AutoML Translation models or glossaries within the same region (have - # the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) - # error is returned. - # @!attribute [rw] source_language_code - # @return [::String] - # Required. The ISO-639 language code of the input document if known, for - # example, "en-US" or "sr-Latn". Supported language codes are listed in - # [Language Support](https://cloud.google.com/translate/docs/languages). - # @!attribute [rw] target_language_codes - # @return [::Array<::String>] - # Required. The ISO-639 language code to use for translation of the input - # document. Specify up to 10 language codes here. Supported language codes - # are listed in [Language - # Support](https://cloud.google.com/translate/docs/languages). - # @!attribute [rw] input_configs - # @return [::Array<::Google::Cloud::Translate::V3::BatchDocumentInputConfig>] - # Required. Input configurations. - # The total number of files matched should be <= 100. - # The total content size to translate should be <= 100M Unicode codepoints. - # The files must use UTF-8 encoding. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Translate::V3::BatchDocumentOutputConfig] - # Required. Output configuration. - # If 2 input configs match to the same file (that is, same input path), - # we don't generate output for duplicate inputs. - # @!attribute [rw] models - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The models to use for translation. Map's key is target language - # code. Map's value is the model name. Value can be a built-in general model, - # or an AutoML Translation model. - # - # The value format depends on model type: - # - # - AutoML Translation models: - # `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}` - # - # - General (built-in) models: - # `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`, - # - # - # If the map is empty or a specific model is - # not requested for a language pair, then default google model (nmt) is used. - # @!attribute [rw] glossaries - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig}] - # Optional. Glossaries to be applied. It's keyed by target language code. - # @!attribute [rw] format_conversions - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The file format conversion map that is applied to all input - # files. The map key is the original mime_type. The map value is the target - # mime_type of translated documents. - # - # Supported file format conversion includes: - # - `application/pdf` to - # `application/vnd.openxmlformats-officedocument.wordprocessingml.document` - # - # If nothing specified, output files will be in the same format as the - # original file. - # @!attribute [rw] customized_attribution - # @return [::String] - # Optional. This flag is to support user customized attribution. - # If not provided, the default is `Machine Translated by Google`. - # Customized attribution should follow rules in - # https://cloud.google.com/translate/attribution#attribution_and_logos - # @!attribute [rw] enable_shadow_removal_native_pdf - # @return [::Boolean] - # Optional. If true, use the text removal server to remove the shadow text on - # background image for native pdf translation. - # Shadow removal feature can only be enabled when - # is_translate_native_pdf_only: false && pdf_native_only: false - # @!attribute [rw] enable_rotation_correction - # @return [::Boolean] - # Optional. If true, enable auto rotation correction in DVS. - class BatchTranslateDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ModelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig] - class GlossariesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class FormatConversionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Input configuration for BatchTranslateDocument request. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Translate::V3::GcsSource] - # Google Cloud Storage location for the source input. - # This can be a single file (for example, - # `gs://translation-test/input.docx`) or a wildcard (for example, - # `gs://translation-test/*`). - # - # File mime type is determined based on extension. Supported mime type - # includes: - # - `pdf`, application/pdf - # - `docx`, - # application/vnd.openxmlformats-officedocument.wordprocessingml.document - # - `pptx`, - # application/vnd.openxmlformats-officedocument.presentationml.presentation - # - `xlsx`, - # application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - # - # The max file size to support for `.docx`, `.pptx` and `.xlsx` is 100MB. - # The max file size to support for `.pdf` is 1GB and the max page limit is - # 1000 pages. - # The max file size to support for all input documents is 1GB. - class BatchDocumentInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Output configuration for BatchTranslateDocument request. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Translate::V3::GcsDestination] - # Google Cloud Storage destination for output content. - # For every single input document (for example, gs://a/b/c.[extension]), we - # generate at most 2 * n output files. (n is the # of target_language_codes - # in the BatchTranslateDocumentRequest). - # - # While the input documents are being processed, we write/update an index - # file `index.csv` under `gcs_destination.output_uri_prefix` (for example, - # gs://translation_output/index.csv) The index file is generated/updated as - # new files are being translated. The format is: - # - # input_document,target_language_code,translation_output,error_output, - # glossary_translation_output,glossary_error_output - # - # `input_document` is one file we matched using gcs_source.input_uri. - # `target_language_code` is provided in the request. - # `translation_output` contains the translations. (details provided below) - # `error_output` contains the error message during processing of the file. - # Both translations_file and errors_file could be empty strings if we have - # no content to output. - # `glossary_translation_output` and `glossary_error_output` are the - # translated output/error when we apply glossaries. They could also be - # empty if we have no content to output. - # - # Once a row is present in index.csv, the input/output matching never - # changes. Callers should also expect all the content in input_file are - # processed and ready to be consumed (that is, no partial output file is - # written). - # - # Since index.csv will be keeping updated during the process, please make - # sure there is no custom retention policy applied on the output bucket - # that may avoid file updating. - # (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) - # - # The naming format of translation output files follows (for target - # language code [trg]): `translation_output`: - # `gs://translation_output/a_b_c_[trg]_translation.[extension]` - # `glossary_translation_output`: - # `gs://translation_test/a_b_c_[trg]_glossary_translation.[extension]`. The - # output document will maintain the same file format as the input document. - # - # The naming format of error output files follows (for target language code - # [trg]): `error_output`: `gs://translation_test/a_b_c_[trg]_errors.txt` - # `glossary_error_output`: - # `gs://translation_test/a_b_c_[trg]_glossary_translation.txt`. The error - # output is a txt file containing error details. - class BatchDocumentOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Stored in the - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # field returned by BatchTranslateDocument if at least one document is - # translated successfully. - # @!attribute [rw] total_pages - # @return [::Integer] - # Total number of pages to translate in all documents. Documents without - # clear page definition (such as XLSX) are not counted. - # @!attribute [rw] translated_pages - # @return [::Integer] - # Number of successfully translated pages in all documents. Documents without - # clear page definition (such as XLSX) are not counted. - # @!attribute [rw] failed_pages - # @return [::Integer] - # Number of pages that failed to process in all documents. Documents without - # clear page definition (such as XLSX) are not counted. - # @!attribute [rw] total_billable_pages - # @return [::Integer] - # Number of billable pages in documents with clear page definition (such as - # PDF, DOCX, PPTX) - # @!attribute [rw] total_characters - # @return [::Integer] - # Total number of characters (Unicode codepoints) in all documents. - # @!attribute [rw] translated_characters - # @return [::Integer] - # Number of successfully translated characters (Unicode codepoints) in all - # documents. - # @!attribute [rw] failed_characters - # @return [::Integer] - # Number of characters that have failed to process (Unicode codepoints) in - # all documents. - # @!attribute [rw] total_billable_characters - # @return [::Integer] - # Number of billable characters (Unicode codepoints) in documents without - # clear page definition, such as XLSX. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # Time when the operation was submitted. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to true. - class BatchTranslateDocumentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # State metadata for the batch translation operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Translate::V3::BatchTranslateDocumentMetadata::State] - # The state of the operation. - # @!attribute [rw] total_pages - # @return [::Integer] - # Total number of pages to translate in all documents so far. Documents - # without clear page definition (such as XLSX) are not counted. - # @!attribute [rw] translated_pages - # @return [::Integer] - # Number of successfully translated pages in all documents so far. Documents - # without clear page definition (such as XLSX) are not counted. - # @!attribute [rw] failed_pages - # @return [::Integer] - # Number of pages that failed to process in all documents so far. Documents - # without clear page definition (such as XLSX) are not counted. - # @!attribute [rw] total_billable_pages - # @return [::Integer] - # Number of billable pages in documents with clear page definition (such as - # PDF, DOCX, PPTX) so far. - # @!attribute [rw] total_characters - # @return [::Integer] - # Total number of characters (Unicode codepoints) in all documents so far. - # @!attribute [rw] translated_characters - # @return [::Integer] - # Number of successfully translated characters (Unicode codepoints) in all - # documents so far. - # @!attribute [rw] failed_characters - # @return [::Integer] - # Number of characters that have failed to process (Unicode codepoints) in - # all documents so far. - # @!attribute [rw] total_billable_characters - # @return [::Integer] - # Number of billable characters (Unicode codepoints) in documents without - # clear page definition (such as XLSX) so far. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # Time when the operation was submitted. - class BatchTranslateDocumentMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the job. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is being processed. - RUNNING = 1 - - # The batch is processed, and at least one item was successfully processed. - SUCCEEDED = 2 - - # The batch is done and no item was successfully processed. - FAILED = 3 - - # Request is in the process of being canceled after caller invoked - # longrunning.Operations.CancelOperation on the request id. - CANCELLING = 4 - - # The batch is done after the user has called the - # longrunning.Operations.CancelOperation. Any records processed before the - # cancel command are output as specified in the request. - CANCELLED = 5 - end - end - - # Configures which glossary is used for a specific target language and defines - # options for applying that glossary. - # @!attribute [rw] glossary - # @return [::String] - # Required. The `glossary` to be applied for this translation. - # - # The format depends on the glossary: - # - # - User-provided custom glossary: - # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}` - # @!attribute [rw] ignore_case - # @return [::Boolean] - # Optional. Indicates match is case insensitive. The default value is `false` - # if missing. - # @!attribute [rw] contextual_translation_enabled - # @return [::Boolean] - # Optional. If set to true, the glossary will be used for contextual - # translation. - class TranslateTextGlossaryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-translate-v3/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3/snippets/Gemfile b/owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile deleted file mode 100644 index bdff294d3cff..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate-v3", path: "../" -else - gem "google-cloud-translate-v3" -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-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json b/owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json deleted file mode 100644 index c234e2a00fb6..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json +++ /dev/null @@ -1,1535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-translate-v3", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.translation.v3", - "version": "v3" - } - ] - }, - "snippets": [ - { - "region_tag": "translate_v3_generated_TranslationService_TranslateText_sync", - "title": "Snippet for the translate_text call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#translate_text.", - "file": "translation_service/translate_text.rb", - "language": "RUBY", - "client_method": { - "short_name": "translate_text", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#translate_text", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::TranslateTextRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::TranslateTextResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "TranslateText", - "full_name": "google.cloud.translation.v3.TranslationService.TranslateText", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_RomanizeText_sync", - "title": "Snippet for the romanize_text call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#romanize_text.", - "file": "translation_service/romanize_text.rb", - "language": "RUBY", - "client_method": { - "short_name": "romanize_text", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#romanize_text", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::RomanizeTextRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::RomanizeTextResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "RomanizeText", - "full_name": "google.cloud.translation.v3.TranslationService.RomanizeText", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_DetectLanguage_sync", - "title": "Snippet for the detect_language call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#detect_language.", - "file": "translation_service/detect_language.rb", - "language": "RUBY", - "client_method": { - "short_name": "detect_language", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#detect_language", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::DetectLanguageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::DetectLanguageResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "DetectLanguage", - "full_name": "google.cloud.translation.v3.TranslationService.DetectLanguage", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_GetSupportedLanguages_sync", - "title": "Snippet for the get_supported_languages call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_supported_languages.", - "file": "translation_service/get_supported_languages.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_supported_languages", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_supported_languages", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::SupportedLanguages", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "GetSupportedLanguages", - "full_name": "google.cloud.translation.v3.TranslationService.GetSupportedLanguages", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_TranslateDocument_sync", - "title": "Snippet for the translate_document call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#translate_document.", - "file": "translation_service/translate_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "translate_document", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#translate_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::TranslateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::TranslateDocumentResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "TranslateDocument", - "full_name": "google.cloud.translation.v3.TranslationService.TranslateDocument", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_BatchTranslateText_sync", - "title": "Snippet for the batch_translate_text call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_text.", - "file": "translation_service/batch_translate_text.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_translate_text", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_text", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::BatchTranslateTextRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "BatchTranslateText", - "full_name": "google.cloud.translation.v3.TranslationService.BatchTranslateText", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_BatchTranslateDocument_sync", - "title": "Snippet for the batch_translate_document call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_document.", - "file": "translation_service/batch_translate_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_translate_document", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "BatchTranslateDocument", - "full_name": "google.cloud.translation.v3.TranslationService.BatchTranslateDocument", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_CreateGlossary_sync", - "title": "Snippet for the create_glossary call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_glossary.", - "file": "translation_service/create_glossary.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_glossary", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_glossary", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::CreateGlossaryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "CreateGlossary", - "full_name": "google.cloud.translation.v3.TranslationService.CreateGlossary", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_UpdateGlossary_sync", - "title": "Snippet for the update_glossary call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#update_glossary.", - "file": "translation_service/update_glossary.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_glossary", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#update_glossary", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::UpdateGlossaryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "UpdateGlossary", - "full_name": "google.cloud.translation.v3.TranslationService.UpdateGlossary", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListGlossaries_sync", - "title": "Snippet for the list_glossaries call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_glossaries.", - "file": "translation_service/list_glossaries.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_glossaries", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_glossaries", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListGlossariesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListGlossariesResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListGlossaries", - "full_name": "google.cloud.translation.v3.TranslationService.ListGlossaries", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_GetGlossary_sync", - "title": "Snippet for the get_glossary call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_glossary.", - "file": "translation_service/get_glossary.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_glossary", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_glossary", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::GetGlossaryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::Glossary", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "GetGlossary", - "full_name": "google.cloud.translation.v3.TranslationService.GetGlossary", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_DeleteGlossary_sync", - "title": "Snippet for the delete_glossary call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary.", - "file": "translation_service/delete_glossary.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_glossary", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::DeleteGlossaryRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "DeleteGlossary", - "full_name": "google.cloud.translation.v3.TranslationService.DeleteGlossary", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_GetGlossaryEntry_sync", - "title": "Snippet for the get_glossary_entry call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_glossary_entry.", - "file": "translation_service/get_glossary_entry.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_glossary_entry", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_glossary_entry", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::GetGlossaryEntryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::GlossaryEntry", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "GetGlossaryEntry", - "full_name": "google.cloud.translation.v3.TranslationService.GetGlossaryEntry", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListGlossaryEntries_sync", - "title": "Snippet for the list_glossary_entries call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_glossary_entries.", - "file": "translation_service/list_glossary_entries.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_glossary_entries", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_glossary_entries", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListGlossaryEntries", - "full_name": "google.cloud.translation.v3.TranslationService.ListGlossaryEntries", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_CreateGlossaryEntry_sync", - "title": "Snippet for the create_glossary_entry call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_glossary_entry.", - "file": "translation_service/create_glossary_entry.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_glossary_entry", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_glossary_entry", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::GlossaryEntry", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "CreateGlossaryEntry", - "full_name": "google.cloud.translation.v3.TranslationService.CreateGlossaryEntry", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_UpdateGlossaryEntry_sync", - "title": "Snippet for the update_glossary_entry call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#update_glossary_entry.", - "file": "translation_service/update_glossary_entry.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_glossary_entry", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#update_glossary_entry", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::GlossaryEntry", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "UpdateGlossaryEntry", - "full_name": "google.cloud.translation.v3.TranslationService.UpdateGlossaryEntry", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_DeleteGlossaryEntry_sync", - "title": "Snippet for the delete_glossary_entry call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary_entry.", - "file": "translation_service/delete_glossary_entry.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_glossary_entry", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary_entry", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "DeleteGlossaryEntry", - "full_name": "google.cloud.translation.v3.TranslationService.DeleteGlossaryEntry", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_CreateDataset_sync", - "title": "Snippet for the create_dataset call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_dataset.", - "file": "translation_service/create_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_dataset", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::CreateDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "CreateDataset", - "full_name": "google.cloud.translation.v3.TranslationService.CreateDataset", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_GetDataset_sync", - "title": "Snippet for the get_dataset call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_dataset.", - "file": "translation_service/get_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_dataset", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::GetDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::Dataset", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "GetDataset", - "full_name": "google.cloud.translation.v3.TranslationService.GetDataset", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListDatasets_sync", - "title": "Snippet for the list_datasets call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_datasets.", - "file": "translation_service/list_datasets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_datasets", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_datasets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListDatasetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListDatasetsResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListDatasets", - "full_name": "google.cloud.translation.v3.TranslationService.ListDatasets", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_DeleteDataset_sync", - "title": "Snippet for the delete_dataset call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_dataset.", - "file": "translation_service/delete_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_dataset", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::DeleteDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "DeleteDataset", - "full_name": "google.cloud.translation.v3.TranslationService.DeleteDataset", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_CreateAdaptiveMtDataset_sync", - "title": "Snippet for the create_adaptive_mt_dataset call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_adaptive_mt_dataset.", - "file": "translation_service/create_adaptive_mt_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_adaptive_mt_dataset", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_adaptive_mt_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtDataset", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "CreateAdaptiveMtDataset", - "full_name": "google.cloud.translation.v3.TranslationService.CreateAdaptiveMtDataset", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_DeleteAdaptiveMtDataset_sync", - "title": "Snippet for the delete_adaptive_mt_dataset call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_dataset.", - "file": "translation_service/delete_adaptive_mt_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_adaptive_mt_dataset", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "DeleteAdaptiveMtDataset", - "full_name": "google.cloud.translation.v3.TranslationService.DeleteAdaptiveMtDataset", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_GetAdaptiveMtDataset_sync", - "title": "Snippet for the get_adaptive_mt_dataset call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_dataset.", - "file": "translation_service/get_adaptive_mt_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_adaptive_mt_dataset", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtDataset", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "GetAdaptiveMtDataset", - "full_name": "google.cloud.translation.v3.TranslationService.GetAdaptiveMtDataset", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListAdaptiveMtDatasets_sync", - "title": "Snippet for the list_adaptive_mt_datasets call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_datasets.", - "file": "translation_service/list_adaptive_mt_datasets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_adaptive_mt_datasets", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_datasets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListAdaptiveMtDatasets", - "full_name": "google.cloud.translation.v3.TranslationService.ListAdaptiveMtDatasets", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_AdaptiveMtTranslate_sync", - "title": "Snippet for the adaptive_mt_translate call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#adaptive_mt_translate.", - "file": "translation_service/adaptive_mt_translate.rb", - "language": "RUBY", - "client_method": { - "short_name": "adaptive_mt_translate", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#adaptive_mt_translate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "AdaptiveMtTranslate", - "full_name": "google.cloud.translation.v3.TranslationService.AdaptiveMtTranslate", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_GetAdaptiveMtFile_sync", - "title": "Snippet for the get_adaptive_mt_file call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_file.", - "file": "translation_service/get_adaptive_mt_file.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_adaptive_mt_file", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_adaptive_mt_file", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::AdaptiveMtFile", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "GetAdaptiveMtFile", - "full_name": "google.cloud.translation.v3.TranslationService.GetAdaptiveMtFile", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_DeleteAdaptiveMtFile_sync", - "title": "Snippet for the delete_adaptive_mt_file call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_file.", - "file": "translation_service/delete_adaptive_mt_file.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_adaptive_mt_file", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_adaptive_mt_file", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "DeleteAdaptiveMtFile", - "full_name": "google.cloud.translation.v3.TranslationService.DeleteAdaptiveMtFile", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ImportAdaptiveMtFile_sync", - "title": "Snippet for the import_adaptive_mt_file call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#import_adaptive_mt_file.", - "file": "translation_service/import_adaptive_mt_file.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_adaptive_mt_file", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#import_adaptive_mt_file", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ImportAdaptiveMtFile", - "full_name": "google.cloud.translation.v3.TranslationService.ImportAdaptiveMtFile", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListAdaptiveMtFiles_sync", - "title": "Snippet for the list_adaptive_mt_files call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_files.", - "file": "translation_service/list_adaptive_mt_files.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_adaptive_mt_files", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_files", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListAdaptiveMtFiles", - "full_name": "google.cloud.translation.v3.TranslationService.ListAdaptiveMtFiles", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListAdaptiveMtSentences_sync", - "title": "Snippet for the list_adaptive_mt_sentences call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_sentences.", - "file": "translation_service/list_adaptive_mt_sentences.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_adaptive_mt_sentences", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_adaptive_mt_sentences", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListAdaptiveMtSentences", - "full_name": "google.cloud.translation.v3.TranslationService.ListAdaptiveMtSentences", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ImportData_sync", - "title": "Snippet for the import_data call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#import_data.", - "file": "translation_service/import_data.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_data", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#import_data", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ImportDataRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ImportData", - "full_name": "google.cloud.translation.v3.TranslationService.ImportData", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ExportData_sync", - "title": "Snippet for the export_data call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#export_data.", - "file": "translation_service/export_data.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_data", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#export_data", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ExportDataRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ExportData", - "full_name": "google.cloud.translation.v3.TranslationService.ExportData", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListExamples_sync", - "title": "Snippet for the list_examples call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_examples.", - "file": "translation_service/list_examples.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_examples", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_examples", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListExamplesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListExamplesResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListExamples", - "full_name": "google.cloud.translation.v3.TranslationService.ListExamples", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_CreateModel_sync", - "title": "Snippet for the create_model call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#create_model.", - "file": "translation_service/create_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_model", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#create_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::CreateModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "CreateModel", - "full_name": "google.cloud.translation.v3.TranslationService.CreateModel", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_ListModels_sync", - "title": "Snippet for the list_models call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#list_models.", - "file": "translation_service/list_models.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_models", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#list_models", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::ListModelsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::ListModelsResponse", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "ListModels", - "full_name": "google.cloud.translation.v3.TranslationService.ListModels", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_GetModel_sync", - "title": "Snippet for the get_model call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#get_model.", - "file": "translation_service/get_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_model", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#get_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::GetModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Translate::V3::Model", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "GetModel", - "full_name": "google.cloud.translation.v3.TranslationService.GetModel", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "translate_v3_generated_TranslationService_DeleteModel_sync", - "title": "Snippet for the delete_model call in the TranslationService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Translate::V3::TranslationService::Client#delete_model.", - "file": "translation_service/delete_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_model", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client#delete_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Translate::V3::DeleteModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "TranslationService::Client", - "full_name": "::Google::Cloud::Translate::V3::TranslationService::Client" - }, - "method": { - "short_name": "DeleteModel", - "full_name": "google.cloud.translation.v3.TranslationService.DeleteModel", - "service": { - "short_name": "TranslationService", - "full_name": "google.cloud.translation.v3.TranslationService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb deleted file mode 100644 index aa4ad9228411..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/adaptive_mt_translate.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_AdaptiveMtTranslate_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the adaptive_mt_translate call in the TranslationService 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::Translate::V3::TranslationService::Client#adaptive_mt_translate. -# -def adaptive_mt_translate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new - - # Call the adaptive_mt_translate method. - result = client.adaptive_mt_translate request - - # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse. - p result -end -# [END translate_v3_generated_TranslationService_AdaptiveMtTranslate_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb deleted file mode 100644 index 25d0fe3a2789..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_BatchTranslateDocument_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the batch_translate_document call in the TranslationService 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::Translate::V3::TranslationService::Client#batch_translate_document. -# -def batch_translate_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new - - # Call the batch_translate_document method. - result = client.batch_translate_document 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 translate_v3_generated_TranslationService_BatchTranslateDocument_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb deleted file mode 100644 index 1ed61588014c..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_BatchTranslateText_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the batch_translate_text call in the TranslationService 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::Translate::V3::TranslationService::Client#batch_translate_text. -# -def batch_translate_text - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new - - # Call the batch_translate_text method. - result = client.batch_translate_text 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 translate_v3_generated_TranslationService_BatchTranslateText_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb deleted file mode 100644 index a7e3243384ec..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_adaptive_mt_dataset.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateAdaptiveMtDataset_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the create_adaptive_mt_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#create_adaptive_mt_dataset. -# -def create_adaptive_mt_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new - - # Call the create_adaptive_mt_dataset method. - result = client.create_adaptive_mt_dataset request - - # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. - p result -end -# [END translate_v3_generated_TranslationService_CreateAdaptiveMtDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb deleted file mode 100644 index 0ae3a139cb62..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_dataset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateDataset_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the create_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#create_dataset. -# -def create_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::CreateDatasetRequest.new - - # Call the create_dataset method. - result = client.create_dataset 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 translate_v3_generated_TranslationService_CreateDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb deleted file mode 100644 index 3ecab7c93861..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateGlossary_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the create_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#create_glossary. -# -def create_glossary - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new - - # Call the create_glossary method. - result = client.create_glossary 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 translate_v3_generated_TranslationService_CreateGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb deleted file mode 100644 index 9f644113a2e5..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_glossary_entry.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateGlossaryEntry_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the create_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#create_glossary_entry. -# -def create_glossary_entry - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new - - # Call the create_glossary_entry method. - result = client.create_glossary_entry request - - # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - p result -end -# [END translate_v3_generated_TranslationService_CreateGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb deleted file mode 100644 index f13607493059..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/create_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_CreateModel_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the create_model call in the TranslationService 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::Translate::V3::TranslationService::Client#create_model. -# -def create_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::CreateModelRequest.new - - # Call the create_model method. - result = client.create_model 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 translate_v3_generated_TranslationService_CreateModel_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb deleted file mode 100644 index f9f940bb5044..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_dataset.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteAdaptiveMtDataset_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the delete_adaptive_mt_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_adaptive_mt_dataset. -# -def delete_adaptive_mt_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new - - # Call the delete_adaptive_mt_dataset method. - result = client.delete_adaptive_mt_dataset request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END translate_v3_generated_TranslationService_DeleteAdaptiveMtDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb deleted file mode 100644 index 469a91f67799..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_adaptive_mt_file.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteAdaptiveMtFile_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the delete_adaptive_mt_file call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_adaptive_mt_file. -# -def delete_adaptive_mt_file - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new - - # Call the delete_adaptive_mt_file method. - result = client.delete_adaptive_mt_file request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END translate_v3_generated_TranslationService_DeleteAdaptiveMtFile_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb deleted file mode 100644 index 36188a743141..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_dataset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteDataset_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the delete_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_dataset. -# -def delete_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::DeleteDatasetRequest.new - - # Call the delete_dataset method. - result = client.delete_dataset 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 translate_v3_generated_TranslationService_DeleteDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb deleted file mode 100644 index 0d5258e5b7f2..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteGlossary_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the delete_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_glossary. -# -def delete_glossary - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new - - # Call the delete_glossary method. - result = client.delete_glossary 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 translate_v3_generated_TranslationService_DeleteGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb deleted file mode 100644 index f9a3a195e7df..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_glossary_entry.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteGlossaryEntry_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the delete_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_glossary_entry. -# -def delete_glossary_entry - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new - - # Call the delete_glossary_entry method. - result = client.delete_glossary_entry request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END translate_v3_generated_TranslationService_DeleteGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb deleted file mode 100644 index f97403f97994..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/delete_model.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DeleteModel_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the delete_model call in the TranslationService 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::Translate::V3::TranslationService::Client#delete_model. -# -def delete_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::DeleteModelRequest.new - - # Call the delete_model method. - result = client.delete_model 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 translate_v3_generated_TranslationService_DeleteModel_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb deleted file mode 100644 index 55ecd2e01e60..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/detect_language.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_DetectLanguage_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the detect_language call in the TranslationService 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::Translate::V3::TranslationService::Client#detect_language. -# -def detect_language - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::DetectLanguageRequest.new - - # Call the detect_language method. - result = client.detect_language request - - # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. - p result -end -# [END translate_v3_generated_TranslationService_DetectLanguage_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb deleted file mode 100644 index 67e09245adad..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/export_data.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ExportData_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the export_data call in the TranslationService 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::Translate::V3::TranslationService::Client#export_data. -# -def export_data - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ExportDataRequest.new - - # Call the export_data method. - result = client.export_data 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 translate_v3_generated_TranslationService_ExportData_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb deleted file mode 100644 index ba4e677c2358..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_dataset.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetAdaptiveMtDataset_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the get_adaptive_mt_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#get_adaptive_mt_dataset. -# -def get_adaptive_mt_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new - - # Call the get_adaptive_mt_dataset method. - result = client.get_adaptive_mt_dataset request - - # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtDataset. - p result -end -# [END translate_v3_generated_TranslationService_GetAdaptiveMtDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb deleted file mode 100644 index 0e7ebc6cc6ec..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_adaptive_mt_file.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetAdaptiveMtFile_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the get_adaptive_mt_file call in the TranslationService 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::Translate::V3::TranslationService::Client#get_adaptive_mt_file. -# -def get_adaptive_mt_file - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new - - # Call the get_adaptive_mt_file method. - result = client.get_adaptive_mt_file request - - # The returned object is of type Google::Cloud::Translate::V3::AdaptiveMtFile. - p result -end -# [END translate_v3_generated_TranslationService_GetAdaptiveMtFile_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb deleted file mode 100644 index 3c560b5a9f1f..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_dataset.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetDataset_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the get_dataset call in the TranslationService 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::Translate::V3::TranslationService::Client#get_dataset. -# -def get_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::GetDatasetRequest.new - - # Call the get_dataset method. - result = client.get_dataset request - - # The returned object is of type Google::Cloud::Translate::V3::Dataset. - p result -end -# [END translate_v3_generated_TranslationService_GetDataset_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb deleted file mode 100644 index b4d2ade127f7..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetGlossary_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the get_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#get_glossary. -# -def get_glossary - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::GetGlossaryRequest.new - - # Call the get_glossary method. - result = client.get_glossary request - - # The returned object is of type Google::Cloud::Translate::V3::Glossary. - p result -end -# [END translate_v3_generated_TranslationService_GetGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb deleted file mode 100644 index 422026b30132..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_glossary_entry.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetGlossaryEntry_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the get_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#get_glossary_entry. -# -def get_glossary_entry - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new - - # Call the get_glossary_entry method. - result = client.get_glossary_entry request - - # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - p result -end -# [END translate_v3_generated_TranslationService_GetGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb deleted file mode 100644 index c7ddbabd9b88..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_model.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetModel_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the get_model call in the TranslationService 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::Translate::V3::TranslationService::Client#get_model. -# -def get_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::GetModelRequest.new - - # Call the get_model method. - result = client.get_model request - - # The returned object is of type Google::Cloud::Translate::V3::Model. - p result -end -# [END translate_v3_generated_TranslationService_GetModel_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb deleted file mode 100644 index 3ee79de1a1de..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_GetSupportedLanguages_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the get_supported_languages call in the TranslationService 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::Translate::V3::TranslationService::Client#get_supported_languages. -# -def get_supported_languages - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new - - # Call the get_supported_languages method. - result = client.get_supported_languages request - - # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. - p result -end -# [END translate_v3_generated_TranslationService_GetSupportedLanguages_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb deleted file mode 100644 index e44c710d2853..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_adaptive_mt_file.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ImportAdaptiveMtFile_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the import_adaptive_mt_file call in the TranslationService 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::Translate::V3::TranslationService::Client#import_adaptive_mt_file. -# -def import_adaptive_mt_file - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new - - # Call the import_adaptive_mt_file method. - result = client.import_adaptive_mt_file request - - # The returned object is of type Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse. - p result -end -# [END translate_v3_generated_TranslationService_ImportAdaptiveMtFile_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb deleted file mode 100644 index 5b13e7a3f486..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/import_data.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ImportData_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the import_data call in the TranslationService 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::Translate::V3::TranslationService::Client#import_data. -# -def import_data - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ImportDataRequest.new - - # Call the import_data method. - result = client.import_data 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 translate_v3_generated_TranslationService_ImportData_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb deleted file mode 100644 index 177ce32c2628..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_datasets.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListAdaptiveMtDatasets_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_adaptive_mt_datasets call in the TranslationService 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::Translate::V3::TranslationService::Client#list_adaptive_mt_datasets. -# -def list_adaptive_mt_datasets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.new - - # Call the list_adaptive_mt_datasets method. - result = client.list_adaptive_mt_datasets 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::Translate::V3::AdaptiveMtDataset. - p item - end -end -# [END translate_v3_generated_TranslationService_ListAdaptiveMtDatasets_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb deleted file mode 100644 index 29e1435d5606..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_files.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListAdaptiveMtFiles_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_adaptive_mt_files call in the TranslationService 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::Translate::V3::TranslationService::Client#list_adaptive_mt_files. -# -def list_adaptive_mt_files - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.new - - # Call the list_adaptive_mt_files method. - result = client.list_adaptive_mt_files 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::Translate::V3::AdaptiveMtFile. - p item - end -end -# [END translate_v3_generated_TranslationService_ListAdaptiveMtFiles_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb deleted file mode 100644 index eac68d950a17..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_adaptive_mt_sentences.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListAdaptiveMtSentences_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_adaptive_mt_sentences call in the TranslationService 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::Translate::V3::TranslationService::Client#list_adaptive_mt_sentences. -# -def list_adaptive_mt_sentences - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.new - - # Call the list_adaptive_mt_sentences method. - result = client.list_adaptive_mt_sentences 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::Translate::V3::AdaptiveMtSentence. - p item - end -end -# [END translate_v3_generated_TranslationService_ListAdaptiveMtSentences_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb deleted file mode 100644 index 5e51cd9506fe..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_datasets.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListDatasets_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_datasets call in the TranslationService 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::Translate::V3::TranslationService::Client#list_datasets. -# -def list_datasets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListDatasetsRequest.new - - # Call the list_datasets method. - result = client.list_datasets 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::Translate::V3::Dataset. - p item - end -end -# [END translate_v3_generated_TranslationService_ListDatasets_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb deleted file mode 100644 index 43332205b3b9..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_examples.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListExamples_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_examples call in the TranslationService 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::Translate::V3::TranslationService::Client#list_examples. -# -def list_examples - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListExamplesRequest.new - - # Call the list_examples method. - result = client.list_examples 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::Translate::V3::Example. - p item - end -end -# [END translate_v3_generated_TranslationService_ListExamples_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb deleted file mode 100644 index 74b3307718fb..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListGlossaries_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_glossaries call in the TranslationService 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::Translate::V3::TranslationService::Client#list_glossaries. -# -def list_glossaries - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListGlossariesRequest.new - - # Call the list_glossaries method. - result = client.list_glossaries 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::Translate::V3::Glossary. - p item - end -end -# [END translate_v3_generated_TranslationService_ListGlossaries_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb deleted file mode 100644 index f79260b875bb..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_glossary_entries.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListGlossaryEntries_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_glossary_entries call in the TranslationService 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::Translate::V3::TranslationService::Client#list_glossary_entries. -# -def list_glossary_entries - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.new - - # Call the list_glossary_entries method. - result = client.list_glossary_entries 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::Translate::V3::GlossaryEntry. - p item - end -end -# [END translate_v3_generated_TranslationService_ListGlossaryEntries_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb deleted file mode 100644 index 50a7a989b9ac..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/list_models.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_ListModels_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the list_models call in the TranslationService 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::Translate::V3::TranslationService::Client#list_models. -# -def list_models - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::ListModelsRequest.new - - # Call the list_models method. - result = client.list_models 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::Translate::V3::Model. - p item - end -end -# [END translate_v3_generated_TranslationService_ListModels_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb deleted file mode 100644 index 83a2d907ca73..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/romanize_text.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_RomanizeText_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the romanize_text call in the TranslationService 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::Translate::V3::TranslationService::Client#romanize_text. -# -def romanize_text - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::RomanizeTextRequest.new - - # Call the romanize_text method. - result = client.romanize_text request - - # The returned object is of type Google::Cloud::Translate::V3::RomanizeTextResponse. - p result -end -# [END translate_v3_generated_TranslationService_RomanizeText_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb deleted file mode 100644 index bb4283c41aa1..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_document.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_TranslateDocument_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the translate_document call in the TranslationService 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::Translate::V3::TranslationService::Client#translate_document. -# -def translate_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new - - # Call the translate_document method. - result = client.translate_document request - - # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. - p result -end -# [END translate_v3_generated_TranslationService_TranslateDocument_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb deleted file mode 100644 index 78c5e7b91c60..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/translate_text.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_TranslateText_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the translate_text call in the TranslationService 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::Translate::V3::TranslationService::Client#translate_text. -# -def translate_text - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::TranslateTextRequest.new - - # Call the translate_text method. - result = client.translate_text request - - # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. - p result -end -# [END translate_v3_generated_TranslationService_TranslateText_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb deleted file mode 100644 index fd1baaf19c5a..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_UpdateGlossary_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the update_glossary call in the TranslationService 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::Translate::V3::TranslationService::Client#update_glossary. -# -def update_glossary - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::UpdateGlossaryRequest.new - - # Call the update_glossary method. - result = client.update_glossary 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 translate_v3_generated_TranslationService_UpdateGlossary_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb b/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb deleted file mode 100644 index 8ba803b74149..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/snippets/translation_service/update_glossary_entry.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 translate_v3_generated_TranslationService_UpdateGlossaryEntry_sync] -require "google/cloud/translate/v3" - -## -# Snippet for the update_glossary_entry call in the TranslationService 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::Translate::V3::TranslationService::Client#update_glossary_entry. -# -def update_glossary_entry - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Translate::V3::TranslationService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new - - # Call the update_glossary_entry method. - result = client.update_glossary_entry request - - # The returned object is of type Google::Cloud::Translate::V3::GlossaryEntry. - p result -end -# [END translate_v3_generated_TranslationService_UpdateGlossaryEntry_sync] diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb deleted file mode 100644 index 6095a4a5cd3c..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" -require "google/cloud/translate/v3/translation_service_services_pb" -require "google/cloud/translate/v3/translation_service" - -class ::Google::Cloud::Translate::V3::TranslationService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb deleted file mode 100644 index 9f8a19eacf25..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_paths_test.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service" - -class ::Google::Cloud::Translate::V3::TranslationService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_adaptive_mt_dataset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.adaptive_mt_dataset_path project: "value0", location: "value1", dataset: "value2" - assert_equal "projects/value0/locations/value1/adaptiveMtDatasets/value2", path - end - end - - def test_adaptive_mt_file_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.adaptive_mt_file_path project: "value0", location: "value1", dataset: "value2", file: "value3" - assert_equal "projects/value0/locations/value1/adaptiveMtDatasets/value2/adaptiveMtFiles/value3", path - end - end - - def test_dataset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dataset_path project: "value0", location: "value1", dataset: "value2" - assert_equal "projects/value0/locations/value1/datasets/value2", path - end - end - - def test_glossary_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.glossary_path project: "value0", location: "value1", glossary: "value2" - assert_equal "projects/value0/locations/value1/glossaries/value2", path - end - end - - def test_glossary_entry_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.glossary_entry_path project: "value0", location: "value1", glossary: "value2", glossary_entry: "value3" - assert_equal "projects/value0/locations/value1/glossaries/value2/glossaryEntries/value3", 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::Translate::V3::TranslationService::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_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.model_path project: "value0", location: "value1", model: "value2" - assert_equal "projects/value0/locations/value1/models/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb deleted file mode 100644 index 151151e4accd..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_rest_test.rb +++ /dev/null @@ -1,2228 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" -require "google/cloud/translate/v3/translation_service/rest" - - -class ::Google::Cloud::Translate::V3::TranslationService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_translate_text - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::TranslateTextResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - contents = ["hello world"] - mime_type = "hello world" - source_language_code = "hello world" - target_language_code = "hello world" - parent = "hello world" - model = "hello world" - glossary_config = {} - transliteration_config = {} - labels = {} - - translate_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_translate_text_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, translate_text_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.translate_text contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.translate_text ::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.translate_text(::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, translate_text_client_stub.call_count - end - end - end - - def test_romanize_text - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::RomanizeTextResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - contents = ["hello world"] - source_language_code = "hello world" - - romanize_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_romanize_text_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, romanize_text_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.romanize_text parent: parent, contents: contents, source_language_code: source_language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.romanize_text ::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.romanize_text(::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, romanize_text_client_stub.call_count - end - end - end - - def test_detect_language - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::DetectLanguageResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - model = "hello world" - content = "hello world" - mime_type = "hello world" - labels = {} - - detect_language_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_detect_language_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, detect_language_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.detect_language parent: parent, model: model, content: content, mime_type: mime_type, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.detect_language ::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.detect_language(::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, detect_language_client_stub.call_count - end - end - end - - def test_get_supported_languages - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::SupportedLanguages.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - display_language_code = "hello world" - model = "hello world" - - get_supported_languages_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_supported_languages_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_supported_languages_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_supported_languages parent: parent, display_language_code: display_language_code, model: model do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_supported_languages ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_supported_languages(::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_supported_languages_client_stub.call_count - end - end - end - - def test_translate_document - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - source_language_code = "hello world" - target_language_code = "hello world" - document_input_config = {} - document_output_config = {} - model = "hello world" - glossary_config = {} - labels = {} - customized_attribution = "hello world" - is_translate_native_pdf_only = true - enable_shadow_removal_native_pdf = true - enable_rotation_correction = true - - translate_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_translate_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, translate_document_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.translate_document parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.translate_document ::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.translate_document(::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, translate_document_client_stub.call_count - end - end - end - - def test_batch_translate_text - # 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" - source_language_code = "hello world" - target_language_codes = ["hello world"] - models = {} - input_configs = [{}] - output_config = {} - glossaries = {} - labels = {} - - batch_translate_text_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_batch_translate_text_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_translate_text_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_translate_text parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_translate_text ::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_translate_text(::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_translate_text_client_stub.call_count - end - end - end - - def test_batch_translate_document - # 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" - source_language_code = "hello world" - target_language_codes = ["hello world"] - input_configs = [{}] - output_config = {} - models = {} - glossaries = {} - format_conversions = {} - customized_attribution = "hello world" - enable_shadow_removal_native_pdf = true - enable_rotation_correction = true - - batch_translate_document_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_batch_translate_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_translate_document_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_translate_document parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_translate_document ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_translate_document(::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_translate_document_client_stub.call_count - end - end - end - - def test_create_glossary - # 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" - glossary = {} - - create_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_glossary_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_glossary({ parent: parent, glossary: glossary }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_glossary parent: parent, glossary: glossary do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_glossary ::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_glossary({ parent: parent, glossary: glossary }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_glossary(::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_glossary_client_stub.call_count - end - end - end - - def test_update_glossary - # 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. - glossary = {} - update_mask = {} - - update_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_update_glossary_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_glossary({ glossary: glossary, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_glossary glossary: glossary, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_glossary ::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_glossary({ glossary: glossary, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_glossary(::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_glossary_client_stub.call_count - end - end - end - - def test_list_glossaries - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListGlossariesResponse.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_glossaries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_glossaries_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_glossaries_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_glossaries({ 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_glossaries 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_glossaries ::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries({ 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_glossaries(::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries_client_stub.call_count - end - end - end - - def test_get_glossary - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::Glossary.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_glossary_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_glossary({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_glossary name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_glossary ::Google::Cloud::Translate::V3::GetGlossaryRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_glossary({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_glossary(::Google::Cloud::Translate::V3::GetGlossaryRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_glossary_client_stub.call_count - end - end - end - - def test_delete_glossary - # 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" - - delete_glossary_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_glossary_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_glossary({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_glossary name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_glossary ::Google::Cloud::Translate::V3::DeleteGlossaryRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_glossary({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_glossary(::Google::Cloud::Translate::V3::DeleteGlossaryRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_glossary_client_stub.call_count - end - end - end - - def test_get_glossary_entry - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::GlossaryEntry.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_glossary_entry_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_glossary_entry({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_glossary_entry name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_glossary_entry ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_glossary_entry({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_glossary_entry(::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_glossary_entry_client_stub.call_count - end - end - end - - def test_list_glossary_entries - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse.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_glossary_entries_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_glossary_entries_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_glossary_entries_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_glossary_entries({ 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_glossary_entries 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_glossary_entries ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries({ 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_glossary_entries(::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries_client_stub.call_count - end - end - end - - def test_create_glossary_entry - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::GlossaryEntry.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - glossary_entry = {} - - create_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_glossary_entry_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_glossary_entry parent: parent, glossary_entry: glossary_entry do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_glossary_entry ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_glossary_entry(::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_glossary_entry_client_stub.call_count - end - end - end - - def test_update_glossary_entry - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::GlossaryEntry.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - glossary_entry = {} - - update_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_update_glossary_entry_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_glossary_entry({ glossary_entry: glossary_entry }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_glossary_entry glossary_entry: glossary_entry do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_glossary_entry ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_glossary_entry({ glossary_entry: glossary_entry }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_glossary_entry(::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_glossary_entry_client_stub.call_count - end - end - end - - def test_delete_glossary_entry - # 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_glossary_entry_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_glossary_entry_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_glossary_entry({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_glossary_entry name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_glossary_entry ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_glossary_entry({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_glossary_entry(::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_glossary_entry_client_stub.call_count - end - end - end - - def test_create_dataset - # 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" - dataset = {} - - create_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_dataset({ parent: parent, dataset: dataset }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_dataset parent: parent, dataset: dataset do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_dataset ::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_dataset({ parent: parent, dataset: dataset }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_dataset(::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_dataset_client_stub.call_count - end - end - end - - def test_get_dataset - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::Dataset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_dataset ::Google::Cloud::Translate::V3::GetDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_dataset(::Google::Cloud::Translate::V3::GetDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_dataset_client_stub.call_count - end - end - end - - def test_list_datasets - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListDatasetsResponse.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_datasets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_datasets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_datasets_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_datasets({ 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_datasets 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_datasets ::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets({ 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_datasets(::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets_client_stub.call_count - end - end - end - - def test_delete_dataset - # 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" - - delete_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_dataset ::Google::Cloud::Translate::V3::DeleteDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_dataset(::Google::Cloud::Translate::V3::DeleteDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_dataset_client_stub.call_count - end - end - end - - def test_create_adaptive_mt_dataset - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - adaptive_mt_dataset = {} - - create_adaptive_mt_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_adaptive_mt_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_adaptive_mt_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_adaptive_mt_dataset parent: parent, adaptive_mt_dataset: adaptive_mt_dataset do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_adaptive_mt_dataset ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_adaptive_mt_dataset(::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_adaptive_mt_dataset_client_stub.call_count - end - end - end - - def test_delete_adaptive_mt_dataset - # 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_adaptive_mt_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_adaptive_mt_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_adaptive_mt_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_adaptive_mt_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_adaptive_mt_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_adaptive_mt_dataset ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_adaptive_mt_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_adaptive_mt_dataset(::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_adaptive_mt_dataset_client_stub.call_count - end - end - end - - def test_get_adaptive_mt_dataset - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_adaptive_mt_dataset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_adaptive_mt_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_adaptive_mt_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_adaptive_mt_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_adaptive_mt_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_adaptive_mt_dataset ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_adaptive_mt_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_adaptive_mt_dataset(::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_adaptive_mt_dataset_client_stub.call_count - end - end - end - - def test_list_adaptive_mt_datasets - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.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_adaptive_mt_datasets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_adaptive_mt_datasets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_adaptive_mt_datasets_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_adaptive_mt_datasets({ 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_adaptive_mt_datasets 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_adaptive_mt_datasets ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets({ 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_adaptive_mt_datasets(::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets_client_stub.call_count - end - end - end - - def test_adaptive_mt_translate - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - dataset = "hello world" - content = ["hello world"] - reference_sentence_config = {} - glossary_config = {} - - adaptive_mt_translate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_adaptive_mt_translate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, adaptive_mt_translate_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.adaptive_mt_translate parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.adaptive_mt_translate ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.adaptive_mt_translate(::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, adaptive_mt_translate_client_stub.call_count - end - end - end - - def test_get_adaptive_mt_file - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::AdaptiveMtFile.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_adaptive_mt_file_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_adaptive_mt_file_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_adaptive_mt_file_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_adaptive_mt_file({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_adaptive_mt_file name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_adaptive_mt_file ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_adaptive_mt_file({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_adaptive_mt_file(::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_adaptive_mt_file_client_stub.call_count - end - end - end - - def test_delete_adaptive_mt_file - # 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_adaptive_mt_file_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_adaptive_mt_file_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_adaptive_mt_file_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_adaptive_mt_file({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_adaptive_mt_file name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_adaptive_mt_file ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_adaptive_mt_file({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_adaptive_mt_file(::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_adaptive_mt_file_client_stub.call_count - end - end - end - - def test_import_adaptive_mt_file - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - file_input_source = {} - - import_adaptive_mt_file_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_import_adaptive_mt_file_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_adaptive_mt_file_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_adaptive_mt_file parent: parent, file_input_source: file_input_source do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_adaptive_mt_file ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_adaptive_mt_file(::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_adaptive_mt_file_client_stub.call_count - end - end - end - - def test_list_adaptive_mt_files - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.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_adaptive_mt_files_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_adaptive_mt_files_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_adaptive_mt_files_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_adaptive_mt_files({ 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_adaptive_mt_files 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_adaptive_mt_files ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files({ 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_adaptive_mt_files(::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files_client_stub.call_count - end - end - end - - def test_list_adaptive_mt_sentences - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.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_adaptive_mt_sentences_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_adaptive_mt_sentences_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_adaptive_mt_sentences_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_adaptive_mt_sentences({ 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_adaptive_mt_sentences 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_adaptive_mt_sentences ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences({ 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_adaptive_mt_sentences(::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences_client_stub.call_count - end - end - end - - def test_import_data - # 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. - dataset = "hello world" - input_config = {} - - import_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_import_data_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_data_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_data({ dataset: dataset, input_config: input_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_data dataset: dataset, input_config: input_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_data ::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_data({ dataset: dataset, input_config: input_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_data(::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_data_client_stub.call_count - end - end - end - - def test_export_data - # 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. - dataset = "hello world" - output_config = {} - - export_data_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_export_data_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_data_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_data({ dataset: dataset, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_data dataset: dataset, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_data ::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_data({ dataset: dataset, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_data(::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_data_client_stub.call_count - end - end - end - - def test_list_examples - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListExamplesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_examples_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_examples_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_examples_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_examples({ parent: parent, 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_examples parent: parent, 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_examples ::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples({ parent: parent, 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_examples(::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples_client_stub.call_count - end - end - end - - def test_create_model - # 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" - model = {} - - create_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_create_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_model_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_model({ parent: parent, model: model }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_model parent: parent, model: model do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_model ::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_model({ parent: parent, model: model }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_model(::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_model_client_stub.call_count - end - end - end - - def test_list_models - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::ListModelsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_models_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_list_models_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_models_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_models({ parent: parent, 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_models parent: parent, 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_models ::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models({ parent: parent, 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_models(::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models_client_stub.call_count - end - end - end - - def test_get_model - # Create test objects. - client_result = ::Google::Cloud::Translate::V3::Model.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_get_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_model_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_model ::Google::Cloud::Translate::V3::GetModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_model(::Google::Cloud::Translate::V3::GetModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_model_client_stub.call_count - end - end - end - - def test_delete_model - # 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" - - delete_model_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Translate::V3::TranslationService::Rest::ServiceStub.stub :transcode_delete_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_model_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_model ::Google::Cloud::Translate::V3::DeleteModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_model(::Google::Cloud::Translate::V3::DeleteModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_model_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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb b/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb deleted file mode 100644 index 26223607f22b..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/google/cloud/translate/v3/translation_service_test.rb +++ /dev/null @@ -1,2575 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate/v3/translation_service_pb" -require "google/cloud/translate/v3/translation_service" - -class ::Google::Cloud::Translate::V3::TranslationService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_translate_text - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::TranslateTextResponse.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. - contents = ["hello world"] - mime_type = "hello world" - source_language_code = "hello world" - target_language_code = "hello world" - parent = "hello world" - model = "hello world" - glossary_config = {} - transliteration_config = {} - labels = {} - - translate_text_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :translate_text, name - assert_kind_of ::Google::Cloud::Translate::V3::TranslateTextRequest, request - assert_equal ["hello world"], request["contents"] - assert_equal "hello world", request["mime_type"] - assert_equal "hello world", request["source_language_code"] - assert_equal "hello world", request["target_language_code"] - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["model"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig), request["glossary_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::TransliterationConfig), request["transliteration_config"] - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, translate_text_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.translate_text contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.translate_text ::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.translate_text({ contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.translate_text(::Google::Cloud::Translate::V3::TranslateTextRequest.new(contents: contents, mime_type: mime_type, source_language_code: source_language_code, target_language_code: target_language_code, parent: parent, model: model, glossary_config: glossary_config, transliteration_config: transliteration_config, labels: labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, translate_text_client_stub.call_rpc_count - end - end - - def test_romanize_text - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::RomanizeTextResponse.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" - contents = ["hello world"] - source_language_code = "hello world" - - romanize_text_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :romanize_text, name - assert_kind_of ::Google::Cloud::Translate::V3::RomanizeTextRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["contents"] - assert_equal "hello world", request["source_language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, romanize_text_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.romanize_text parent: parent, contents: contents, source_language_code: source_language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.romanize_text ::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.romanize_text({ parent: parent, contents: contents, source_language_code: source_language_code }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.romanize_text(::Google::Cloud::Translate::V3::RomanizeTextRequest.new(parent: parent, contents: contents, source_language_code: source_language_code), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, romanize_text_client_stub.call_rpc_count - end - end - - def test_detect_language - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::DetectLanguageResponse.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" - model = "hello world" - content = "hello world" - mime_type = "hello world" - labels = {} - - detect_language_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :detect_language, name - assert_kind_of ::Google::Cloud::Translate::V3::DetectLanguageRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["model"] - assert_equal "hello world", request["content"] - assert_equal :content, request.source - assert_equal "hello world", request["mime_type"] - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, detect_language_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.detect_language parent: parent, model: model, content: content, mime_type: mime_type, labels: labels do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.detect_language ::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.detect_language({ parent: parent, model: model, content: content, mime_type: mime_type, labels: labels }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.detect_language(::Google::Cloud::Translate::V3::DetectLanguageRequest.new(parent: parent, model: model, content: content, mime_type: mime_type, labels: labels), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, detect_language_client_stub.call_rpc_count - end - end - - def test_get_supported_languages - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::SupportedLanguages.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" - display_language_code = "hello world" - model = "hello world" - - get_supported_languages_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_supported_languages, name - assert_kind_of ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["display_language_code"] - assert_equal "hello world", request["model"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_supported_languages_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_supported_languages parent: parent, display_language_code: display_language_code, model: model do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_supported_languages ::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_supported_languages({ parent: parent, display_language_code: display_language_code, model: model }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_supported_languages(::Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new(parent: parent, display_language_code: display_language_code, model: model), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_supported_languages_client_stub.call_rpc_count - end - end - - def test_translate_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::TranslateDocumentResponse.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" - source_language_code = "hello world" - target_language_code = "hello world" - document_input_config = {} - document_output_config = {} - model = "hello world" - glossary_config = {} - labels = {} - customized_attribution = "hello world" - is_translate_native_pdf_only = true - enable_shadow_removal_native_pdf = true - enable_rotation_correction = true - - translate_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :translate_document, name - assert_kind_of ::Google::Cloud::Translate::V3::TranslateDocumentRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["source_language_code"] - assert_equal "hello world", request["target_language_code"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DocumentInputConfig), request["document_input_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DocumentOutputConfig), request["document_output_config"] - assert_equal "hello world", request["model"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::TranslateTextGlossaryConfig), request["glossary_config"] - assert_equal({}, request["labels"].to_h) - assert_equal "hello world", request["customized_attribution"] - assert_equal true, request["is_translate_native_pdf_only"] - assert_equal true, request["enable_shadow_removal_native_pdf"] - assert_equal true, request["enable_rotation_correction"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, translate_document_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.translate_document parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.translate_document ::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.translate_document({ parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.translate_document(::Google::Cloud::Translate::V3::TranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_code: target_language_code, document_input_config: document_input_config, document_output_config: document_output_config, model: model, glossary_config: glossary_config, labels: labels, customized_attribution: customized_attribution, is_translate_native_pdf_only: is_translate_native_pdf_only, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, translate_document_client_stub.call_rpc_count - end - end - - def test_batch_translate_text - # 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" - source_language_code = "hello world" - target_language_codes = ["hello world"] - models = {} - input_configs = [{}] - output_config = {} - glossaries = {} - labels = {} - - batch_translate_text_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_translate_text, name - assert_kind_of ::Google::Cloud::Translate::V3::BatchTranslateTextRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["source_language_code"] - assert_equal ["hello world"], request["target_language_codes"] - assert_equal({}, request["models"].to_h) - assert_kind_of ::Google::Cloud::Translate::V3::InputConfig, request["input_configs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::OutputConfig), request["output_config"] - assert_equal({}, request["glossaries"].to_h) - assert_equal({}, request["labels"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_translate_text_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }) 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.batch_translate_text parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels 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.batch_translate_text ::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels) 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.batch_translate_text({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels }, 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.batch_translate_text(::Google::Cloud::Translate::V3::BatchTranslateTextRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, models: models, input_configs: input_configs, output_config: output_config, glossaries: glossaries, labels: labels), 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, batch_translate_text_client_stub.call_rpc_count - end - end - - def test_batch_translate_document - # 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" - source_language_code = "hello world" - target_language_codes = ["hello world"] - input_configs = [{}] - output_config = {} - models = {} - glossaries = {} - format_conversions = {} - customized_attribution = "hello world" - enable_shadow_removal_native_pdf = true - enable_rotation_correction = true - - batch_translate_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_translate_document, name - assert_kind_of ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["source_language_code"] - assert_equal ["hello world"], request["target_language_codes"] - assert_kind_of ::Google::Cloud::Translate::V3::BatchDocumentInputConfig, request["input_configs"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::BatchDocumentOutputConfig), request["output_config"] - assert_equal({}, request["models"].to_h) - assert_equal({}, request["glossaries"].to_h) - assert_equal({}, request["format_conversions"].to_h) - assert_equal "hello world", request["customized_attribution"] - assert_equal true, request["enable_shadow_removal_native_pdf"] - assert_equal true, request["enable_rotation_correction"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_translate_document_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }) 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.batch_translate_document parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction 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.batch_translate_document ::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction) 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.batch_translate_document({ parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction }, 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.batch_translate_document(::Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new(parent: parent, source_language_code: source_language_code, target_language_codes: target_language_codes, input_configs: input_configs, output_config: output_config, models: models, glossaries: glossaries, format_conversions: format_conversions, customized_attribution: customized_attribution, enable_shadow_removal_native_pdf: enable_shadow_removal_native_pdf, enable_rotation_correction: enable_rotation_correction), 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, batch_translate_document_client_stub.call_rpc_count - end - end - - def test_create_glossary - # 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" - glossary = {} - - create_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_glossary, name - assert_kind_of ::Google::Cloud::Translate::V3::CreateGlossaryRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Glossary), request["glossary"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_glossary({ parent: parent, glossary: glossary }) 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_glossary parent: parent, glossary: glossary 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_glossary ::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary) 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_glossary({ parent: parent, glossary: glossary }, 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_glossary(::Google::Cloud::Translate::V3::CreateGlossaryRequest.new(parent: parent, glossary: glossary), 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_glossary_client_stub.call_rpc_count - end - end - - def test_update_glossary - # 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. - glossary = {} - update_mask = {} - - update_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_glossary, name - assert_kind_of ::Google::Cloud::Translate::V3::UpdateGlossaryRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Glossary), request["glossary"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_glossary({ glossary: glossary, update_mask: update_mask }) 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_glossary glossary: glossary, update_mask: update_mask 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_glossary ::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask) 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_glossary({ glossary: glossary, update_mask: update_mask }, 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_glossary(::Google::Cloud::Translate::V3::UpdateGlossaryRequest.new(glossary: glossary, update_mask: update_mask), 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_glossary_client_stub.call_rpc_count - end - end - - def test_list_glossaries - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListGlossariesResponse.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_glossaries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_glossaries, name - assert_kind_of ::Google::Cloud::Translate::V3::ListGlossariesRequest, 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_glossaries_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_glossaries({ 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_glossaries 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_glossaries ::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries({ 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_glossaries(::Google::Cloud::Translate::V3::ListGlossariesRequest.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_glossaries_client_stub.call_rpc_count - end - end - - def test_get_glossary - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::Glossary.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_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_glossary, name - assert_kind_of ::Google::Cloud::Translate::V3::GetGlossaryRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_glossary({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_glossary name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_glossary ::Google::Cloud::Translate::V3::GetGlossaryRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_glossary({ 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_glossary(::Google::Cloud::Translate::V3::GetGlossaryRequest.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_glossary_client_stub.call_rpc_count - end - end - - def test_delete_glossary - # 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" - - delete_glossary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_glossary, name - assert_kind_of ::Google::Cloud::Translate::V3::DeleteGlossaryRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_glossary_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_glossary({ 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.delete_glossary 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.delete_glossary ::Google::Cloud::Translate::V3::DeleteGlossaryRequest.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.delete_glossary({ 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.delete_glossary(::Google::Cloud::Translate::V3::DeleteGlossaryRequest.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, delete_glossary_client_stub.call_rpc_count - end - end - - def test_get_glossary_entry - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::GlossaryEntry.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_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_glossary_entry, name - assert_kind_of ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_glossary_entry({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_glossary_entry name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_glossary_entry ::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_glossary_entry({ 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_glossary_entry(::Google::Cloud::Translate::V3::GetGlossaryEntryRequest.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_glossary_entry_client_stub.call_rpc_count - end - end - - def test_list_glossary_entries - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListGlossaryEntriesResponse.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_glossary_entries_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_glossary_entries, name - assert_kind_of ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest, 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_glossary_entries_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_glossary_entries({ 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_glossary_entries 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_glossary_entries ::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries({ 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_glossary_entries(::Google::Cloud::Translate::V3::ListGlossaryEntriesRequest.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_glossary_entries_client_stub.call_rpc_count - end - end - - def test_create_glossary_entry - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::GlossaryEntry.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" - glossary_entry = {} - - create_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_glossary_entry, name - assert_kind_of ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::GlossaryEntry), request["glossary_entry"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_glossary_entry parent: parent, glossary_entry: glossary_entry do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_glossary_entry ::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_glossary_entry({ parent: parent, glossary_entry: glossary_entry }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_glossary_entry(::Google::Cloud::Translate::V3::CreateGlossaryEntryRequest.new(parent: parent, glossary_entry: glossary_entry), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_glossary_entry_client_stub.call_rpc_count - end - end - - def test_update_glossary_entry - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::GlossaryEntry.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. - glossary_entry = {} - - update_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_glossary_entry, name - assert_kind_of ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::GlossaryEntry), request["glossary_entry"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_glossary_entry({ glossary_entry: glossary_entry }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_glossary_entry glossary_entry: glossary_entry do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_glossary_entry ::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_glossary_entry({ glossary_entry: glossary_entry }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_glossary_entry(::Google::Cloud::Translate::V3::UpdateGlossaryEntryRequest.new(glossary_entry: glossary_entry), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_glossary_entry_client_stub.call_rpc_count - end - end - - def test_delete_glossary_entry - # 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_glossary_entry_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_glossary_entry, name - assert_kind_of ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_glossary_entry_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_glossary_entry({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_glossary_entry name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_glossary_entry ::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_glossary_entry({ 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_glossary_entry(::Google::Cloud::Translate::V3::DeleteGlossaryEntryRequest.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_glossary_entry_client_stub.call_rpc_count - end - end - - def test_create_dataset - # 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" - dataset = {} - - create_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_dataset, name - assert_kind_of ::Google::Cloud::Translate::V3::CreateDatasetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Dataset), request["dataset"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_dataset({ parent: parent, dataset: dataset }) 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_dataset parent: parent, dataset: dataset 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_dataset ::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset) 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_dataset({ parent: parent, dataset: dataset }, 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_dataset(::Google::Cloud::Translate::V3::CreateDatasetRequest.new(parent: parent, dataset: dataset), 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_dataset_client_stub.call_rpc_count - end - end - - def test_get_dataset - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::Dataset.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_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_dataset, name - assert_kind_of ::Google::Cloud::Translate::V3::GetDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_dataset({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_dataset name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_dataset ::Google::Cloud::Translate::V3::GetDatasetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_dataset({ 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_dataset(::Google::Cloud::Translate::V3::GetDatasetRequest.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_dataset_client_stub.call_rpc_count - end - end - - def test_list_datasets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListDatasetsResponse.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_datasets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_datasets, name - assert_kind_of ::Google::Cloud::Translate::V3::ListDatasetsRequest, 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_datasets_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_datasets({ 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_datasets 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_datasets ::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets({ 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_datasets(::Google::Cloud::Translate::V3::ListDatasetsRequest.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_datasets_client_stub.call_rpc_count - end - end - - def test_delete_dataset - # 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" - - delete_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_dataset, name - assert_kind_of ::Google::Cloud::Translate::V3::DeleteDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_dataset({ 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.delete_dataset 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.delete_dataset ::Google::Cloud::Translate::V3::DeleteDatasetRequest.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.delete_dataset({ 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.delete_dataset(::Google::Cloud::Translate::V3::DeleteDatasetRequest.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, delete_dataset_client_stub.call_rpc_count - end - end - - def test_create_adaptive_mt_dataset - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.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" - adaptive_mt_dataset = {} - - create_adaptive_mt_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_adaptive_mt_dataset, name - assert_kind_of ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::AdaptiveMtDataset), request["adaptive_mt_dataset"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_adaptive_mt_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_adaptive_mt_dataset parent: parent, adaptive_mt_dataset: adaptive_mt_dataset do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_adaptive_mt_dataset ::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_adaptive_mt_dataset({ parent: parent, adaptive_mt_dataset: adaptive_mt_dataset }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_adaptive_mt_dataset(::Google::Cloud::Translate::V3::CreateAdaptiveMtDatasetRequest.new(parent: parent, adaptive_mt_dataset: adaptive_mt_dataset), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_adaptive_mt_dataset_client_stub.call_rpc_count - end - end - - def test_delete_adaptive_mt_dataset - # 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_adaptive_mt_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_adaptive_mt_dataset, name - assert_kind_of ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_adaptive_mt_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_adaptive_mt_dataset({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_adaptive_mt_dataset name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_adaptive_mt_dataset ::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_adaptive_mt_dataset({ 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_adaptive_mt_dataset(::Google::Cloud::Translate::V3::DeleteAdaptiveMtDatasetRequest.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_adaptive_mt_dataset_client_stub.call_rpc_count - end - end - - def test_get_adaptive_mt_dataset - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtDataset.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_adaptive_mt_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_adaptive_mt_dataset, name - assert_kind_of ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_adaptive_mt_dataset_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_adaptive_mt_dataset({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_adaptive_mt_dataset name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_adaptive_mt_dataset ::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_adaptive_mt_dataset({ 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_adaptive_mt_dataset(::Google::Cloud::Translate::V3::GetAdaptiveMtDatasetRequest.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_adaptive_mt_dataset_client_stub.call_rpc_count - end - end - - def test_list_adaptive_mt_datasets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsResponse.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_adaptive_mt_datasets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_adaptive_mt_datasets, name - assert_kind_of ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest, 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_adaptive_mt_datasets_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_adaptive_mt_datasets({ 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_adaptive_mt_datasets 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_adaptive_mt_datasets ::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets({ 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_adaptive_mt_datasets(::Google::Cloud::Translate::V3::ListAdaptiveMtDatasetsRequest.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_adaptive_mt_datasets_client_stub.call_rpc_count - end - end - - def test_adaptive_mt_translate - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtTranslateResponse.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" - dataset = "hello world" - content = ["hello world"] - reference_sentence_config = {} - glossary_config = {} - - adaptive_mt_translate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :adaptive_mt_translate, name - assert_kind_of ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["dataset"] - assert_equal ["hello world"], request["content"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::ReferenceSentenceConfig), request["reference_sentence_config"] - assert request.has_reference_sentence_config? - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest::GlossaryConfig), request["glossary_config"] - assert request.has_glossary_config? - refute_nil options - end - - Gapic::ServiceStub.stub :new, adaptive_mt_translate_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.adaptive_mt_translate parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.adaptive_mt_translate ::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.adaptive_mt_translate({ parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.adaptive_mt_translate(::Google::Cloud::Translate::V3::AdaptiveMtTranslateRequest.new(parent: parent, dataset: dataset, content: content, reference_sentence_config: reference_sentence_config, glossary_config: glossary_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, adaptive_mt_translate_client_stub.call_rpc_count - end - end - - def test_get_adaptive_mt_file - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::AdaptiveMtFile.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_adaptive_mt_file_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_adaptive_mt_file, name - assert_kind_of ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_adaptive_mt_file_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_adaptive_mt_file({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_adaptive_mt_file name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_adaptive_mt_file ::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_adaptive_mt_file({ 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_adaptive_mt_file(::Google::Cloud::Translate::V3::GetAdaptiveMtFileRequest.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_adaptive_mt_file_client_stub.call_rpc_count - end - end - - def test_delete_adaptive_mt_file - # 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_adaptive_mt_file_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_adaptive_mt_file, name - assert_kind_of ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_adaptive_mt_file_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_adaptive_mt_file({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_adaptive_mt_file name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_adaptive_mt_file ::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_adaptive_mt_file({ 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_adaptive_mt_file(::Google::Cloud::Translate::V3::DeleteAdaptiveMtFileRequest.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_adaptive_mt_file_client_stub.call_rpc_count - end - end - - def test_import_adaptive_mt_file - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileResponse.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" - file_input_source = {} - - import_adaptive_mt_file_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_adaptive_mt_file, name - assert_kind_of ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::FileInputSource), request["file_input_source"] - assert_equal :file_input_source, request.source - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_adaptive_mt_file_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_adaptive_mt_file parent: parent, file_input_source: file_input_source do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_adaptive_mt_file ::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_adaptive_mt_file({ parent: parent, file_input_source: file_input_source }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_adaptive_mt_file(::Google::Cloud::Translate::V3::ImportAdaptiveMtFileRequest.new(parent: parent, file_input_source: file_input_source), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_adaptive_mt_file_client_stub.call_rpc_count - end - end - - def test_list_adaptive_mt_files - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesResponse.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_adaptive_mt_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_adaptive_mt_files, name - assert_kind_of ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest, 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_adaptive_mt_files_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_adaptive_mt_files({ 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_adaptive_mt_files 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_adaptive_mt_files ::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files({ 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_adaptive_mt_files(::Google::Cloud::Translate::V3::ListAdaptiveMtFilesRequest.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_adaptive_mt_files_client_stub.call_rpc_count - end - end - - def test_list_adaptive_mt_sentences - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesResponse.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_adaptive_mt_sentences_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_adaptive_mt_sentences, name - assert_kind_of ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest, 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_adaptive_mt_sentences_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_adaptive_mt_sentences({ 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_adaptive_mt_sentences 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_adaptive_mt_sentences ::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences({ 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_adaptive_mt_sentences(::Google::Cloud::Translate::V3::ListAdaptiveMtSentencesRequest.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_adaptive_mt_sentences_client_stub.call_rpc_count - end - end - - def test_import_data - # 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. - dataset = "hello world" - input_config = {} - - import_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_data, name - assert_kind_of ::Google::Cloud::Translate::V3::ImportDataRequest, request - assert_equal "hello world", request["dataset"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DatasetInputConfig), request["input_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_data_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_data({ dataset: dataset, input_config: input_config }) 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.import_data dataset: dataset, input_config: input_config 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.import_data ::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config) 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.import_data({ dataset: dataset, input_config: input_config }, 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.import_data(::Google::Cloud::Translate::V3::ImportDataRequest.new(dataset: dataset, input_config: input_config), 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, import_data_client_stub.call_rpc_count - end - end - - def test_export_data - # 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. - dataset = "hello world" - output_config = {} - - export_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_data, name - assert_kind_of ::Google::Cloud::Translate::V3::ExportDataRequest, request - assert_equal "hello world", request["dataset"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::DatasetOutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_data_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_data({ dataset: dataset, output_config: output_config }) 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.export_data dataset: dataset, output_config: output_config 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.export_data ::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config) 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.export_data({ dataset: dataset, output_config: output_config }, 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.export_data(::Google::Cloud::Translate::V3::ExportDataRequest.new(dataset: dataset, output_config: output_config), 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, export_data_client_stub.call_rpc_count - end - end - - def test_list_examples - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListExamplesResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_examples_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_examples, name - assert_kind_of ::Google::Cloud::Translate::V3::ListExamplesRequest, request - assert_equal "hello world", request["parent"] - 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_examples_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_examples({ parent: parent, 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_examples parent: parent, 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_examples ::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples({ parent: parent, 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_examples(::Google::Cloud::Translate::V3::ListExamplesRequest.new(parent: parent, 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_examples_client_stub.call_rpc_count - end - end - - def test_create_model - # 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" - model = {} - - create_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_model, name - assert_kind_of ::Google::Cloud::Translate::V3::CreateModelRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Translate::V3::Model), request["model"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_model_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_model({ parent: parent, model: model }) 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_model parent: parent, model: model 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_model ::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model) 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_model({ parent: parent, model: model }, 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_model(::Google::Cloud::Translate::V3::CreateModelRequest.new(parent: parent, model: model), 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_model_client_stub.call_rpc_count - end - end - - def test_list_models - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::ListModelsResponse.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" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_models, name - assert_kind_of ::Google::Cloud::Translate::V3::ListModelsRequest, request - assert_equal "hello world", request["parent"] - 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_models_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_models({ parent: parent, 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_models parent: parent, 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_models ::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models({ parent: parent, 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_models(::Google::Cloud::Translate::V3::ListModelsRequest.new(parent: parent, 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_models_client_stub.call_rpc_count - end - end - - def test_get_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::Translate::V3::Model.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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_model, name - assert_kind_of ::Google::Cloud::Translate::V3::GetModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_model_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_model({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_model name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_model ::Google::Cloud::Translate::V3::GetModelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_model({ 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_model(::Google::Cloud::Translate::V3::GetModelRequest.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_model_client_stub.call_rpc_count - end - end - - def test_delete_model - # 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" - - delete_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_model, name - assert_kind_of ::Google::Cloud::Translate::V3::DeleteModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_model_client_stub do - # Create client - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_model({ 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.delete_model 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.delete_model ::Google::Cloud::Translate::V3::DeleteModelRequest.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.delete_model({ 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.delete_model(::Google::Cloud::Translate::V3::DeleteModelRequest.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, delete_model_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::Translate::V3::TranslationService::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::Translate::V3::TranslationService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Translate::V3::TranslationService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Translate::V3::TranslationService::Client, client - assert_equal creds, client.configure.credentials - end - 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::Translate::V3::TranslationService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Translate::V3::TranslationService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-translate-v3/test/helper.rb b/owl-bot-staging/google-cloud-translate-v3/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-translate-v3/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-translate/.gitignore b/owl-bot-staging/google-cloud-translate/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-translate/.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-translate/.repo-metadata.json b/owl-bot-staging/google-cloud-translate/.repo-metadata.json deleted file mode 100644 index 154a425c46de..000000000000 --- a/owl-bot-staging/google-cloud-translate/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "translate.googleapis.com", - "api_shortname": "translate", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-translate/latest", - "distribution_name": "google-cloud-translate", - "is_cloud": true, - "language": "ruby", - "name": "translate", - "name_pretty": "Cloud Translation API", - "product_documentation": "https://cloud.google.com/translate", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service.", - "ruby-cloud-env-prefix": "TRANSLATE", - "ruby-cloud-product-url": "https://cloud.google.com/translate", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-translate/.rubocop.yml b/owl-bot-staging/google-cloud-translate/.rubocop.yml deleted file mode 100644 index e177fd4a3c2a..000000000000 --- a/owl-bot-staging/google-cloud-translate/.rubocop.yml +++ /dev/null @@ -1,39 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-translate.gemspec" - - "Rakefile" - - "acceptance/**/*" - - "test/**/*" - -Bundler/OrderedGems: - Enabled: false -Documentation: - Enabled: false -Layout/LineLength: - Enabled: false -Metrics/BlockLength: - Exclude: - - "samples/**/acceptance/*.rb" -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/FileName: - Exclude: - - "lib/google-cloud-translate.rb" - -Style/BlockDelimiters: - Exclude: - - "samples/**/acceptance/*.rb" diff --git a/owl-bot-staging/google-cloud-translate/.toys.rb b/owl-bot-staging/google-cloud-translate/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-translate/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-translate/.yardopts b/owl-bot-staging/google-cloud-translate/.yardopts deleted file mode 100644 index d6eb6631a4e5..000000000000 --- a/owl-bot-staging/google-cloud-translate/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Translation API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -- -README.md -AUTHENTICATION.md -MIGRATING.md -LICENSE.md diff --git a/owl-bot-staging/google-cloud-translate/AUTHENTICATION.md b/owl-bot-staging/google-cloud-translate/AUTHENTICATION.md deleted file mode 100644 index caba11945d31..000000000000 --- a/owl-bot-staging/google-cloud-translate/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-translate 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-translate 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/translate" - -client = Google::Cloud::Translate.translation_service do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/translate" - -Google::Cloud::Translate.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = Google::Cloud::Translate.translation_service -``` - -### 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-translate -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/translate" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = Google::Cloud::Translate.translation_service -``` - -### 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-translate/CHANGELOG.md b/owl-bot-staging/google-cloud-translate/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-translate/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-translate/Gemfile b/owl-bot-staging/google-cloud-translate/Gemfile deleted file mode 100644 index fa5bdac7584b..000000000000 --- a/owl-bot-staging/google-cloud-translate/Gemfile +++ /dev/null @@ -1,28 +0,0 @@ -source "https://rubygems.org" - -gemspec - -local_dependencies = ["google-cloud-translate-v2", "google-cloud-translate-v3"] - -main_spec = gemspecs.last || Bundler.load_gemspec(File.join(__dir__, "google-cloud-translate.gemspec")) -local_dependencies.each do |name| - spec_path = File.expand_path "../#{name}/#{name}.gemspec", __dir__ - unless File.file? spec_path - warn "WARNING: Disabled local dependency for #{name} because gemspec not found." - next - end - version = Bundler.load_gemspec(spec_path).version - if main_spec.dependencies.any? { |dep| dep.name == name && !dep.requirement.satisfied_by?(version) } - warn "WARNING: Disabled local dependency for #{name} because the gemspec disallows version #{version}." - next - end - gem name, path: "../#{name}" -end - -gem "google-style", "~> 1.30.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-translate/LICENSE.md b/owl-bot-staging/google-cloud-translate/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-translate/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-translate/README.md b/owl-bot-staging/google-cloud-translate/README.md deleted file mode 100644 index 04a095eab92e..000000000000 --- a/owl-bot-staging/google-cloud-translate/README.md +++ /dev/null @@ -1,152 +0,0 @@ -# Ruby Client for the Cloud Translation API - -API Client library for the Cloud Translation API - -Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service. - -Actual client classes for the various versions of this API are defined in -_versioned_ client gems, with names of the form `google-cloud-translate-v*`. -The gem `google-cloud-translate` is the main client library that brings the -versioned gems in as dependencies, and provides high-level methods for -constructing clients. More information on versioned clients can be found below -in the section titled *Which client should I use?*. - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-translate/latest) -for this library, google-cloud-translate, to see the convenience methods for -constructing client objects. Reference documentation for the client objects -themselves can be found in the client library documentation for the versioned -client gems: -[google-cloud-translate-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v2/latest), -[google-cloud-translate-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest). - -See also the [Product Documentation](https://cloud.google.com/translate) -for more usage information. - -## Quick Start - -``` -$ gem install google-cloud-translate -``` - -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/translate.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -```ruby -require "google/cloud/translate" - -client = Google::Cloud::Translate.translation_service -request = ::Google::Cloud::Translate::V3::TranslateTextRequest.new # (request fields as keyword arguments...) -response = client.translate_text request -``` - -## Migrating from 2.x versions - -The 3.0 release of the google-cloud-translate client is a significant upgrade -based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby), -and includes substantial interface changes. Existing code written for earlier -versions of this library will likely require updates to use this version. -See the {file:MIGRATING.md MIGRATING.md} document for more information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -Debug logging also requires that the versioned clients for this service be -sufficiently recent, released after about Dec 10, 2024. If logging is not -working, try updating the versioned clients in your bundle or installed gems: -[google-cloud-translate-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v2/latest), -[google-cloud-translate-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -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-translate`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-translate-v2`. -_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-translate`. -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-translate-v2`. - -### 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-translate/Rakefile b/owl-bot-staging/google-cloud-translate/Rakefile deleted file mode 100644 index fb853337ba0f..000000000000 --- a/owl-bot-staging/google-cloud-translate/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 = true -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-translate acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["TRANSLATE_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["TRANSLATE_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["TRANSLATE_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 TRANSLATE_TEST_PROJECT=test123 TRANSLATE_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/translate/v3/translation_service/credentials" - ::Google::Cloud::Translate::V3::TranslationService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["TRANSLATE_PROJECT"] = project - ENV["TRANSLATE_TEST_PROJECT"] = project - ENV["TRANSLATE_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-translate 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-translate 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-translate 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-translate gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-translate" - header "google-cloud-translate rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-translate yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-translate 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-translate 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-translate 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-translate/google-cloud-translate.gemspec b/owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec deleted file mode 100644 index 16c18170ada6..000000000000 --- a/owl-bot-staging/google-cloud-translate/google-cloud-translate.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/translate/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-translate" - gem.version = Google::Cloud::Translate::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service." - gem.summary = "API Client library for the Cloud Translation API" - 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") + - ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts", "MIGRATING.md"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.0" - - gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-translate-v2", ">= 0.0", "< 2.a" - gem.add_dependency "google-cloud-translate-v3", ">= 0.11", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb b/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb deleted file mode 100644 index 60bfba5fe0f8..000000000000 --- a/owl-bot-staging/google-cloud-translate/lib/google-cloud-translate.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/translate" unless defined? Google::Cloud::Translate::VERSION diff --git a/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb deleted file mode 100644 index cd1decafa120..000000000000 --- a/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate.rb +++ /dev/null @@ -1,156 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 this file early so that the version constant gets defined before -# requiring "google/cloud". This is because google-cloud-core will load the -# entrypoint (gem name) file, which in turn re-requires this file (hence -# causing a require cycle) unless the version constant is already defined. -require "google/cloud/translate/version" - -require "googleauth" -gem "google-cloud-core" -require "google/cloud" unless defined? ::Google::Cloud.new -require "google/cloud/config" - -# Set the default configuration -::Google::Cloud.configure.add_config! :translate do |config| - config.add_field! :endpoint, nil, match: ::String - config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] - config.add_field! :scope, nil, match: [::Array, ::String] - config.add_field! :lib_name, nil, match: ::String - config.add_field! :lib_version, nil, match: ::String - config.add_field! :interceptors, nil, match: ::Array - config.add_field! :timeout, nil, match: ::Numeric - config.add_field! :metadata, nil, match: ::Hash - config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] - config.add_field! :quota_project, nil, match: ::String - config.add_field! :universe_domain, nil, match: ::String -end - -module Google - module Cloud - module Translate - ## - # Create a new client object for TranslationService. - # - # By default, this returns an instance of - # [Google::Cloud::Translate::V3::TranslationService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest/Google-Cloud-Translate-V3-TranslationService-Client) - # for a gRPC client for version V3 of the API. - # However, you can specify a different API version by passing it in the - # `version` parameter. If the TranslationService service is - # supported by that API version, and the corresponding gem is available, the - # appropriate versioned client will be returned. - # You can also specify a different transport by passing `:rest` or `:grpc` in - # the `transport` parameter. - # - # Raises an exception if the currently installed versioned client gem for the - # given API version does not support the given transport of the TranslationService service. - # You can determine whether the method will succeed by calling - # {Google::Cloud::Translate.translation_service_available?}. - # - # ## About TranslationService - # - # Provides natural language translation operations. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [::Object] A client object for the specified version. - # - def self.translation_service version: :v3, transport: :grpc, &block - require "google/cloud/translate/#{version.to_s.downcase}" - - package_name = Google::Cloud::Translate - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - service_module = Google::Cloud::Translate.const_get(package_name).const_get(:TranslationService) - service_module = service_module.const_get(:Rest) if transport == :rest - service_module.const_get(:Client).new(&block) - end - - ## - # Determines whether the TranslationService service is supported by the current client. - # If true, you can retrieve a client object by calling {Google::Cloud::Translate.translation_service}. - # If false, that method will raise an exception. This could happen if the given - # API version does not exist or does not support the TranslationService service, - # or if the versioned client gem needs an update to support the TranslationService service. - # - # @param version [::String, ::Symbol] The API version to connect to. Optional. - # Defaults to `:v3`. - # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`. - # @return [boolean] Whether the service is available. - # - def self.translation_service_available? version: :v3, transport: :grpc - require "google/cloud/translate/#{version.to_s.downcase}" - package_name = Google::Cloud::Translate - .constants - .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } - .first - return false unless package_name - service_module = Google::Cloud::Translate.const_get package_name - return false unless service_module.const_defined? :TranslationService - service_module = service_module.const_get :TranslationService - if transport == :rest - return false unless service_module.const_defined? :Rest - service_module = service_module.const_get :Rest - end - service_module.const_defined? :Client - rescue ::LoadError - false - end - - ## - # Configure the google-cloud-translate library. - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # 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 [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - yield ::Google::Cloud.configure.translate if block_given? - - ::Google::Cloud.configure.translate - end - end - end -end - -helper_path = ::File.join __dir__, "translate", "helpers.rb" -require "google/cloud/translate/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb b/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb deleted file mode 100644 index 316956ce38b6..000000000000 --- a/owl-bot-staging/google-cloud-translate/lib/google/cloud/translate/version.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Translate - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb b/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb deleted file mode 100644 index 7c39809ff7a3..000000000000 --- a/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/client_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/translate" -require "gapic/common" -require "gapic/grpc" -require "gapic/rest" - -class Google::Cloud::Translate::ClientConstructionMinitest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_translation_service_grpc - skip unless Google::Cloud::Translate.translation_service_available? transport: :grpc - Gapic::ServiceStub.stub :new, DummyStub.new do - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - client = Google::Cloud::Translate.translation_service transport: :grpc do |config| - config.credentials = grpc_channel - end - assert_kind_of Google::Cloud::Translate::V3::TranslationService::Client, client - end - end - - def test_translation_service_rest - skip unless Google::Cloud::Translate.translation_service_available? transport: :rest - Gapic::Rest::ClientStub.stub :new, DummyStub.new do - client = Google::Cloud::Translate.translation_service transport: :rest do |config| - config.credentials = :dummy_credentials - end - assert_kind_of Google::Cloud::Translate::V3::TranslationService::Rest::Client, client - end - end -end diff --git a/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb b/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb deleted file mode 100644 index 3b69563e0077..000000000000 --- a/owl-bot-staging/google-cloud-translate/test/google/cloud/translate/version_test.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 "google/cloud/translate/version" - -class Google::Cloud::Translate::VersionMinitest < Minitest::Test - def test_has_a_version - refute_nil Google::Cloud::Translate::VERSION - end -end diff --git a/owl-bot-staging/google-cloud-translate/test/helper.rb b/owl-bot-staging/google-cloud-translate/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-translate/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/.gitignore b/owl-bot-staging/google-cloud-video-live_stream-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-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-video-live_stream-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-video-live_stream-v1/.repo-metadata.json deleted file mode 100644 index aeab9c64ff17..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "livestream.googleapis.com", - "api_shortname": "livestream", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest", - "distribution_name": "google-cloud-video-live_stream-v1", - "is_cloud": true, - "language": "ruby", - "name": "livestream", - "name_pretty": "Live Stream V1 API", - "product_documentation": "https://cloud.google.com/livestream/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Live Stream API transcodes mezzanine live signals into direct-to-consumer streaming formats, including Dynamic Adaptive Streaming over HTTP (DASH/MPEG-DASH), and HTTP Live Streaming (HLS), for multiple device platforms. Note that google-cloud-video-live_stream-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-video-live_stream instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/livestream/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml b/owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml deleted file mode 100644 index 3d8359eaee07..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-video-live_stream-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-video-live_stream-v1.rb" diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/.yardopts b/owl-bot-staging/google-cloud-video-live_stream-v1/.yardopts deleted file mode 100644 index ab2ac4451b9f..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Live Stream 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-video-live_stream-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-video-live_stream-v1/AUTHENTICATION.md deleted file mode 100644 index 7132dc94ea28..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-video-live_stream-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-video-live_stream-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/video/live_stream/v1" - -client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/video/live_stream/v1" - -::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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-video-live_stream-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/video/live_stream/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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-video-live_stream-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-video-live_stream-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile b/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.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-video-live_stream-v1/LICENSE.md b/owl-bot-staging/google-cloud-video-live_stream-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-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-video-live_stream-v1/README.md b/owl-bot-staging/google-cloud-video-live_stream-v1/README.md deleted file mode 100644 index 1cce01e33fdb..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Live Stream V1 API - -API Client library for the Live Stream V1 API - -The Live Stream API transcodes mezzanine live signals into direct-to-consumer streaming formats, including Dynamic Adaptive Streaming over HTTP (DASH/MPEG-DASH), and HTTP Live Streaming (HLS), for multiple device platforms. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Live Stream V1 API. Most users should consider using -the main client gem, -[google-cloud-video-live_stream](https://rubygems.org/gems/google-cloud-video-live_stream). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-video-live_stream-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/livestream.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/video/live_stream/v1" - -client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -request = ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new # (request fields as keyword arguments...) -response = client.create_channel request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-video-live_stream-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/livestream/) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/video/live_stream/v1" -require "logger" - -client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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-video-live_stream`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-video-live_stream-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-video-live_stream`. -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-video-live_stream-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-video-live_stream-v1/Rakefile b/owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile deleted file mode 100644 index b9de32a98243..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/video/live_stream/v1/livestream_service/credentials" - ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-video-live_stream-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-video-live_stream-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-video-live_stream-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-video-live_stream-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-video-live_stream-v1" - header "google-cloud-video-live_stream-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-video-live_stream-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-video-live_stream-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-video-live_stream-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-video-live_stream-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-video-live_stream-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json deleted file mode 100644 index 3b108930e5f2..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/gapic_metadata.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.video.livestream.v1", - "libraryPackage": "::Google::Cloud::Video::LiveStream::V1", - "services": { - "LivestreamService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client", - "rpcs": { - "CreateChannel": { - "methods": [ - "create_channel" - ] - }, - "ListChannels": { - "methods": [ - "list_channels" - ] - }, - "GetChannel": { - "methods": [ - "get_channel" - ] - }, - "DeleteChannel": { - "methods": [ - "delete_channel" - ] - }, - "UpdateChannel": { - "methods": [ - "update_channel" - ] - }, - "StartChannel": { - "methods": [ - "start_channel" - ] - }, - "StopChannel": { - "methods": [ - "stop_channel" - ] - }, - "StartDistribution": { - "methods": [ - "start_distribution" - ] - }, - "StopDistribution": { - "methods": [ - "stop_distribution" - ] - }, - "CreateInput": { - "methods": [ - "create_input" - ] - }, - "ListInputs": { - "methods": [ - "list_inputs" - ] - }, - "GetInput": { - "methods": [ - "get_input" - ] - }, - "DeleteInput": { - "methods": [ - "delete_input" - ] - }, - "UpdateInput": { - "methods": [ - "update_input" - ] - }, - "PreviewInput": { - "methods": [ - "preview_input" - ] - }, - "CreateEvent": { - "methods": [ - "create_event" - ] - }, - "ListEvents": { - "methods": [ - "list_events" - ] - }, - "GetEvent": { - "methods": [ - "get_event" - ] - }, - "DeleteEvent": { - "methods": [ - "delete_event" - ] - }, - "ListClips": { - "methods": [ - "list_clips" - ] - }, - "GetClip": { - "methods": [ - "get_clip" - ] - }, - "CreateClip": { - "methods": [ - "create_clip" - ] - }, - "DeleteClip": { - "methods": [ - "delete_clip" - ] - }, - "CreateDvrSession": { - "methods": [ - "create_dvr_session" - ] - }, - "ListDvrSessions": { - "methods": [ - "list_dvr_sessions" - ] - }, - "GetDvrSession": { - "methods": [ - "get_dvr_session" - ] - }, - "DeleteDvrSession": { - "methods": [ - "delete_dvr_session" - ] - }, - "UpdateDvrSession": { - "methods": [ - "update_dvr_session" - ] - }, - "CreateAsset": { - "methods": [ - "create_asset" - ] - }, - "DeleteAsset": { - "methods": [ - "delete_asset" - ] - }, - "GetAsset": { - "methods": [ - "get_asset" - ] - }, - "ListAssets": { - "methods": [ - "list_assets" - ] - }, - "GetPool": { - "methods": [ - "get_pool" - ] - }, - "UpdatePool": { - "methods": [ - "update_pool" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec b/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec deleted file mode 100644 index 3822779303f7..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/google-cloud-video-live_stream-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/video/live_stream/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-video-live_stream-v1" - gem.version = Google::Cloud::Video::LiveStream::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Live Stream API transcodes mezzanine live signals into direct-to-consumer streaming formats, including Dynamic Adaptive Streaming over HTTP (DASH/MPEG-DASH), and HTTP Live Streaming (HLS), for multiple device platforms. Note that google-cloud-video-live_stream-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-video-live_stream instead. See the readme for more details." - gem.summary = "API Client library for the Live Stream V1 API" - 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 = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb deleted file mode 100644 index 581cf388ce2b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google-cloud-video-live_stream-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1" diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb deleted file mode 100644 index 49926cffb929..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/livestream_service" -require "google/cloud/video/live_stream/v1/version" - -module Google - module Cloud - module Video - module LiveStream - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/video/live_stream/v1" - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/video/live_stream/v1" - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - module V1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/video/live_stream/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb deleted file mode 100644 index b9059d78ec3f..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/bindings_override.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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" - -module Google - module Cloud - module Video - module LiveStream - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/video/live_stream/v1/rest" - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Video", "LiveStream"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb deleted file mode 100644 index a24205f13b01..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/version" - -require "google/cloud/video/live_stream/v1/livestream_service/credentials" -require "google/cloud/video/live_stream/v1/livestream_service/paths" -require "google/cloud/video/live_stream/v1/livestream_service/operations" -require "google/cloud/video/live_stream/v1/livestream_service/client" -require "google/cloud/video/live_stream/v1/livestream_service/rest" - -module Google - module Cloud - module Video - module LiveStream - module V1 - ## - # Using Live Stream API, you can generate live streams in the various - # renditions and streaming formats. The streaming format include HTTP Live - # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send - # a source stream in the various ways, including Real-Time Messaging - # Protocol (RTMP) and Secure Reliable Transport (SRT). - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/video/live_stream/v1/livestream_service" - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/video/live_stream/v1/livestream_service/rest" - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - module LivestreamService - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "livestream_service", "helpers.rb" -require "google/cloud/video/live_stream/v1/livestream_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb deleted file mode 100644 index 06812729aaca..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/client.rb +++ /dev/null @@ -1,4350 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" -require "google/cloud/location" - -module Google - module Cloud - module Video - module LiveStream - module V1 - module LivestreamService - ## - # Client for the LivestreamService service. - # - # Using Live Stream API, you can generate live streams in the various - # renditions and streaming formats. The streaming format include HTTP Live - # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send - # a source stream in the various ways, including Real-Time Messaging - # Protocol (RTMP) and Secure Reliable Transport (SRT). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :livestream_service_stub - - ## - # Configure the LivestreamService Client class. - # - # See {::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LivestreamService clients - # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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", "Video", "LiveStream", "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_channel.timeout = 60.0 - - default_config.rpcs.list_channels.timeout = 60.0 - default_config.rpcs.list_channels.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_channel.timeout = 60.0 - default_config.rpcs.get_channel.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_channel.timeout = 60.0 - - default_config.rpcs.update_channel.timeout = 60.0 - - default_config.rpcs.start_channel.timeout = 60.0 - - default_config.rpcs.stop_channel.timeout = 60.0 - - default_config.rpcs.start_distribution.timeout = 60.0 - - default_config.rpcs.stop_distribution.timeout = 60.0 - - default_config.rpcs.create_input.timeout = 60.0 - - default_config.rpcs.list_inputs.timeout = 60.0 - default_config.rpcs.list_inputs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_input.timeout = 60.0 - default_config.rpcs.get_input.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_input.timeout = 60.0 - - default_config.rpcs.update_input.timeout = 60.0 - - default_config.rpcs.preview_input.timeout = 60.0 - - default_config.rpcs.create_event.timeout = 60.0 - - default_config.rpcs.list_events.timeout = 60.0 - default_config.rpcs.list_events.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_event.timeout = 60.0 - default_config.rpcs.get_event.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_event.timeout = 60.0 - - default_config.rpcs.list_clips.timeout = 60.0 - default_config.rpcs.list_clips.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_clip.timeout = 60.0 - default_config.rpcs.get_clip.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_clip.timeout = 60.0 - - default_config.rpcs.delete_clip.timeout = 60.0 - - default_config.rpcs.create_dvr_session.timeout = 60.0 - - default_config.rpcs.list_dvr_sessions.timeout = 60.0 - default_config.rpcs.list_dvr_sessions.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_dvr_session.timeout = 60.0 - default_config.rpcs.get_dvr_session.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_dvr_session.timeout = 60.0 - - default_config.rpcs.update_dvr_session.timeout = 60.0 - - default_config.rpcs.create_asset.timeout = 60.0 - - default_config.rpcs.delete_asset.timeout = 60.0 - - default_config.rpcs.get_asset.timeout = 60.0 - default_config.rpcs.get_asset.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_assets.timeout = 60.0 - default_config.rpcs.list_assets.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_pool.timeout = 60.0 - default_config.rpcs.get_pool.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_pool.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LivestreamService 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::Video::LiveStream::V1::LivestreamService::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 - @livestream_service_stub.universe_domain - end - - ## - # Create a new LivestreamService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LivestreamService 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/video/livestream/v1/service_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 - - @livestream_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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, - logger: @config.logger - ) - - @livestream_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @livestream_service_stub.endpoint - config.universe_domain = @livestream_service_stub.universe_domain - config.logger = @livestream_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Video::LiveStream::V1::LivestreamService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @livestream_service_stub.logger - end - - # Service calls - - ## - # Creates a channel with the provided unique ID in the specified - # region. - # - # @overload create_channel(request, options = nil) - # Pass arguments to `create_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(parent: nil, channel: nil, channel_id: nil, request_id: nil) - # Pass arguments to `create_channel` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] - # Required. The channel resource to be created. - # @param channel_id [::String] - # Required. The ID of the channel resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new - # - # # Call the create_channel method. - # result = client.create_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :create_channel, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all channels in the specified region. - # - # @overload list_channels(request, options = nil) - # Pass arguments to `list_channels` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channels(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_channels` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # The filter to apply to list results. - # @param order_by [::String] - # Specifies the ordering of results following syntax at - # https://cloud.google.com/apis/design/design_patterns#sorting_order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new - # - # # Call the list_channels method. - # result = client.list_channels 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::Video::LiveStream::V1::Channel. - # p item - # end - # - def list_channels request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest - - # Converts hash 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_channels.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::Video::LiveStream::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_channels.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_channels.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :list_channels, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_channels, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified channel. - # - # @overload get_channel(request, options = nil) - # Pass arguments to `get_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil) - # Pass arguments to `get_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Channel] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Channel] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new - # - # # Call the get_channel method. - # result = client.get_channel request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. - # p result - # - def get_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :get_channel, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified channel. - # - # @overload delete_channel(request, options = nil) - # Pass arguments to `delete_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @param force [::Boolean] - # If the `force` field is set to the default value of `false`, you must - # delete all of a channel's events before you can delete the channel itself. - # If the field is set to `true`, requests to delete a channel also delete - # associated channel events. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new - # - # # Call the delete_channel method. - # result = client.delete_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :delete_channel, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified channel. - # - # @overload update_channel(request, options = nil) - # Pass arguments to `update_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(update_mask: nil, channel: nil, request_id: nil) - # Pass arguments to `update_channel` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the Channel - # resource by the update. You can only update the following fields: - # - # * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) - # * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) - # * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - # * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) - # * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - # * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) - # * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) - # * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) - # * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) - # * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the mask is not present, then each field from the list above is updated - # if the field appears in the request payload. To unset a field, add the - # field to the update mask and remove it from the request payload. - # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] - # Required. The channel resource to be updated. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new - # - # # Call the update_channel method. - # result = client.update_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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.channel&.name - header_params["channel.name"] = request.channel.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_channel.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :update_channel, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts the specified channel. Part of the video pipeline will be created - # only when the StartChannel request is received by the server. - # - # @overload start_channel(request, options = nil) - # Pass arguments to `start_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StartChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) - # Pass arguments to `start_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new - # - # # Call the start_channel method. - # result = client.start_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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.start_channel.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :start_channel, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops the specified channel. Part of the video pipeline will be released - # when the StopChannel request is received by the server. - # - # @overload stop_channel(request, options = nil) - # Pass arguments to `stop_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StopChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) - # Pass arguments to `stop_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new - # - # # Call the stop_channel method. - # result = client.stop_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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.stop_channel.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :stop_channel, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts distribution which delivers outputs to the destination indicated by - # the Distribution configuration. - # - # @overload start_distribution(request, options = nil) - # Pass arguments to `start_distribution` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) - # Pass arguments to `start_distribution` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param distribution_keys [::Array<::String>] - # Optional. A list of keys to identify the distribution configuration in the - # channel resource. If left empty, all the distributions in the channel - # specification will be started. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new - # - # # Call the start_distribution method. - # result = client.start_distribution 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_distribution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest - - # Converts hash 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_distribution.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::Video::LiveStream::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.start_distribution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_distribution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :start_distribution, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops the specified distribution. - # - # @overload stop_distribution(request, options = nil) - # Pass arguments to `stop_distribution` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) - # Pass arguments to `stop_distribution` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param distribution_keys [::Array<::String>] - # Optional. A list of key to identify the distribution configuration in the - # channel resource. If left empty, all the distributions in the channel - # specification will be stopped. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new - # - # # Call the stop_distribution method. - # result = client.stop_distribution 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_distribution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest - - # Converts hash 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_distribution.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::Video::LiveStream::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.stop_distribution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_distribution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :stop_distribution, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an input with the provided unique ID in the specified region. - # - # @overload create_input(request, options = nil) - # Pass arguments to `create_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(parent: nil, input: nil, input_id: nil, request_id: nil) - # Pass arguments to `create_input` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] - # Required. The input resource to be created. - # @param input_id [::String] - # Required. The ID of the input resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new - # - # # Call the create_input method. - # result = client.create_input 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_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :create_input, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all inputs in the specified region. - # - # @overload list_inputs(request, options = nil) - # Pass arguments to `list_inputs` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListInputsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_inputs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_inputs` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListInputsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # The filter to apply to list results. - # @param order_by [::String] - # Specifies the ordering of results following syntax at [Sorting - # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new - # - # # Call the list_inputs method. - # result = client.list_inputs 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::Video::LiveStream::V1::Input. - # p item - # end - # - def list_inputs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest - - # Converts hash 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_inputs.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::Video::LiveStream::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_inputs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_inputs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :list_inputs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_inputs, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified input. - # - # @overload get_input(request, options = nil) - # Pass arguments to `get_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(name: nil) - # Pass arguments to `get_input` via keyword arguments. Note that at - # least one keyword argument is 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 input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Input] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Input] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new - # - # # Call the get_input method. - # result = client.get_input request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. - # p result - # - def get_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :get_input, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified input. - # - # @overload delete_input(request, options = nil) - # Pass arguments to `delete_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(name: nil, request_id: nil) - # Pass arguments to `delete_input` via keyword arguments. Note that at - # least one keyword argument is 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 input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new - # - # # Call the delete_input method. - # result = client.delete_input 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_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :delete_input, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified input. - # - # @overload update_input(request, options = nil) - # Pass arguments to `update_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(update_mask: nil, input: nil, request_id: nil) - # Pass arguments to `update_input` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the Input - # resource by the update. You can only update the following fields: - # - # * [`tier`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#Tier) - # * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) - # * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the mask is not present, then each field from the list above is updated - # if the field appears in the request payload. To unset a field, add the - # field to the update mask and remove it from the request payload. - # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] - # Required. The input resource to be updated. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new - # - # # Call the update_input method. - # result = client.update_input 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_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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.input&.name - header_params["input.name"] = request.input.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_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :update_input, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Preview the streaming content of the specified input. - # - # @overload preview_input(request, options = nil) - # Pass arguments to `preview_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload preview_input(name: nil) - # Pass arguments to `preview_input` via keyword arguments. Note that at - # least one keyword argument is 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 input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new - # - # # Call the preview_input method. - # result = client.preview_input request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::PreviewInputResponse. - # p result - # - def preview_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest - - # Converts hash 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.preview_input.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::Video::LiveStream::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.preview_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.preview_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :preview_input, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an event with the provided unique ID in the specified channel. - # - # @overload create_event(request, options = nil) - # Pass arguments to `create_event` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(parent: nil, event: nil, event_id: nil, request_id: nil) - # Pass arguments to `create_event` via keyword arguments. Note that at - # least one keyword argument is 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 channel for the resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param event [::Google::Cloud::Video::LiveStream::V1::Event, ::Hash] - # Required. The event resource to be created. - # @param event_id [::String] - # Required. The ID of the event resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Event] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Event] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new - # - # # Call the create_event method. - # result = client.create_event request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. - # p result - # - def create_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest - - # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :create_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all events in the specified channel. - # - # @overload list_events(request, options = nil) - # Pass arguments to `list_events` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_events` via keyword arguments. Note that at - # least one keyword argument is 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 channel for the resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param page_size [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListEventsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # The filter to apply to list results. - # @param order_by [::String] - # Specifies the ordering of results following syntax at - # https://cloud.google.com/apis/design/design_patterns#sorting_order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new - # - # # Call the list_events method. - # result = client.list_events 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::Video::LiveStream::V1::Event. - # p item - # end - # - def list_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest - - # Converts hash 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_events.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::Video::LiveStream::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_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :list_events, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_events, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified event. - # - # @overload get_event(request, options = nil) - # Pass arguments to `get_event` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil) - # Pass arguments to `get_event` via keyword arguments. Note that at - # least one keyword argument is 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 event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Event] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Event] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new - # - # # Call the get_event method. - # result = client.get_event request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. - # p result - # - def get_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetEventRequest - - # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :get_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified event. - # - # @overload delete_event(request, options = nil) - # Pass arguments to `delete_event` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) - # Pass arguments to `delete_event` via keyword arguments. Note that at - # least one keyword argument is 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 event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new - # - # # Call the delete_event method. - # result = client.delete_event request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest - - # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :delete_event, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all clips in the specified channel. - # - # @overload list_clips(request, options = nil) - # Pass arguments to `list_clips` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListClipsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clips(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clips` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListClipsRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new - # - # # Call the list_clips method. - # result = client.list_clips 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::Video::LiveStream::V1::Clip. - # p item - # end - # - def list_clips request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest - - # Converts hash 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_clips.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::Video::LiveStream::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_clips.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clips.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :list_clips, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_clips, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified clip. - # - # @overload get_clip(request, options = nil) - # Pass arguments to `get_clip` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetClipRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetClipRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clip(name: nil) - # Pass arguments to `get_clip` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Clip] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Clip] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new - # - # # Call the get_clip method. - # result = client.get_clip request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip. - # p result - # - def get_clip request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetClipRequest - - # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_clip.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :get_clip, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a clip with the provided clip ID in the specified channel. - # - # @overload create_clip(request, options = nil) - # Pass arguments to `create_clip` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateClipRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clip(parent: nil, clip_id: nil, clip: nil, request_id: nil) - # Pass arguments to `create_clip` via keyword arguments. Note that at - # least one keyword argument is 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 name, in the following form: - # `projects/{project}/locations/{location}/channels/{channel}`. - # @param clip_id [::String] - # Required. The ID of the clip resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param clip [::Google::Cloud::Video::LiveStream::V1::Clip, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new - # - # # Call the create_clip method. - # result = client.create_clip 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_clip request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest - - # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_clip.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :create_clip, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified clip job resource. This method only deletes the clip - # job and does not delete the VOD clip stored in Cloud Storage. - # - # @overload delete_clip(request, options = nil) - # Pass arguments to `delete_clip` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clip(name: nil, request_id: nil) - # Pass arguments to `delete_clip` via keyword arguments. Note that at - # least one keyword argument is 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 clip resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new - # - # # Call the delete_clip method. - # result = client.delete_clip 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_clip request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest - - # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_clip.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :delete_clip, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a DVR session with the provided unique ID in the specified channel. - # - # @overload create_dvr_session(request, options = nil) - # Pass arguments to `create_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(parent: nil, dvr_session_id: nil, dvr_session: nil, request_id: nil) - # Pass arguments to `create_dvr_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 name, in the following form: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param dvr_session_id [::String] - # Required. The ID of the DVR session resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new - # - # # Call the create_dvr_session method. - # result = client.create_dvr_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_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :create_dvr_session, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all DVR sessions in the specified channel. - # - # @overload list_dvr_sessions(request, options = nil) - # Pass arguments to `list_dvr_sessions` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_dvr_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. Parent value for ListDvrSessionsRequest - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.new - # - # # Call the list_dvr_sessions method. - # result = client.list_dvr_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::Video::LiveStream::V1::DvrSession. - # p item - # end - # - def list_dvr_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_dvr_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :list_dvr_sessions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_dvr_sessions, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified DVR session. - # - # @overload get_dvr_session(request, options = nil) - # Pass arguments to `get_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(name: nil) - # Pass arguments to `get_dvr_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. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::DvrSession] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new - # - # # Call the get_dvr_session method. - # result = client.get_dvr_session request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::DvrSession. - # p result - # - def get_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :get_dvr_session, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified DVR session. - # - # @overload delete_dvr_session(request, options = nil) - # Pass arguments to `delete_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(name: nil, request_id: nil) - # Pass arguments to `delete_dvr_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 event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.new - # - # # Call the delete_dvr_session method. - # result = client.delete_dvr_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_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :delete_dvr_session, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified DVR session. - # - # @overload update_dvr_session(request, options = nil) - # Pass arguments to `update_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(update_mask: nil, dvr_session: nil, request_id: nil) - # Pass arguments to `update_dvr_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # DvrSession resource by the update. You can only update the following - # fields: - # - # * `dvrWindows` - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] - # Required. The DVR session resource to be updated. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new - # - # # Call the update_dvr_session method. - # result = client.update_dvr_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 update_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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.dvr_session&.name - header_params["dvr_session.name"] = request.dvr_session.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_dvr_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :update_dvr_session, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Asset with the provided unique ID in the specified - # region. - # - # @overload create_asset(request, options = nil) - # Pass arguments to `create_asset` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil, request_id: nil) - # Pass arguments to `create_asset` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param asset [::Google::Cloud::Video::LiveStream::V1::Asset, ::Hash] - # Required. The asset resource to be created. - # @param asset_id [::String] - # Required. The ID of the asset resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new - # - # # Call the create_asset method. - # result = client.create_asset 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_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest - - # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :create_asset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified asset if it is not used. - # - # @overload delete_asset(request, options = nil) - # Pass arguments to `delete_asset` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil, request_id: nil) - # Pass arguments to `delete_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset resource, in the form of: - # `projects/{project}/locations/{location}/assets/{assetId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new - # - # # Call the delete_asset method. - # result = client.delete_asset 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_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest - - # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :delete_asset, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified asset. - # - # @overload get_asset(request, options = nil) - # Pass arguments to `get_asset` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil) - # Pass arguments to `get_asset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/assets/{asset}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Asset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new - # - # # Call the get_asset method. - # result = client.get_asset request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset. - # p result - # - def get_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest - - # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :get_asset, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all assets in the specified region. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets 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::Video::LiveStream::V1::Asset. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest - - # Converts hash 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_assets.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::Video::LiveStream::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_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :list_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_assets, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified pool. - # - # @overload get_pool(request, options = nil) - # Pass arguments to `get_pool` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pool(name: nil) - # Pass arguments to `get_pool` via keyword arguments. Note that at - # least one keyword argument is 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 pool resource, in the form of: - # `projects/{project}/locations/{location}/pools/{poolId}`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Video::LiveStream::V1::Pool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Pool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new - # - # # Call the get_pool method. - # result = client.get_pool request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool. - # p result - # - def get_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest - - # Converts hash 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_pool.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::Video::LiveStream::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_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :get_pool, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified pool. - # - # @overload update_pool(request, options = nil) - # Pass arguments to `update_pool` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pool(update_mask: nil, pool: nil, request_id: nil) - # Pass arguments to `update_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the Pool - # resource by the update. You can only update the following fields: - # - # * `networkConfig` - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # @param pool [::Google::Cloud::Video::LiveStream::V1::Pool, ::Hash] - # Required. The pool resource to be updated. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new - # - # # Call the update_pool method. - # result = client.update_pool 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_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest - - # Converts hash 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_pool.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::Video::LiveStream::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.pool&.name - header_params["pool.name"] = request.pool.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_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.call_rpc :update_pool, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the LivestreamService API. - # - # This class represents the configuration for LivestreamService, - # 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::Video::LiveStream::V1::LivestreamService::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_channel to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_channel.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_channel.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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 LivestreamService 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_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :create_channel - ## - # RPC-specific configuration for `list_channels` - # @return [::Gapic::Config::Method] - # - attr_reader :list_channels - ## - # RPC-specific configuration for `get_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :get_channel - ## - # RPC-specific configuration for `delete_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_channel - ## - # RPC-specific configuration for `update_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :update_channel - ## - # RPC-specific configuration for `start_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :start_channel - ## - # RPC-specific configuration for `stop_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_channel - ## - # RPC-specific configuration for `start_distribution` - # @return [::Gapic::Config::Method] - # - attr_reader :start_distribution - ## - # RPC-specific configuration for `stop_distribution` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_distribution - ## - # RPC-specific configuration for `create_input` - # @return [::Gapic::Config::Method] - # - attr_reader :create_input - ## - # RPC-specific configuration for `list_inputs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_inputs - ## - # RPC-specific configuration for `get_input` - # @return [::Gapic::Config::Method] - # - attr_reader :get_input - ## - # RPC-specific configuration for `delete_input` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_input - ## - # RPC-specific configuration for `update_input` - # @return [::Gapic::Config::Method] - # - attr_reader :update_input - ## - # RPC-specific configuration for `preview_input` - # @return [::Gapic::Config::Method] - # - attr_reader :preview_input - ## - # RPC-specific configuration for `create_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event - ## - # RPC-specific configuration for `list_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_events - ## - # RPC-specific configuration for `get_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event - ## - # RPC-specific configuration for `delete_event` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event - ## - # RPC-specific configuration for `list_clips` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clips - ## - # RPC-specific configuration for `get_clip` - # @return [::Gapic::Config::Method] - # - attr_reader :get_clip - ## - # RPC-specific configuration for `create_clip` - # @return [::Gapic::Config::Method] - # - attr_reader :create_clip - ## - # RPC-specific configuration for `delete_clip` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_clip - ## - # RPC-specific configuration for `create_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dvr_session - ## - # RPC-specific configuration for `list_dvr_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_dvr_sessions - ## - # RPC-specific configuration for `get_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dvr_session - ## - # RPC-specific configuration for `delete_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dvr_session - ## - # RPC-specific configuration for `update_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dvr_session - ## - # RPC-specific configuration for `create_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_asset - ## - # RPC-specific configuration for `delete_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_asset - ## - # RPC-specific configuration for `get_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_asset - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `get_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_pool - ## - # RPC-specific configuration for `update_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_pool - - # @private - def initialize parent_rpcs = nil - create_channel_config = parent_rpcs.create_channel if parent_rpcs.respond_to? :create_channel - @create_channel = ::Gapic::Config::Method.new create_channel_config - list_channels_config = parent_rpcs.list_channels if parent_rpcs.respond_to? :list_channels - @list_channels = ::Gapic::Config::Method.new list_channels_config - get_channel_config = parent_rpcs.get_channel if parent_rpcs.respond_to? :get_channel - @get_channel = ::Gapic::Config::Method.new get_channel_config - delete_channel_config = parent_rpcs.delete_channel if parent_rpcs.respond_to? :delete_channel - @delete_channel = ::Gapic::Config::Method.new delete_channel_config - update_channel_config = parent_rpcs.update_channel if parent_rpcs.respond_to? :update_channel - @update_channel = ::Gapic::Config::Method.new update_channel_config - start_channel_config = parent_rpcs.start_channel if parent_rpcs.respond_to? :start_channel - @start_channel = ::Gapic::Config::Method.new start_channel_config - stop_channel_config = parent_rpcs.stop_channel if parent_rpcs.respond_to? :stop_channel - @stop_channel = ::Gapic::Config::Method.new stop_channel_config - start_distribution_config = parent_rpcs.start_distribution if parent_rpcs.respond_to? :start_distribution - @start_distribution = ::Gapic::Config::Method.new start_distribution_config - stop_distribution_config = parent_rpcs.stop_distribution if parent_rpcs.respond_to? :stop_distribution - @stop_distribution = ::Gapic::Config::Method.new stop_distribution_config - create_input_config = parent_rpcs.create_input if parent_rpcs.respond_to? :create_input - @create_input = ::Gapic::Config::Method.new create_input_config - list_inputs_config = parent_rpcs.list_inputs if parent_rpcs.respond_to? :list_inputs - @list_inputs = ::Gapic::Config::Method.new list_inputs_config - get_input_config = parent_rpcs.get_input if parent_rpcs.respond_to? :get_input - @get_input = ::Gapic::Config::Method.new get_input_config - delete_input_config = parent_rpcs.delete_input if parent_rpcs.respond_to? :delete_input - @delete_input = ::Gapic::Config::Method.new delete_input_config - update_input_config = parent_rpcs.update_input if parent_rpcs.respond_to? :update_input - @update_input = ::Gapic::Config::Method.new update_input_config - preview_input_config = parent_rpcs.preview_input if parent_rpcs.respond_to? :preview_input - @preview_input = ::Gapic::Config::Method.new preview_input_config - create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event - @create_event = ::Gapic::Config::Method.new create_event_config - list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events - @list_events = ::Gapic::Config::Method.new list_events_config - get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event - @get_event = ::Gapic::Config::Method.new get_event_config - delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event - @delete_event = ::Gapic::Config::Method.new delete_event_config - list_clips_config = parent_rpcs.list_clips if parent_rpcs.respond_to? :list_clips - @list_clips = ::Gapic::Config::Method.new list_clips_config - get_clip_config = parent_rpcs.get_clip if parent_rpcs.respond_to? :get_clip - @get_clip = ::Gapic::Config::Method.new get_clip_config - create_clip_config = parent_rpcs.create_clip if parent_rpcs.respond_to? :create_clip - @create_clip = ::Gapic::Config::Method.new create_clip_config - delete_clip_config = parent_rpcs.delete_clip if parent_rpcs.respond_to? :delete_clip - @delete_clip = ::Gapic::Config::Method.new delete_clip_config - create_dvr_session_config = parent_rpcs.create_dvr_session if parent_rpcs.respond_to? :create_dvr_session - @create_dvr_session = ::Gapic::Config::Method.new create_dvr_session_config - list_dvr_sessions_config = parent_rpcs.list_dvr_sessions if parent_rpcs.respond_to? :list_dvr_sessions - @list_dvr_sessions = ::Gapic::Config::Method.new list_dvr_sessions_config - get_dvr_session_config = parent_rpcs.get_dvr_session if parent_rpcs.respond_to? :get_dvr_session - @get_dvr_session = ::Gapic::Config::Method.new get_dvr_session_config - delete_dvr_session_config = parent_rpcs.delete_dvr_session if parent_rpcs.respond_to? :delete_dvr_session - @delete_dvr_session = ::Gapic::Config::Method.new delete_dvr_session_config - update_dvr_session_config = parent_rpcs.update_dvr_session if parent_rpcs.respond_to? :update_dvr_session - @update_dvr_session = ::Gapic::Config::Method.new update_dvr_session_config - create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset - @create_asset = ::Gapic::Config::Method.new create_asset_config - delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset - @delete_asset = ::Gapic::Config::Method.new delete_asset_config - get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset - @get_asset = ::Gapic::Config::Method.new get_asset_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - get_pool_config = parent_rpcs.get_pool if parent_rpcs.respond_to? :get_pool - @get_pool = ::Gapic::Config::Method.new get_pool_config - update_pool_config = parent_rpcs.update_pool if parent_rpcs.respond_to? :update_pool - @update_pool = ::Gapic::Config::Method.new update_pool_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb deleted file mode 100644 index ebdda67ff801..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/credentials.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - module LivestreamService - # Credentials for the LivestreamService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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 -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb deleted file mode 100644 index dc29b6a405f4..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - module LivestreamService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the LivestreamService 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 LivestreamService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::Video::LiveStream::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? - throw :response, 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::Video::LiveStream::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? - throw :response, 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::Video::LiveStream::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? - 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::Video::LiveStream::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? - 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::Video::LiveStream::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? - throw :response, 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb deleted file mode 100644 index f3bbcf7af848..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/paths.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - module LivestreamService - # Path helper methods for the LivestreamService API. - module Paths - ## - # Create a fully-qualified Asset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/assets/{asset}` - # - # @param project [String] - # @param location [String] - # @param asset [String] - # - # @return [::String] - def asset_path project:, location:, asset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/assets/#{asset}" - end - - ## - # Create a fully-qualified Channel resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/channels/{channel}` - # - # @param project [String] - # @param location [String] - # @param channel [String] - # - # @return [::String] - def channel_path project:, location:, channel: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/channels/#{channel}" - end - - ## - # Create a fully-qualified Clip resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}` - # - # @param project [String] - # @param location [String] - # @param channel [String] - # @param clip [String] - # - # @return [::String] - def clip_path project:, location:, channel:, clip: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "channel cannot contain /" if channel.to_s.include? "/" - - "projects/#{project}/locations/#{location}/channels/#{channel}/clips/#{clip}" - end - - ## - # Create a fully-qualified DvrSession resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/channels/{channel}/dvrSessions/{dvr_session}` - # - # @param project [String] - # @param location [String] - # @param channel [String] - # @param dvr_session [String] - # - # @return [::String] - def dvr_session_path project:, location:, channel:, dvr_session: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "channel cannot contain /" if channel.to_s.include? "/" - - "projects/#{project}/locations/#{location}/channels/#{channel}/dvrSessions/#{dvr_session}" - end - - ## - # Create a fully-qualified Event resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/channels/{channel}/events/{event}` - # - # @param project [String] - # @param location [String] - # @param channel [String] - # @param event [String] - # - # @return [::String] - def event_path project:, location:, channel:, event: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "channel cannot contain /" if channel.to_s.include? "/" - - "projects/#{project}/locations/#{location}/channels/#{channel}/events/#{event}" - end - - ## - # Create a fully-qualified Input resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/inputs/{input}` - # - # @param project [String] - # @param location [String] - # @param input [String] - # - # @return [::String] - def input_path project:, location:, input: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/inputs/#{input}" - 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 Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/networks/{network}` - # - # @param project [String] - # @param network [String] - # - # @return [::String] - def network_path project:, network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/networks/#{network}" - end - - ## - # Create a fully-qualified Pool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/pools/{pool}` - # - # @param project [String] - # @param location [String] - # @param pool [String] - # - # @return [::String] - def pool_path project:, location:, pool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/pools/#{pool}" - end - - ## - # Create a fully-qualified SecretVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}/versions/{version}` - # - # @param project [String] - # @param secret [String] - # @param version [String] - # - # @return [::String] - def secret_version_path project:, secret:, version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}/versions/#{version}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb deleted file mode 100644 index 54fae79a7d2a..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/version" -require "google/cloud/video/live_stream/v1/bindings_override" - -require "google/cloud/video/live_stream/v1/livestream_service/credentials" -require "google/cloud/video/live_stream/v1/livestream_service/paths" -require "google/cloud/video/live_stream/v1/livestream_service/rest/operations" -require "google/cloud/video/live_stream/v1/livestream_service/rest/client" - -module Google - module Cloud - module Video - module LiveStream - module V1 - ## - # Using Live Stream API, you can generate live streams in the various - # renditions and streaming formats. The streaming format include HTTP Live - # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send - # a source stream in the various ways, including Real-Time Messaging - # Protocol (RTMP) and Secure Reliable Transport (SRT). - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/video/live_stream/v1/livestream_service/rest" - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - module LivestreamService - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/video/live_stream/v1/livestream_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb deleted file mode 100644 index 6704ac62a245..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/client.rb +++ /dev/null @@ -1,4077 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" -require "google/cloud/video/live_stream/v1/livestream_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Video - module LiveStream - module V1 - module LivestreamService - module Rest - ## - # REST client for the LivestreamService service. - # - # Using Live Stream API, you can generate live streams in the various - # renditions and streaming formats. The streaming format include HTTP Live - # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send - # a source stream in the various ways, including Real-Time Messaging - # Protocol (RTMP) and Secure Reliable Transport (SRT). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :livestream_service_stub - - ## - # Configure the LivestreamService Client class. - # - # See {::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LivestreamService clients - # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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", "Video", "LiveStream", "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_channel.timeout = 60.0 - - default_config.rpcs.list_channels.timeout = 60.0 - default_config.rpcs.list_channels.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_channel.timeout = 60.0 - default_config.rpcs.get_channel.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_channel.timeout = 60.0 - - default_config.rpcs.update_channel.timeout = 60.0 - - default_config.rpcs.start_channel.timeout = 60.0 - - default_config.rpcs.stop_channel.timeout = 60.0 - - default_config.rpcs.start_distribution.timeout = 60.0 - - default_config.rpcs.stop_distribution.timeout = 60.0 - - default_config.rpcs.create_input.timeout = 60.0 - - default_config.rpcs.list_inputs.timeout = 60.0 - default_config.rpcs.list_inputs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_input.timeout = 60.0 - default_config.rpcs.get_input.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_input.timeout = 60.0 - - default_config.rpcs.update_input.timeout = 60.0 - - default_config.rpcs.preview_input.timeout = 60.0 - - default_config.rpcs.create_event.timeout = 60.0 - - default_config.rpcs.list_events.timeout = 60.0 - default_config.rpcs.list_events.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_event.timeout = 60.0 - default_config.rpcs.get_event.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_event.timeout = 60.0 - - default_config.rpcs.list_clips.timeout = 60.0 - default_config.rpcs.list_clips.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_clip.timeout = 60.0 - default_config.rpcs.get_clip.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_clip.timeout = 60.0 - - default_config.rpcs.delete_clip.timeout = 60.0 - - default_config.rpcs.create_dvr_session.timeout = 60.0 - - default_config.rpcs.list_dvr_sessions.timeout = 60.0 - default_config.rpcs.list_dvr_sessions.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_dvr_session.timeout = 60.0 - default_config.rpcs.get_dvr_session.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_dvr_session.timeout = 60.0 - - default_config.rpcs.update_dvr_session.timeout = 60.0 - - default_config.rpcs.create_asset.timeout = 60.0 - - default_config.rpcs.delete_asset.timeout = 60.0 - - default_config.rpcs.get_asset.timeout = 60.0 - default_config.rpcs.get_asset.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_assets.timeout = 60.0 - default_config.rpcs.list_assets.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_pool.timeout = 60.0 - default_config.rpcs.get_pool.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_pool.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LivestreamService 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::Video::LiveStream::V1::LivestreamService::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 - @livestream_service_stub.universe_domain - end - - ## - # Create a new LivestreamService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LivestreamService 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::Video::LiveStream::V1::LivestreamService::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 - - @livestream_service_stub = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @livestream_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @livestream_service_stub.endpoint - config.universe_domain = @livestream_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @livestream_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @livestream_service_stub.logger - end - - # Service calls - - ## - # Creates a channel with the provided unique ID in the specified - # region. - # - # @overload create_channel(request, options = nil) - # Pass arguments to `create_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(parent: nil, channel: nil, channel_id: nil, request_id: nil) - # Pass arguments to `create_channel` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] - # Required. The channel resource to be created. - # @param channel_id [::String] - # Required. The ID of the channel resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new - # - # # Call the create_channel method. - # result = client.create_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.create_channel request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all channels in the specified region. - # - # @overload list_channels(request, options = nil) - # Pass arguments to `list_channels` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channels(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_channels` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # The filter to apply to list results. - # @param order_by [::String] - # Specifies the ordering of results following syntax at - # https://cloud.google.com/apis/design/design_patterns#sorting_order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Channel>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new - # - # # Call the list_channels method. - # result = client.list_channels 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::Video::LiveStream::V1::Channel. - # p item - # end - # - def list_channels request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest - - # Converts hash 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_channels.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::Video::LiveStream::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_channels.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_channels.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.list_channels request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_channels, "channels", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified channel. - # - # @overload get_channel(request, options = nil) - # Pass arguments to `get_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil) - # Pass arguments to `get_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Channel] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Channel] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new - # - # # Call the get_channel method. - # result = client.get_channel request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. - # p result - # - def get_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.get_channel request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified channel. - # - # @overload delete_channel(request, options = nil) - # Pass arguments to `delete_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @param force [::Boolean] - # If the `force` field is set to the default value of `false`, you must - # delete all of a channel's events before you can delete the channel itself. - # If the field is set to `true`, requests to delete a channel also delete - # associated channel events. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new - # - # # Call the delete_channel method. - # result = client.delete_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.delete_channel request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified channel. - # - # @overload update_channel(request, options = nil) - # Pass arguments to `update_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(update_mask: nil, channel: nil, request_id: nil) - # Pass arguments to `update_channel` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the Channel - # resource by the update. You can only update the following fields: - # - # * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) - # * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) - # * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - # * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) - # * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - # * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) - # * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) - # * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) - # * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) - # * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the mask is not present, then each field from the list above is updated - # if the field appears in the request payload. To unset a field, add the - # field to the update mask and remove it from the request payload. - # @param channel [::Google::Cloud::Video::LiveStream::V1::Channel, ::Hash] - # Required. The channel resource to be updated. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new - # - # # Call the update_channel method. - # result = client.update_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.update_channel request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts the specified channel. Part of the video pipeline will be created - # only when the StartChannel request is received by the server. - # - # @overload start_channel(request, options = nil) - # Pass arguments to `start_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StartChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) - # Pass arguments to `start_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new - # - # # Call the start_channel method. - # result = client.start_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.start_channel request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops the specified channel. Part of the video pipeline will be released - # when the StopChannel request is received by the server. - # - # @overload stop_channel(request, options = nil) - # Pass arguments to `stop_channel` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StopChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_channel(name: nil, request_id: nil) - # Pass arguments to `stop_channel` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new - # - # # Call the stop_channel method. - # result = client.stop_channel 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_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest - - # Converts hash 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_channel.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::Video::LiveStream::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_channel.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.stop_channel request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts distribution which delivers outputs to the destination indicated by - # the Distribution configuration. - # - # @overload start_distribution(request, options = nil) - # Pass arguments to `start_distribution` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) - # Pass arguments to `start_distribution` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param distribution_keys [::Array<::String>] - # Optional. A list of keys to identify the distribution configuration in the - # channel resource. If left empty, all the distributions in the channel - # specification will be started. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new - # - # # Call the start_distribution method. - # result = client.start_distribution 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_distribution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest - - # Converts hash 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_distribution.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::Video::LiveStream::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_distribution.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_distribution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.start_distribution request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops the specified distribution. - # - # @overload stop_distribution(request, options = nil) - # Pass arguments to `stop_distribution` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_distribution(name: nil, distribution_keys: nil, request_id: nil) - # Pass arguments to `stop_distribution` via keyword arguments. Note that at - # least one keyword argument is 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 channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param distribution_keys [::Array<::String>] - # Optional. A list of key to identify the distribution configuration in the - # channel resource. If left empty, all the distributions in the channel - # specification will be stopped. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new - # - # # Call the stop_distribution method. - # result = client.stop_distribution 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_distribution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest - - # Converts hash 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_distribution.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::Video::LiveStream::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_distribution.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_distribution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.stop_distribution request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an input with the provided unique ID in the specified region. - # - # @overload create_input(request, options = nil) - # Pass arguments to `create_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(parent: nil, input: nil, input_id: nil, request_id: nil) - # Pass arguments to `create_input` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] - # Required. The input resource to be created. - # @param input_id [::String] - # Required. The ID of the input resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new - # - # # Call the create_input method. - # result = client.create_input 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_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.create_input request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all inputs in the specified region. - # - # @overload list_inputs(request, options = nil) - # Pass arguments to `list_inputs` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListInputsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_inputs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_inputs` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListInputsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # The filter to apply to list results. - # @param order_by [::String] - # Specifies the ordering of results following syntax at [Sorting - # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Input>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new - # - # # Call the list_inputs method. - # result = client.list_inputs 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::Video::LiveStream::V1::Input. - # p item - # end - # - def list_inputs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest - - # Converts hash 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_inputs.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::Video::LiveStream::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_inputs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_inputs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.list_inputs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_inputs, "inputs", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified input. - # - # @overload get_input(request, options = nil) - # Pass arguments to `get_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(name: nil) - # Pass arguments to `get_input` via keyword arguments. Note that at - # least one keyword argument is 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 input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Input] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Input] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new - # - # # Call the get_input method. - # result = client.get_input request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. - # p result - # - def get_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.get_input request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified input. - # - # @overload delete_input(request, options = nil) - # Pass arguments to `delete_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(name: nil, request_id: nil) - # Pass arguments to `delete_input` via keyword arguments. Note that at - # least one keyword argument is 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 input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new - # - # # Call the delete_input method. - # result = client.delete_input 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_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.delete_input request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified input. - # - # @overload update_input(request, options = nil) - # Pass arguments to `update_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_input(update_mask: nil, input: nil, request_id: nil) - # Pass arguments to `update_input` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the Input - # resource by the update. You can only update the following fields: - # - # * [`tier`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#Tier) - # * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) - # * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the mask is not present, then each field from the list above is updated - # if the field appears in the request payload. To unset a field, add the - # field to the update mask and remove it from the request payload. - # @param input [::Google::Cloud::Video::LiveStream::V1::Input, ::Hash] - # Required. The input resource to be updated. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new - # - # # Call the update_input method. - # result = client.update_input 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_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest - - # Converts hash 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_input.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::Video::LiveStream::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_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.update_input request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Preview the streaming content of the specified input. - # - # @overload preview_input(request, options = nil) - # Pass arguments to `preview_input` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload preview_input(name: nil) - # Pass arguments to `preview_input` via keyword arguments. Note that at - # least one keyword argument is 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 input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new - # - # # Call the preview_input method. - # result = client.preview_input request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::PreviewInputResponse. - # p result - # - def preview_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest - - # Converts hash 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.preview_input.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::Video::LiveStream::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.preview_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.preview_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.preview_input request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an event with the provided unique ID in the specified channel. - # - # @overload create_event(request, options = nil) - # Pass arguments to `create_event` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(parent: nil, event: nil, event_id: nil, request_id: nil) - # Pass arguments to `create_event` via keyword arguments. Note that at - # least one keyword argument is 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 channel for the resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param event [::Google::Cloud::Video::LiveStream::V1::Event, ::Hash] - # Required. The event resource to be created. - # @param event_id [::String] - # Required. The ID of the event resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Event] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new - # - # # Call the create_event method. - # result = client.create_event request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. - # p result - # - def create_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest - - # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.create_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all events in the specified channel. - # - # @overload list_events(request, options = nil) - # Pass arguments to `list_events` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_events` via keyword arguments. Note that at - # least one keyword argument is 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 channel for the resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param page_size [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListEventsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @param page_token [::String] - # The next_page_token value returned from a previous List request, if any. - # @param filter [::String] - # The filter to apply to list results. - # @param order_by [::String] - # Specifies the ordering of results following syntax at - # https://cloud.google.com/apis/design/design_patterns#sorting_order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Event>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new - # - # # Call the list_events method. - # result = client.list_events 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::Video::LiveStream::V1::Event. - # p item - # end - # - def list_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest - - # Converts hash 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_events.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::Video::LiveStream::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_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.list_events request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_events, "events", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified event. - # - # @overload get_event(request, options = nil) - # Pass arguments to `get_event` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil) - # Pass arguments to `get_event` via keyword arguments. Note that at - # least one keyword argument is 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 event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Event] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new - # - # # Call the get_event method. - # result = client.get_event request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. - # p result - # - def get_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetEventRequest - - # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.get_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified event. - # - # @overload delete_event(request, options = nil) - # Pass arguments to `delete_event` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) - # Pass arguments to `delete_event` via keyword arguments. Note that at - # least one keyword argument is 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 event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new - # - # # Call the delete_event method. - # result = client.delete_event request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest - - # Converts hash 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_event.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::Video::LiveStream::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_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.delete_event request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all clips in the specified channel. - # - # @overload list_clips(request, options = nil) - # Pass arguments to `list_clips` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListClipsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clips(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clips` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListClipsRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Clip>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new - # - # # Call the list_clips method. - # result = client.list_clips 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::Video::LiveStream::V1::Clip. - # p item - # end - # - def list_clips request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest - - # Converts hash 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_clips.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::Video::LiveStream::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_clips.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clips.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.list_clips request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_clips, "clips", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified clip. - # - # @overload get_clip(request, options = nil) - # Pass arguments to `get_clip` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetClipRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetClipRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clip(name: nil) - # Pass arguments to `get_clip` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Clip] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Clip] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new - # - # # Call the get_clip method. - # result = client.get_clip request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip. - # p result - # - def get_clip request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetClipRequest - - # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_clip.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.get_clip request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a clip with the provided clip ID in the specified channel. - # - # @overload create_clip(request, options = nil) - # Pass arguments to `create_clip` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateClipRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clip(parent: nil, clip_id: nil, clip: nil, request_id: nil) - # Pass arguments to `create_clip` via keyword arguments. Note that at - # least one keyword argument is 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 name, in the following form: - # `projects/{project}/locations/{location}/channels/{channel}`. - # @param clip_id [::String] - # Required. The ID of the clip resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param clip [::Google::Cloud::Video::LiveStream::V1::Clip, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new - # - # # Call the create_clip method. - # result = client.create_clip 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_clip request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest - - # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_clip.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.create_clip request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified clip job resource. This method only deletes the clip - # job and does not delete the VOD clip stored in Cloud Storage. - # - # @overload delete_clip(request, options = nil) - # Pass arguments to `delete_clip` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clip(name: nil, request_id: nil) - # Pass arguments to `delete_clip` via keyword arguments. Note that at - # least one keyword argument is 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 clip resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new - # - # # Call the delete_clip method. - # result = client.delete_clip 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_clip request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest - - # Converts hash 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_clip.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::Video::LiveStream::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_clip.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_clip.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.delete_clip request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a DVR session with the provided unique ID in the specified channel. - # - # @overload create_dvr_session(request, options = nil) - # Pass arguments to `create_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(parent: nil, dvr_session_id: nil, dvr_session: nil, request_id: nil) - # Pass arguments to `create_dvr_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 name, in the following form: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @param dvr_session_id [::String] - # Required. The ID of the DVR session resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new - # - # # Call the create_dvr_session method. - # result = client.create_dvr_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_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.create_dvr_session request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all DVR sessions in the specified channel. - # - # @overload list_dvr_sessions(request, options = nil) - # Pass arguments to `list_dvr_sessions` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_dvr_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. Parent value for ListDvrSessionsRequest - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::DvrSession>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.new - # - # # Call the list_dvr_sessions method. - # result = client.list_dvr_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::Video::LiveStream::V1::DvrSession. - # p item - # end - # - def list_dvr_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_sessions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_dvr_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.list_dvr_sessions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_dvr_sessions, "dvr_sessions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified DVR session. - # - # @overload get_dvr_session(request, options = nil) - # Pass arguments to `get_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(name: nil) - # Pass arguments to `get_dvr_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. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::DvrSession] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new - # - # # Call the get_dvr_session method. - # result = client.get_dvr_session request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::DvrSession. - # p result - # - def get_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.get_dvr_session request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified DVR session. - # - # @overload delete_dvr_session(request, options = nil) - # Pass arguments to `delete_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(name: nil, request_id: nil) - # Pass arguments to `delete_dvr_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 event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.new - # - # # Call the delete_dvr_session method. - # result = client.delete_dvr_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_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.delete_dvr_session request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified DVR session. - # - # @overload update_dvr_session(request, options = nil) - # Pass arguments to `update_dvr_session` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dvr_session(update_mask: nil, dvr_session: nil, request_id: nil) - # Pass arguments to `update_dvr_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # DvrSession resource by the update. You can only update the following - # fields: - # - # * `dvrWindows` - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # @param dvr_session [::Google::Cloud::Video::LiveStream::V1::DvrSession, ::Hash] - # Required. The DVR session resource to be updated. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new - # - # # Call the update_dvr_session method. - # result = client.update_dvr_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 update_dvr_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest - - # Converts hash 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_dvr_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::Video::LiveStream::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_dvr_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_dvr_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.update_dvr_session request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a Asset with the provided unique ID in the specified - # region. - # - # @overload create_asset(request, options = nil) - # Pass arguments to `create_asset` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil, request_id: nil) - # Pass arguments to `create_asset` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param asset [::Google::Cloud::Video::LiveStream::V1::Asset, ::Hash] - # Required. The asset resource to be created. - # @param asset_id [::String] - # Required. The ID of the asset resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new - # - # # Call the create_asset method. - # result = client.create_asset 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_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest - - # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.create_asset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the specified asset if it is not used. - # - # @overload delete_asset(request, options = nil) - # Pass arguments to `delete_asset` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil, request_id: nil) - # Pass arguments to `delete_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset resource, in the form of: - # `projects/{project}/locations/{location}/assets/{assetId}`. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new - # - # # Call the delete_asset method. - # result = client.delete_asset 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_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest - - # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.delete_asset request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified asset. - # - # @overload get_asset(request, options = nil) - # Pass arguments to `get_asset` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil) - # Pass arguments to `get_asset` via keyword arguments. Note that at - # least one keyword argument is 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. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/assets/{asset}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new - # - # # Call the get_asset method. - # result = client.get_asset request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset. - # p result - # - def get_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest - - # Converts hash 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_asset.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::Video::LiveStream::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_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.get_asset request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns a list of all assets in the specified region. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is 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 location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Video::LiveStream::V1::Asset>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets 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::Video::LiveStream::V1::Asset. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest - - # Converts hash 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_assets.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::Video::LiveStream::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_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.list_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @livestream_service_stub, :list_assets, "assets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the specified pool. - # - # @overload get_pool(request, options = nil) - # Pass arguments to `get_pool` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::GetPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pool(name: nil) - # Pass arguments to `get_pool` via keyword arguments. Note that at - # least one keyword argument is 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 pool resource, in the form of: - # `projects/{project}/locations/{location}/pools/{poolId}`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Pool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Pool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new - # - # # Call the get_pool method. - # result = client.get_pool request - # - # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool. - # p result - # - def get_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest - - # Converts hash 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_pool.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::Video::LiveStream::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_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.get_pool request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the specified pool. - # - # @overload update_pool(request, options = nil) - # Pass arguments to `update_pool` via a request object, either of type - # {::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_pool(update_mask: nil, pool: nil, request_id: nil) - # Pass arguments to `update_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the Pool - # resource by the update. You can only update the following fields: - # - # * `networkConfig` - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # @param pool [::Google::Cloud::Video::LiveStream::V1::Pool, ::Hash] - # Required. The pool resource to be updated. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @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/video/live_stream/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new - # - # # Call the update_pool method. - # result = client.update_pool 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_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest - - # Converts hash 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_pool.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::Video::LiveStream::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_pool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @livestream_service_stub.update_pool request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the LivestreamService REST API. - # - # This class represents the configuration for LivestreamService 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::Video::LiveStream::V1::LivestreamService::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_channel to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_channel.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_channel.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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 LivestreamService 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_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :create_channel - ## - # RPC-specific configuration for `list_channels` - # @return [::Gapic::Config::Method] - # - attr_reader :list_channels - ## - # RPC-specific configuration for `get_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :get_channel - ## - # RPC-specific configuration for `delete_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_channel - ## - # RPC-specific configuration for `update_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :update_channel - ## - # RPC-specific configuration for `start_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :start_channel - ## - # RPC-specific configuration for `stop_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_channel - ## - # RPC-specific configuration for `start_distribution` - # @return [::Gapic::Config::Method] - # - attr_reader :start_distribution - ## - # RPC-specific configuration for `stop_distribution` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_distribution - ## - # RPC-specific configuration for `create_input` - # @return [::Gapic::Config::Method] - # - attr_reader :create_input - ## - # RPC-specific configuration for `list_inputs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_inputs - ## - # RPC-specific configuration for `get_input` - # @return [::Gapic::Config::Method] - # - attr_reader :get_input - ## - # RPC-specific configuration for `delete_input` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_input - ## - # RPC-specific configuration for `update_input` - # @return [::Gapic::Config::Method] - # - attr_reader :update_input - ## - # RPC-specific configuration for `preview_input` - # @return [::Gapic::Config::Method] - # - attr_reader :preview_input - ## - # RPC-specific configuration for `create_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event - ## - # RPC-specific configuration for `list_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_events - ## - # RPC-specific configuration for `get_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event - ## - # RPC-specific configuration for `delete_event` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event - ## - # RPC-specific configuration for `list_clips` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clips - ## - # RPC-specific configuration for `get_clip` - # @return [::Gapic::Config::Method] - # - attr_reader :get_clip - ## - # RPC-specific configuration for `create_clip` - # @return [::Gapic::Config::Method] - # - attr_reader :create_clip - ## - # RPC-specific configuration for `delete_clip` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_clip - ## - # RPC-specific configuration for `create_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_dvr_session - ## - # RPC-specific configuration for `list_dvr_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_dvr_sessions - ## - # RPC-specific configuration for `get_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dvr_session - ## - # RPC-specific configuration for `delete_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_dvr_session - ## - # RPC-specific configuration for `update_dvr_session` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dvr_session - ## - # RPC-specific configuration for `create_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_asset - ## - # RPC-specific configuration for `delete_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_asset - ## - # RPC-specific configuration for `get_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_asset - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `get_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_pool - ## - # RPC-specific configuration for `update_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_pool - - # @private - def initialize parent_rpcs = nil - create_channel_config = parent_rpcs.create_channel if parent_rpcs.respond_to? :create_channel - @create_channel = ::Gapic::Config::Method.new create_channel_config - list_channels_config = parent_rpcs.list_channels if parent_rpcs.respond_to? :list_channels - @list_channels = ::Gapic::Config::Method.new list_channels_config - get_channel_config = parent_rpcs.get_channel if parent_rpcs.respond_to? :get_channel - @get_channel = ::Gapic::Config::Method.new get_channel_config - delete_channel_config = parent_rpcs.delete_channel if parent_rpcs.respond_to? :delete_channel - @delete_channel = ::Gapic::Config::Method.new delete_channel_config - update_channel_config = parent_rpcs.update_channel if parent_rpcs.respond_to? :update_channel - @update_channel = ::Gapic::Config::Method.new update_channel_config - start_channel_config = parent_rpcs.start_channel if parent_rpcs.respond_to? :start_channel - @start_channel = ::Gapic::Config::Method.new start_channel_config - stop_channel_config = parent_rpcs.stop_channel if parent_rpcs.respond_to? :stop_channel - @stop_channel = ::Gapic::Config::Method.new stop_channel_config - start_distribution_config = parent_rpcs.start_distribution if parent_rpcs.respond_to? :start_distribution - @start_distribution = ::Gapic::Config::Method.new start_distribution_config - stop_distribution_config = parent_rpcs.stop_distribution if parent_rpcs.respond_to? :stop_distribution - @stop_distribution = ::Gapic::Config::Method.new stop_distribution_config - create_input_config = parent_rpcs.create_input if parent_rpcs.respond_to? :create_input - @create_input = ::Gapic::Config::Method.new create_input_config - list_inputs_config = parent_rpcs.list_inputs if parent_rpcs.respond_to? :list_inputs - @list_inputs = ::Gapic::Config::Method.new list_inputs_config - get_input_config = parent_rpcs.get_input if parent_rpcs.respond_to? :get_input - @get_input = ::Gapic::Config::Method.new get_input_config - delete_input_config = parent_rpcs.delete_input if parent_rpcs.respond_to? :delete_input - @delete_input = ::Gapic::Config::Method.new delete_input_config - update_input_config = parent_rpcs.update_input if parent_rpcs.respond_to? :update_input - @update_input = ::Gapic::Config::Method.new update_input_config - preview_input_config = parent_rpcs.preview_input if parent_rpcs.respond_to? :preview_input - @preview_input = ::Gapic::Config::Method.new preview_input_config - create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event - @create_event = ::Gapic::Config::Method.new create_event_config - list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events - @list_events = ::Gapic::Config::Method.new list_events_config - get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event - @get_event = ::Gapic::Config::Method.new get_event_config - delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event - @delete_event = ::Gapic::Config::Method.new delete_event_config - list_clips_config = parent_rpcs.list_clips if parent_rpcs.respond_to? :list_clips - @list_clips = ::Gapic::Config::Method.new list_clips_config - get_clip_config = parent_rpcs.get_clip if parent_rpcs.respond_to? :get_clip - @get_clip = ::Gapic::Config::Method.new get_clip_config - create_clip_config = parent_rpcs.create_clip if parent_rpcs.respond_to? :create_clip - @create_clip = ::Gapic::Config::Method.new create_clip_config - delete_clip_config = parent_rpcs.delete_clip if parent_rpcs.respond_to? :delete_clip - @delete_clip = ::Gapic::Config::Method.new delete_clip_config - create_dvr_session_config = parent_rpcs.create_dvr_session if parent_rpcs.respond_to? :create_dvr_session - @create_dvr_session = ::Gapic::Config::Method.new create_dvr_session_config - list_dvr_sessions_config = parent_rpcs.list_dvr_sessions if parent_rpcs.respond_to? :list_dvr_sessions - @list_dvr_sessions = ::Gapic::Config::Method.new list_dvr_sessions_config - get_dvr_session_config = parent_rpcs.get_dvr_session if parent_rpcs.respond_to? :get_dvr_session - @get_dvr_session = ::Gapic::Config::Method.new get_dvr_session_config - delete_dvr_session_config = parent_rpcs.delete_dvr_session if parent_rpcs.respond_to? :delete_dvr_session - @delete_dvr_session = ::Gapic::Config::Method.new delete_dvr_session_config - update_dvr_session_config = parent_rpcs.update_dvr_session if parent_rpcs.respond_to? :update_dvr_session - @update_dvr_session = ::Gapic::Config::Method.new update_dvr_session_config - create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset - @create_asset = ::Gapic::Config::Method.new create_asset_config - delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset - @delete_asset = ::Gapic::Config::Method.new delete_asset_config - get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset - @get_asset = ::Gapic::Config::Method.new get_asset_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - get_pool_config = parent_rpcs.get_pool if parent_rpcs.respond_to? :get_pool - @get_pool = ::Gapic::Config::Method.new get_pool_config - update_pool_config = parent_rpcs.update_pool if parent_rpcs.respond_to? :update_pool - @update_pool = ::Gapic::Config::Method.new update_pool_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb deleted file mode 100644 index 8db54d1cdab6..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/operations.rb +++ /dev/null @@ -1,927 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - module LivestreamService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the LivestreamService 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 LivestreamService 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @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::Video::LiveStream::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? - throw :response, 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::Video::LiveStream::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? - throw :response, 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::Video::LiveStream::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? - 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::Video::LiveStream::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? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "livestream.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "cancel_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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/[^/]+/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/[^/]+/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", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb deleted file mode 100644 index 544178ad6b12..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/livestream_service/rest/service_stub.rb +++ /dev/null @@ -1,2172 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" - -module Google - module Cloud - module Video - module LiveStream - module V1 - module LivestreamService - module Rest - ## - # REST service stub for the LivestreamService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the create_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest] - # 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_channel request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_channel_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, - method_name: "create_channel", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_channels REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest] - # 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::Video::LiveStream::V1::ListChannelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse] - # A result object deserialized from the server's reply - def list_channels request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_channels_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, - method_name: "list_channels", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest] - # 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::Video::LiveStream::V1::Channel] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Channel] - # A result object deserialized from the server's reply - def get_channel request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_channel_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, - method_name: "get_channel", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Channel.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest] - # 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_channel request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_channel_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, - method_name: "delete_channel", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest] - # 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_channel request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_channel_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, - method_name: "update_channel", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the start_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest] - # 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_channel request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_channel_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, - method_name: "start_channel", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the stop_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest] - # 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_channel request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_channel_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, - method_name: "stop_channel", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the start_distribution REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest] - # 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_distribution request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_distribution_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, - method_name: "start_distribution", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the stop_distribution REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest] - # 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_distribution request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_distribution_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, - method_name: "stop_distribution", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest] - # 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_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_input_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, - method_name: "create_input", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_inputs REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest] - # 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::Video::LiveStream::V1::ListInputsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListInputsResponse] - # A result object deserialized from the server's reply - def list_inputs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_inputs_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, - method_name: "list_inputs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetInputRequest] - # 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::Video::LiveStream::V1::Input] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Input] - # A result object deserialized from the server's reply - def get_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_input_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, - method_name: "get_input", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Input.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest] - # 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_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_input_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, - method_name: "delete_input", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest] - # 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_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_input_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, - method_name: "update_input", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the preview_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest] - # 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::Video::LiveStream::V1::PreviewInputResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse] - # A result object deserialized from the server's reply - def preview_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_preview_input_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, - method_name: "preview_input", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_event REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest] - # 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::Video::LiveStream::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Event] - # A result object deserialized from the server's reply - def create_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_event_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, - method_name: "create_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_events REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest] - # 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::Video::LiveStream::V1::ListEventsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListEventsResponse] - # A result object deserialized from the server's reply - def list_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_events_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, - method_name: "list_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_event REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetEventRequest] - # 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::Video::LiveStream::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Event] - # A result object deserialized from the server's reply - def get_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_event_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, - method_name: "get_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Event.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_event REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest] - # 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_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_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, - method_name: "delete_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_clips REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest] - # 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::Video::LiveStream::V1::ListClipsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListClipsResponse] - # A result object deserialized from the server's reply - def list_clips request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clips_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, - method_name: "list_clips", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_clip REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetClipRequest] - # 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::Video::LiveStream::V1::Clip] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Clip] - # A result object deserialized from the server's reply - def get_clip request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_clip_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, - method_name: "get_clip", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Clip.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_clip REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest] - # 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_clip request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_clip_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, - method_name: "create_clip", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_clip REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest] - # 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_clip request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_clip_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, - method_name: "delete_clip", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest] - # 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_dvr_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_dvr_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, - method_name: "create_dvr_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_dvr_sessions REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest] - # 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::Video::LiveStream::V1::ListDvrSessionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse] - # A result object deserialized from the server's reply - def list_dvr_sessions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_dvr_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, - method_name: "list_dvr_sessions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest] - # 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::Video::LiveStream::V1::DvrSession] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] - # A result object deserialized from the server's reply - def get_dvr_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_dvr_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, - method_name: "get_dvr_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::DvrSession.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest] - # 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_dvr_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_dvr_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, - method_name: "delete_dvr_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest] - # 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_dvr_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_dvr_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, - method_name: "update_dvr_session", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_asset REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest] - # 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_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_asset_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, - method_name: "create_asset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_asset REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest] - # 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_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_asset_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, - method_name: "delete_asset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_asset REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest] - # 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::Video::LiveStream::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Asset] - # A result object deserialized from the server's reply - def get_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_asset_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, - method_name: "get_asset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Asset.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_assets REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest] - # 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::Video::LiveStream::V1::ListAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse] - # A result object deserialized from the server's reply - def list_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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, - method_name: "list_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_pool REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest] - # 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::Video::LiveStream::V1::Pool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Video::LiveStream::V1::Pool] - # A result object deserialized from the server's reply - def get_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_pool_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, - method_name: "get_pool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Video::LiveStream::V1::Pool.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_pool REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest] - # 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_pool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_pool_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, - method_name: "update_pool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the create_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest] - # 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_channel_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/channels", - body: "channel", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_channels REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest] - # 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_channels_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/channels", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetChannelRequest] - # 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_channel_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest] - # 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_channel_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest] - # 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_channel_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{channel.name}", - body: "channel", - matches: [ - ["channel.name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartChannelRequest] - # 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_channel_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:start", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_channel REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopChannelRequest] - # 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_channel_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:stop", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_distribution REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest] - # 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_distribution_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:startdistribution", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_distribution REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest] - # 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_distribution_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:stopdistribution", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateInputRequest] - # 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_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/inputs", - body: "input", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_inputs REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListInputsRequest] - # 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_inputs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/inputs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetInputRequest] - # 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_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest] - # 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_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest] - # 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_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{input.name}", - body: "input", - matches: [ - ["input.name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the preview_input REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_preview_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:preview", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/inputs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_event REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateEventRequest] - # 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_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/events", - body: "event", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_events REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListEventsRequest] - # 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_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/events", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_event REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetEventRequest] - # 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_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/events/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_event REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest] - # 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_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/events/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_clips REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest] - # 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_clips_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/clips", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_clip REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetClipRequest] - # 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_clip_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/clips/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_clip REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest] - # 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_clip_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/clips", - body: "clip", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_clip REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest] - # 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_clip_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/clips/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest] - # 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_dvr_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/dvrSessions", - body: "dvr_session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_dvr_sessions REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest] - # 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_dvr_sessions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/dvrSessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest] - # 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_dvr_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/dvrSessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest] - # 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_dvr_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/dvrSessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_dvr_session REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest] - # 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_dvr_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{dvr_session.name}", - body: "dvr_session", - matches: [ - ["dvr_session.name", %r{^projects/[^/]+/locations/[^/]+/channels/[^/]+/dvrSessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_asset REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest] - # 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_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assets", - body: "asset", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_asset REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest] - # 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_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_asset REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetAssetRequest] - # 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_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_assets REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest] - # 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_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/assets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_pool REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::GetPoolRequest] - # 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_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/pools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_pool REST call - # - # @param request_pb [::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest] - # 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_pool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{pool.name}", - body: "pool", - matches: [ - ["pool.name", %r{^projects/[^/]+/locations/[^/]+/pools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb deleted file mode 100644 index ed1016097c8a..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/rest.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/livestream_service/rest" -require "google/cloud/video/live_stream/v1/bindings_override" -require "google/cloud/video/live_stream/v1/version" - -module Google - module Cloud - module Video - module LiveStream - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/video/live_stream/v1/rest" - # client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new - # - module V1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb deleted file mode 100644 index cdd336eff66a..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/live_stream/v1/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb deleted file mode 100644 index 32a936f375d8..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/outputs_pb.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/video/livestream/v1/outputs.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/rpc/status_pb' -require 'google/type/datetime_pb' - - -descriptor_data = "\n.google/cloud/video/livestream/v1/outputs.proto\x12 google.cloud.video.livestream.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x17google/rpc/status.proto\x1a\x1agoogle/type/datetime.proto\"\x87\x02\n\x10\x45lementaryStream\x12\x0b\n\x03key\x18\x04 \x01(\t\x12\x45\n\x0cvideo_stream\x18\x01 \x01(\x0b\x32-.google.cloud.video.livestream.v1.VideoStreamH\x00\x12\x45\n\x0c\x61udio_stream\x18\x02 \x01(\x0b\x32-.google.cloud.video.livestream.v1.AudioStreamH\x00\x12\x43\n\x0btext_stream\x18\x03 \x01(\x0b\x32,.google.cloud.video.livestream.v1.TextStreamH\x00\x42\x13\n\x11\x65lementary_stream\"\xab\x01\n\tMuxStream\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x03 \x01(\t\x12\x1a\n\x12\x65lementary_streams\x18\x04 \x03(\t\x12K\n\x10segment_settings\x18\x05 \x01(\x0b\x32\x31.google.cloud.video.livestream.v1.SegmentSettings\x12\x15\n\rencryption_id\x18\x06 \x01(\t\"\xce\x02\n\x08Manifest\x12\x11\n\tfile_name\x18\x01 \x01(\t\x12J\n\x04type\x18\x02 \x01(\x0e\x32\x37.google.cloud.video.livestream.v1.Manifest.ManifestTypeB\x03\xe0\x41\x02\x12\x18\n\x0bmux_streams\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12\x19\n\x11max_segment_count\x18\x04 \x01(\x05\x12\x38\n\x15segment_keep_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12 \n\x18use_timecode_as_timeline\x18\x06 \x01(\x08\x12\x10\n\x03key\x18\x07 \x01(\tB\x03\xe0\x41\x01\"@\n\x0cManifestType\x12\x1d\n\x19MANIFEST_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03HLS\x10\x01\x12\x08\n\x04\x44\x41SH\x10\x02\"_\n\x12\x44istributionStream\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tcontainer\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\x12\x65lementary_streams\x18\x03 \x03(\tB\x03\xe0\x41\x02\"\xc7\x03\n\x0c\x44istribution\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13\x64istribution_stream\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x05state\x18\x03 \x01(\x0e\x32\x34.google.cloud.video.livestream.v1.Distribution.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12K\n\x08srt_push\x18\x05 \x01(\x0b\x32\x37.google.cloud.video.livestream.v1.SrtPushOutputEndpointH\x00\x12M\n\trtmp_push\x18\x06 \x01(\x0b\x32\x38.google.cloud.video.livestream.v1.RtmpPushOutputEndpointH\x00\"i\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45RROR\x10\x05\x12\r\n\tNOT_READY\x10\x06\x12\t\n\x05READY\x10\x07\x12\x12\n\x0e\x41WAITING_INPUT\x10\x08\x12\x10\n\x0c\x44ISTRIBUTING\x10\tB\n\n\x08\x65ndpoint\"\x94\x01\n\x15SrtPushOutputEndpoint\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12T\n\x19passphrase_secret_version\x18\x02 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersionH\x00\x42\x13\n\x11passphrase_source\"C\n\x16RtmpPushOutputEndpoint\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nstream_key\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xe3\x01\n\x0bSpriteSheet\x12\x0e\n\x06\x66ormat\x18\x01 \x01(\t\x12\x18\n\x0b\x66ile_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13sprite_width_pixels\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\x12!\n\x14sprite_height_pixels\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x14\n\x0c\x63olumn_count\x18\x05 \x01(\x05\x12\x11\n\trow_count\x18\x06 \x01(\x05\x12+\n\x08interval\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0f\n\x07quality\x18\x08 \x01(\x05\"\xc5\x03\n\x13PreprocessingConfig\x12J\n\x05\x61udio\x18\x01 \x01(\x0b\x32;.google.cloud.video.livestream.v1.PreprocessingConfig.Audio\x12H\n\x04\x63rop\x18\x02 \x01(\x0b\x32:.google.cloud.video.livestream.v1.PreprocessingConfig.Crop\x12\x46\n\x03pad\x18\x03 \x01(\x0b\x32\x39.google.cloud.video.livestream.v1.PreprocessingConfig.Pad\x1a\x15\n\x05\x41udio\x12\x0c\n\x04lufs\x18\x01 \x01(\x01\x1a\\\n\x04\x43rop\x12\x12\n\ntop_pixels\x18\x01 \x01(\x05\x12\x15\n\rbottom_pixels\x18\x02 \x01(\x05\x12\x13\n\x0bleft_pixels\x18\x03 \x01(\x05\x12\x14\n\x0cright_pixels\x18\x04 \x01(\x05\x1a[\n\x03Pad\x12\x12\n\ntop_pixels\x18\x01 \x01(\x05\x12\x15\n\rbottom_pixels\x18\x02 \x01(\x05\x12\x13\n\x0bleft_pixels\x18\x03 \x01(\x05\x12\x14\n\x0cright_pixels\x18\x04 \x01(\x05\"\xbe\x07\n\x0bVideoStream\x12O\n\x04h264\x18\x14 \x01(\x0b\x32?.google.cloud.video.livestream.v1.VideoStream.H264CodecSettingsH\x00\x12O\n\x04h265\x18\x15 \x01(\x0b\x32?.google.cloud.video.livestream.v1.VideoStream.H265CodecSettingsH\x00\x1a\x8c\x03\n\x11H264CodecSettings\x12\x14\n\x0cwidth_pixels\x18\x01 \x01(\x05\x12\x15\n\rheight_pixels\x18\x02 \x01(\x05\x12\x17\n\nframe_rate\x18\x03 \x01(\x01\x42\x03\xe0\x41\x02\x12\x18\n\x0b\x62itrate_bps\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\x0e\x61llow_open_gop\x18\x06 \x01(\x08\x12\x19\n\x0fgop_frame_count\x18\x07 \x01(\x05H\x00\x12\x31\n\x0cgop_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x15\n\rvbv_size_bits\x18\t \x01(\x05\x12\x19\n\x11vbv_fullness_bits\x18\n \x01(\x05\x12\x15\n\rentropy_coder\x18\x0b \x01(\t\x12\x11\n\tb_pyramid\x18\x0c \x01(\x08\x12\x15\n\rb_frame_count\x18\r \x01(\x05\x12\x13\n\x0b\x61q_strength\x18\x0e \x01(\x01\x12\x0f\n\x07profile\x18\x0f \x01(\t\x12\x0c\n\x04tune\x18\x10 \x01(\tB\n\n\x08gop_mode\x1a\xeb\x02\n\x11H265CodecSettings\x12\x19\n\x0cwidth_pixels\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1a\n\rheight_pixels\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\nframe_rate\x18\x03 \x01(\x01\x42\x03\xe0\x41\x02\x12\x18\n\x0b\x62itrate_bps\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1e\n\x0fgop_frame_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x12\x36\n\x0cgop_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x00\x12\x1a\n\rvbv_size_bits\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11vbv_fullness_bits\x18\n \x01(\x05\x42\x03\xe0\x41\x01\x12\x16\n\tb_pyramid\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rb_frame_count\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x61q_strength\x18\r \x01(\x01\x42\x03\xe0\x41\x01\x42\n\n\x08gop_modeB\x10\n\x0e\x63odec_settings\"\xec\x02\n\x0b\x41udioStream\x12\x10\n\x08transmux\x18\x08 \x01(\x08\x12\r\n\x05\x63odec\x18\x01 \x01(\t\x12\x18\n\x0b\x62itrate_bps\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x15\n\rchannel_count\x18\x03 \x01(\x05\x12\x16\n\x0e\x63hannel_layout\x18\x04 \x03(\t\x12K\n\x07mapping\x18\x05 \x03(\x0b\x32:.google.cloud.video.livestream.v1.AudioStream.AudioMapping\x12\x19\n\x11sample_rate_hertz\x18\x06 \x01(\x05\x1a\x8a\x01\n\x0c\x41udioMapping\x12\x16\n\tinput_key\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0binput_track\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1a\n\rinput_channel\x18\x03 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1b\n\x0eoutput_channel\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x0f\n\x07gain_db\x18\x05 \x01(\x01\"\xcb\x02\n\nTextStream\x12\x12\n\x05\x63odec\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12output_cea_channel\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12N\n\x07mapping\x18\x03 \x03(\x0b\x32\x38.google.cloud.video.livestream.v1.TextStream.TextMappingB\x03\xe0\x41\x01\x1a\x80\x01\n\x0bTextMapping\x12\x16\n\tinput_key\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0binput_track\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1e\n\x11input_cea_channel\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x66rom_language_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\"F\n\x0fSegmentSettings\x12\x33\n\x10segment_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xac\x02\n\x0eTimecodeConfig\x12O\n\x06source\x18\x01 \x01(\x0e\x32?.google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource\x12/\n\nutc_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12*\n\ttime_zone\x18\x03 \x01(\x0b\x32\x15.google.type.TimeZoneH\x00\"]\n\x0eTimecodeSource\x12\x1f\n\x1bTIMECODE_SOURCE_UNSPECIFIED\x10\x00\x12\x13\n\x0fMEDIA_TIMESTAMP\x10\x01\x12\x15\n\x11\x45MBEDDED_TIMECODE\x10\x02\x42\r\n\x0btime_offsetB\xe9\x01\n$com.google.cloud.video.livestream.v1B\x0cOutputsProtoP\x01ZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb\xaa\x02 Google.Cloud.Video.LiveStream.V1\xca\x02 Google\\Cloud\\Video\\LiveStream\\V1\xea\x02$Google::Cloud::Video::LiveStream::V1b\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.rpc.Status", "google/rpc/status.proto"], - ["google.type.TimeZone", "google/type/datetime.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 Video - module LiveStream - module V1 - ElementaryStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ElementaryStream").msgclass - MuxStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.MuxStream").msgclass - Manifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Manifest").msgclass - Manifest::ManifestType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Manifest.ManifestType").enummodule - DistributionStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DistributionStream").msgclass - Distribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Distribution").msgclass - Distribution::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Distribution.State").enummodule - SrtPushOutputEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.SrtPushOutputEndpoint").msgclass - RtmpPushOutputEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.RtmpPushOutputEndpoint").msgclass - SpriteSheet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.SpriteSheet").msgclass - PreprocessingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig").msgclass - PreprocessingConfig::Audio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig.Audio").msgclass - PreprocessingConfig::Crop = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig.Crop").msgclass - PreprocessingConfig::Pad = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreprocessingConfig.Pad").msgclass - VideoStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStream").msgclass - VideoStream::H264CodecSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStream.H264CodecSettings").msgclass - VideoStream::H265CodecSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStream.H265CodecSettings").msgclass - AudioStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioStream").msgclass - AudioStream::AudioMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioStream.AudioMapping").msgclass - TextStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TextStream").msgclass - TextStream::TextMapping = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TextStream.TextMapping").msgclass - SegmentSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.SegmentSettings").msgclass - TimecodeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TimecodeConfig").msgclass - TimecodeConfig::TimecodeSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TimecodeConfig.TimecodeSource").enummodule - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb deleted file mode 100644 index eb89852aecb9..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/resources_pb.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/video/livestream/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/video/livestream/v1/outputs_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n0google/cloud/video/livestream/v1/resources.proto\x12 google.cloud.video.livestream.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/video/livestream/v1/outputs.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x98\x07\n\x05Input\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Input.LabelsEntry\x12:\n\x04type\x18\x05 \x01(\x0e\x32,.google.cloud.video.livestream.v1.Input.Type\x12:\n\x04tier\x18\x0e \x01(\x0e\x32,.google.cloud.video.livestream.v1.Input.Tier\x12\x10\n\x03uri\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12S\n\x14preprocessing_config\x18\t \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.PreprocessingConfig\x12L\n\x0esecurity_rules\x18\x0c \x01(\x0b\x32\x34.google.cloud.video.livestream.v1.Input.SecurityRule\x12Y\n\x15input_stream_property\x18\x0f \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.InputStreamPropertyB\x03\xe0\x41\x03\x1a!\n\x0cSecurityRule\x12\x11\n\tip_ranges\x18\x01 \x03(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"9\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tRTMP_PUSH\x10\x01\x12\x0c\n\x08SRT_PUSH\x10\x02\"]\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x06\n\x02SD\x10\x01\x12\x06\n\x02HD\x10\x02\x12\x07\n\x03UHD\x10\x03\x12\x0b\n\x07SD_H265\x10\x04\x12\x0b\n\x07HD_H265\x10\x05\x12\x0c\n\x08UHD_H265\x10\x06:\\\xea\x41Y\n\x1flivestream.googleapis.com/Input\x12\x36projects/{project}/locations/{location}/inputs/{input}\"\xb4\x0e\n\x07\x43hannel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x06labels\x18\x04 \x03(\x0b\x32\x35.google.cloud.video.livestream.v1.Channel.LabelsEntry\x12L\n\x11input_attachments\x18\x10 \x03(\x0b\x32\x31.google.cloud.video.livestream.v1.InputAttachment\x12\x19\n\x0c\x61\x63tive_input\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x45\n\x06output\x18\t \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.Channel.OutputB\x03\xe0\x41\x02\x12N\n\x12\x65lementary_streams\x18\n \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.ElementaryStream\x12@\n\x0bmux_streams\x18\x0b \x03(\x0b\x32+.google.cloud.video.livestream.v1.MuxStream\x12=\n\tmanifests\x18\x0c \x03(\x0b\x32*.google.cloud.video.livestream.v1.Manifest\x12W\n\x14\x64istribution_streams\x18\x1c \x03(\x0b\x32\x34.google.cloud.video.livestream.v1.DistributionStreamB\x03\xe0\x41\x01\x12J\n\rdistributions\x18\x1d \x03(\x0b\x32..google.cloud.video.livestream.v1.DistributionB\x03\xe0\x41\x01\x12\x44\n\rsprite_sheets\x18\r \x03(\x0b\x32-.google.cloud.video.livestream.v1.SpriteSheet\x12V\n\x0fstreaming_state\x18\x0e \x01(\x0e\x32\x38.google.cloud.video.livestream.v1.Channel.StreamingStateB\x03\xe0\x41\x03\x12\x30\n\x0fstreaming_error\x18\x12 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12?\n\nlog_config\x18\x13 \x01(\x0b\x32+.google.cloud.video.livestream.v1.LogConfig\x12I\n\x0ftimecode_config\x18\x15 \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.TimecodeConfig\x12\x46\n\x0b\x65ncryptions\x18\x18 \x03(\x0b\x32,.google.cloud.video.livestream.v1.EncryptionB\x03\xe0\x41\x01\x12\x43\n\x0cinput_config\x18\x19 \x01(\x0b\x32-.google.cloud.video.livestream.v1.InputConfig\x12P\n\x10retention_config\x18\x1a \x01(\x0b\x32\x31.google.cloud.video.livestream.v1.RetentionConfigB\x03\xe0\x41\x01\x12M\n\x0fstatic_overlays\x18\x1b \x03(\x0b\x32/.google.cloud.video.livestream.v1.StaticOverlayB\x03\xe0\x41\x01\x12\x61\n\x19\x61uto_transcription_config\x18\x1e \x01(\x0b\x32\x39.google.cloud.video.livestream.v1.AutoTranscriptionConfigB\x03\xe0\x41\x01\x1a\x15\n\x06Output\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xaa\x01\n\x0eStreamingState\x12\x1f\n\x1bSTREAMING_STATE_UNSPECIFIED\x10\x00\x12\r\n\tSTREAMING\x10\x01\x12\x12\n\x0e\x41WAITING_INPUT\x10\x02\x12\x13\n\x0fSTREAMING_ERROR\x10\x04\x12\x16\n\x12STREAMING_NO_INPUT\x10\x05\x12\x0b\n\x07STOPPED\x10\x06\x12\x0c\n\x08STARTING\x10\x07\x12\x0c\n\x08STOPPING\x10\x08:b\xea\x41_\n!livestream.googleapis.com/Channel\x12:projects/{project}/locations/{location}/channels/{channel}\"6\n\x14NormalizedCoordinate\x12\x0e\n\x01x\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x0e\n\x01y\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"6\n\x14NormalizedResolution\x12\x0e\n\x01w\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x0e\n\x01h\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\"\xfd\x01\n\rStaticOverlay\x12\x36\n\x05\x61sset\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Asset\x12O\n\nresolution\x18\x02 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.NormalizedResolutionB\x03\xe0\x41\x01\x12M\n\x08position\x18\x03 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.NormalizedCoordinateB\x03\xe0\x41\x01\x12\x14\n\x07opacity\x18\x04 \x01(\x01\x42\x03\xe0\x41\x01\"\xc6\x01\n\x0bInputConfig\x12X\n\x11input_switch_mode\x18\x01 \x01(\x0e\x32=.google.cloud.video.livestream.v1.InputConfig.InputSwitchMode\"]\n\x0fInputSwitchMode\x12!\n\x1dINPUT_SWITCH_MODE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x46\x41ILOVER_PREFER_PRIMARY\x10\x01\x12\n\n\x06MANUAL\x10\x03\"\xc0\x01\n\tLogConfig\x12M\n\x0clog_severity\x18\x01 \x01(\x0e\x32\x37.google.cloud.video.livestream.v1.LogConfig.LogSeverity\"d\n\x0bLogSeverity\x12\x1c\n\x18LOG_SEVERITY_UNSPECIFIED\x10\x00\x12\x07\n\x03OFF\x10\x01\x12\t\n\x05\x44\x45\x42UG\x10\x64\x12\t\n\x04INFO\x10\xc8\x01\x12\x0c\n\x07WARNING\x10\x90\x03\x12\n\n\x05\x45RROR\x10\xf4\x03\"O\n\x0fRetentionConfig\x12<\n\x19retention_window_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xea\x01\n\x13InputStreamProperty\x12\x37\n\x13last_establish_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12L\n\rvideo_streams\x18\x02 \x03(\x0b\x32\x35.google.cloud.video.livestream.v1.VideoStreamProperty\x12L\n\raudio_streams\x18\x03 \x03(\x0b\x32\x35.google.cloud.video.livestream.v1.AudioStreamProperty\"i\n\x13VideoStreamProperty\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x43\n\x0cvideo_format\x18\x02 \x01(\x0b\x32-.google.cloud.video.livestream.v1.VideoFormat\"]\n\x0bVideoFormat\x12\r\n\x05\x63odec\x18\x01 \x01(\t\x12\x14\n\x0cwidth_pixels\x18\x02 \x01(\x05\x12\x15\n\rheight_pixels\x18\x03 \x01(\x05\x12\x12\n\nframe_rate\x18\x04 \x01(\x01\"i\n\x13\x41udioStreamProperty\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x43\n\x0c\x61udio_format\x18\x02 \x01(\x0b\x32-.google.cloud.video.livestream.v1.AudioFormat\"K\n\x0b\x41udioFormat\x12\r\n\x05\x63odec\x18\x01 \x01(\t\x12\x15\n\rchannel_count\x18\x02 \x01(\x05\x12\x16\n\x0e\x63hannel_layout\x18\x03 \x03(\t\"\xdd\x01\n\x0fInputAttachment\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x33\n\x05input\x18\x02 \x01(\tB$\xfa\x41!\n\x1flivestream.googleapis.com/Input\x12_\n\x12\x61utomatic_failover\x18\x03 \x01(\x0b\x32\x43.google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover\x1a\'\n\x11\x41utomaticFailover\x12\x12\n\ninput_keys\x18\x01 \x03(\t\"\x99\x03\n\x17\x41utoTranscriptionConfig\x12\x64\n\x0e\x64isplay_timing\x18\x01 \x01(\x0e\x32G.google.cloud.video.livestream.v1.AutoTranscriptionConfig.DisplayTimingB\x03\xe0\x41\x01\x12\x64\n\x0equality_preset\x18\x02 \x01(\x0e\x32G.google.cloud.video.livestream.v1.AutoTranscriptionConfig.QualityPresetB\x03\xe0\x41\x01\"D\n\rDisplayTiming\x12\x1e\n\x1a\x44ISPLAY_TIMING_UNSPECIFIED\x10\x00\x12\t\n\x05\x41SYNC\x10\x01\x12\x08\n\x04SYNC\x10\x02\"l\n\rQualityPreset\x12\x1e\n\x1aQUALITY_PRESET_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLOW_LATENCY\x10\x01\x12\x14\n\x10\x42\x41LANCED_QUALITY\x10\x02\x12\x14\n\x10IMPROVED_QUALITY\x10\x03\"\xc6\x0c\n\x05\x45vent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Event.LabelsEntry\x12O\n\x0cinput_switch\x18\x05 \x01(\x0b\x32\x37.google.cloud.video.livestream.v1.Event.InputSwitchTaskH\x00\x12G\n\x08\x61\x64_break\x18\x06 \x01(\x0b\x32\x33.google.cloud.video.livestream.v1.Event.AdBreakTaskH\x00\x12X\n\x11return_to_program\x18\r \x01(\x0b\x32;.google.cloud.video.livestream.v1.Event.ReturnToProgramTaskH\x00\x12\x42\n\x05slate\x18\x0e \x01(\x0b\x32\x31.google.cloud.video.livestream.v1.Event.SlateTaskH\x00\x12@\n\x04mute\x18\x0f \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.Event.MuteTaskH\x00\x12\x44\n\x06unmute\x18\x10 \x01(\x0b\x32\x32.google.cloud.video.livestream.v1.Event.UnmuteTaskH\x00\x12[\n\x12update_encryptions\x18\x11 \x01(\x0b\x32=.google.cloud.video.livestream.v1.Event.UpdateEncryptionsTaskH\x00\x12\x13\n\x0b\x65xecute_now\x18\t \x01(\x08\x12\x32\n\x0e\x65xecution_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x41\n\x05state\x18\x0b \x01(\x0e\x32-.google.cloud.video.livestream.v1.Event.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0c \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a$\n\x0fInputSwitchTask\x12\x11\n\tinput_key\x18\x01 \x01(\t\x1a:\n\x0b\x41\x64\x42reakTask\x12+\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1am\n\tSlateTask\x12+\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\x05\x61sset\x18\x02 \x01(\tB$\xfa\x41!\n\x1flivestream.googleapis.com/Asset\x1a\x15\n\x13ReturnToProgramTask\x1a\x37\n\x08MuteTask\x12+\n\x08\x64uration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\x0c\n\nUnmuteTask\x1a\x65\n\x15UpdateEncryptionsTask\x12L\n\x0b\x65ncryptions\x18\x01 \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.EncryptionUpdateB\x03\xe0\x41\x02\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"o\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tSCHEDULED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07PENDING\x10\x05\x12\x0b\n\x07STOPPED\x10\x06:o\xea\x41l\n\x1flivestream.googleapis.com/Event\x12Iprojects/{project}/locations/{location}/channels/{channel}/events/{event}B\x06\n\x04task\"\x96\t\n\x04\x43lip\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x06labels\x18\x05 \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.Clip.LabelsEntry\x12@\n\x05state\x18\x06 \x01(\x0e\x32,.google.cloud.video.livestream.v1.Clip.StateB\x03\xe0\x41\x03\x12\x12\n\noutput_uri\x18\x07 \x01(\t\x12&\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12<\n\x06slices\x18\n \x03(\x0b\x32,.google.cloud.video.livestream.v1.Clip.Slice\x12P\n\x0e\x63lip_manifests\x18\x0c \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Clip.ClipManifestB\x03\xe0\x41\x02\x12K\n\x0boutput_type\x18\r \x01(\x0e\x32\x31.google.cloud.video.livestream.v1.Clip.OutputTypeB\x03\xe0\x41\x01\x1an\n\tTimeSlice\x12/\n\x0bmarkin_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cmarkout_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aW\n\x05Slice\x12\x46\n\ntime_slice\x18\x01 \x01(\x0b\x32\x30.google.cloud.video.livestream.v1.Clip.TimeSliceH\x00\x42\x06\n\x04kind\x1a\x42\n\x0c\x43lipManifest\x12\x19\n\x0cmanifest_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\noutput_uri\x18\x02 \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\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\"@\n\nOutputType\x12\x1b\n\x17OUTPUT_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08MANIFEST\x10\x01\x12\x07\n\x03MP4\x10\x02:l\xea\x41i\n\x1elivestream.googleapis.com/Clip\x12Gprojects/{project}/locations/{location}/channels/{channel}/clips/{clip}\"v\n\x0cTimeInterval\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x8c\x08\n\nDvrSession\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x06labels\x18\x04 \x03(\x0b\x32\x38.google.cloud.video.livestream.v1.DvrSession.LabelsEntryB\x03\xe0\x41\x01\x12\x46\n\x05state\x18\x05 \x01(\x0e\x32\x32.google.cloud.video.livestream.v1.DvrSession.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12T\n\rdvr_manifests\x18\x07 \x03(\x0b\x32\x38.google.cloud.video.livestream.v1.DvrSession.DvrManifestB\x03\xe0\x41\x02\x12P\n\x0b\x64vr_windows\x18\x08 \x03(\x0b\x32\x36.google.cloud.video.livestream.v1.DvrSession.DvrWindowB\x03\xe0\x41\x02\x1a\x41\n\x0b\x44vrManifest\x12\x19\n\x0cmanifest_key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\noutput_uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\\\n\tDvrWindow\x12G\n\rtime_interval\x18\x01 \x01(\x0b\x32..google.cloud.video.livestream.v1.TimeIntervalH\x00\x42\x06\n\x04kind\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xab\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0c\n\x08UPDATING\x10\x02\x12\r\n\tSCHEDULED\x10\x03\x12\x08\n\x04LIVE\x10\x04\x12\x0c\n\x08\x46INISHED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x0c\n\x08\x44\x45LETING\x10\x07\x12\x13\n\x0fPOST_PROCESSING\x10\x08\x12\x0c\n\x08\x43OOLDOWN\x10\t\x12\x0c\n\x08STOPPING\x10\n:\x99\x01\xea\x41\x95\x01\n$livestream.googleapis.com/DvrSession\x12Tprojects/{project}/locations/{location}/channels/{channel}/dvrSessions/{dvr_session}*\x0b\x64vrSessions2\ndvrSession\"\xed\x05\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x04 \x03(\x0b\x32\x33.google.cloud.video.livestream.v1.Asset.LabelsEntry\x12\x43\n\x05video\x18\x05 \x01(\x0b\x32\x32.google.cloud.video.livestream.v1.Asset.VideoAssetH\x00\x12\x43\n\x05image\x18\x06 \x01(\x0b\x32\x32.google.cloud.video.livestream.v1.Asset.ImageAssetH\x00\x12\x0e\n\x06\x63rc32c\x18\x07 \x01(\t\x12\x41\n\x05state\x18\x08 \x01(\x0e\x32-.google.cloud.video.livestream.v1.Asset.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\x19\n\nVideoAsset\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a\x19\n\nImageAsset\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\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\x0c\n\x08\x44\x45LETING\x10\x03\x12\t\n\x05\x45RROR\x10\x04:\\\xea\x41Y\n\x1flivestream.googleapis.com/Asset\x12\x36projects/{project}/locations/{location}/assets/{asset}B\n\n\x08resource\"\xb1\x08\n\nEncryption\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x19secret_manager_key_source\x18\x07 \x01(\x0b\x32@.google.cloud.video.livestream.v1.Encryption.SecretManagerSourceH\x00\x12Q\n\x0b\x64rm_systems\x18\x03 \x01(\x0b\x32\x37.google.cloud.video.livestream.v1.Encryption.DrmSystemsB\x03\xe0\x41\x02\x12O\n\x06\x61\x65s128\x18\x04 \x01(\x0b\x32=.google.cloud.video.livestream.v1.Encryption.Aes128EncryptionH\x01\x12V\n\nsample_aes\x18\x05 \x01(\x0b\x32@.google.cloud.video.livestream.v1.Encryption.SampleAesEncryptionH\x01\x12V\n\tmpeg_cenc\x18\x06 \x01(\x0b\x32\x41.google.cloud.video.livestream.v1.Encryption.MpegCommonEncryptionH\x01\x1a\x61\n\x13SecretManagerSource\x12J\n\x0esecret_version\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x1a\n\n\x08Widevine\x1a\n\n\x08\x46\x61irplay\x1a\x0b\n\tPlayready\x1a\n\n\x08\x43learkey\x1a\xc6\x02\n\nDrmSystems\x12L\n\x08widevine\x18\x01 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.WidevineB\x03\xe0\x41\x01\x12L\n\x08\x66\x61irplay\x18\x02 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.FairplayB\x03\xe0\x41\x01\x12N\n\tplayready\x18\x03 \x01(\x0b\x32\x36.google.cloud.video.livestream.v1.Encryption.PlayreadyB\x03\xe0\x41\x01\x12L\n\x08\x63learkey\x18\x04 \x01(\x0b\x32\x35.google.cloud.video.livestream.v1.Encryption.ClearkeyB\x03\xe0\x41\x01\x1a\x12\n\x10\x41\x65s128Encryption\x1a\x15\n\x13SampleAesEncryption\x1a+\n\x14MpegCommonEncryption\x12\x13\n\x06scheme\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x0f\n\rsecret_sourceB\x11\n\x0f\x65ncryption_mode\"\x9b\x01\n\x10\x45ncryptionUpdate\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x65\n\x19secret_manager_key_source\x18\x02 \x01(\x0b\x32@.google.cloud.video.livestream.v1.Encryption.SecretManagerSourceH\x00\x42\x0f\n\rsecret_source\"\xea\x03\n\x04Pool\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x06labels\x18\x04 \x03(\x0b\x32\x32.google.cloud.video.livestream.v1.Pool.LabelsEntry\x12L\n\x0enetwork_config\x18\x05 \x01(\x0b\x32\x34.google.cloud.video.livestream.v1.Pool.NetworkConfig\x1aL\n\rNetworkConfig\x12;\n\x0epeered_network\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Y\xea\x41V\n\x1elivestream.googleapis.com/Pool\x12\x34projects/{project}/locations/{location}/pools/{pool}B\xeb\x01\n$com.google.cloud.video.livestream.v1B\x0eResourcesProtoP\x01ZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb\xaa\x02 Google.Cloud.Video.LiveStream.V1\xca\x02 Google\\Cloud\\Video\\LiveStream\\V1\xea\x02$Google::Cloud::Video::LiveStream::V1b\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.video.livestream.v1.PreprocessingConfig", "google/cloud/video/livestream/v1/outputs.proto"], - ["google.rpc.Status", "google/rpc/status.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 Video - module LiveStream - module V1 - Input = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input").msgclass - Input::SecurityRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input.SecurityRule").msgclass - Input::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input.Type").enummodule - Input::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Input.Tier").enummodule - Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Channel").msgclass - Channel::Output = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Channel.Output").msgclass - Channel::StreamingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Channel.StreamingState").enummodule - NormalizedCoordinate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.NormalizedCoordinate").msgclass - NormalizedResolution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.NormalizedResolution").msgclass - StaticOverlay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StaticOverlay").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputConfig").msgclass - InputConfig::InputSwitchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputConfig.InputSwitchMode").enummodule - LogConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.LogConfig").msgclass - LogConfig::LogSeverity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.LogConfig.LogSeverity").enummodule - RetentionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.RetentionConfig").msgclass - InputStreamProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputStreamProperty").msgclass - VideoStreamProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoStreamProperty").msgclass - VideoFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.VideoFormat").msgclass - AudioStreamProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioStreamProperty").msgclass - AudioFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AudioFormat").msgclass - InputAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputAttachment").msgclass - InputAttachment::AutomaticFailover = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.InputAttachment.AutomaticFailover").msgclass - AutoTranscriptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AutoTranscriptionConfig").msgclass - AutoTranscriptionConfig::DisplayTiming = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AutoTranscriptionConfig.DisplayTiming").enummodule - AutoTranscriptionConfig::QualityPreset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.AutoTranscriptionConfig.QualityPreset").enummodule - Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event").msgclass - Event::InputSwitchTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.InputSwitchTask").msgclass - Event::AdBreakTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.AdBreakTask").msgclass - Event::SlateTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.SlateTask").msgclass - Event::ReturnToProgramTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.ReturnToProgramTask").msgclass - Event::MuteTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.MuteTask").msgclass - Event::UnmuteTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.UnmuteTask").msgclass - Event::UpdateEncryptionsTask = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.UpdateEncryptionsTask").msgclass - Event::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Event.State").enummodule - Clip = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip").msgclass - Clip::TimeSlice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.TimeSlice").msgclass - Clip::Slice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.Slice").msgclass - Clip::ClipManifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.ClipManifest").msgclass - Clip::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.State").enummodule - Clip::OutputType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Clip.OutputType").enummodule - TimeInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.TimeInterval").msgclass - DvrSession = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession").msgclass - DvrSession::DvrManifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession.DvrManifest").msgclass - DvrSession::DvrWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession.DvrWindow").msgclass - DvrSession::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DvrSession.State").enummodule - Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset").msgclass - Asset::VideoAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset.VideoAsset").msgclass - Asset::ImageAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset.ImageAsset").msgclass - Asset::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Asset.State").enummodule - Encryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption").msgclass - Encryption::SecretManagerSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.SecretManagerSource").msgclass - Encryption::Widevine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Widevine").msgclass - Encryption::Fairplay = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Fairplay").msgclass - Encryption::Playready = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Playready").msgclass - Encryption::Clearkey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Clearkey").msgclass - Encryption::DrmSystems = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.DrmSystems").msgclass - Encryption::Aes128Encryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.Aes128Encryption").msgclass - Encryption::SampleAesEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.SampleAesEncryption").msgclass - Encryption::MpegCommonEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Encryption.MpegCommonEncryption").msgclass - EncryptionUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.EncryptionUpdate").msgclass - Pool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Pool").msgclass - Pool::NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.Pool.NetworkConfig").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb deleted file mode 100644 index c2580d3154ce..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_pb.rb +++ /dev/null @@ -1,100 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/video/livestream/v1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/video/livestream/v1/resources_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/video/livestream/v1/service.proto\x12 google.cloud.video.livestream.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/video/livestream/v1/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb5\x01\n\x12\x43reateAssetRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Asset\x12;\n\x05\x61sset\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.AssetB\x03\xe0\x41\x02\x12\x15\n\x08\x61sset_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"_\n\x12\x44\x65leteAssetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Asset\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x95\x01\n\x11ListAssetsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Asset\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x12ListAssetsResponse\x12\x37\n\x06\x61ssets\x18\x01 \x03(\x0b\x32\'.google.cloud.video.livestream.v1.Asset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x0fGetAssetRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Asset\"\xbf\x01\n\x14\x43reateChannelRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!livestream.googleapis.com/Channel\x12?\n\x07\x63hannel\x18\x02 \x01(\x0b\x32).google.cloud.video.livestream.v1.ChannelB\x03\xe0\x41\x02\x12\x17\n\nchannel_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x99\x01\n\x13ListChannelsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!livestream.googleapis.com/Channel\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x81\x01\n\x14ListChannelsResponse\x12;\n\x08\x63hannels\x18\x01 \x03(\x0b\x32).google.cloud.video.livestream.v1.Channel\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x11GetChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\"r\n\x14\x44\x65leteChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x12\n\nrequest_id\x18\x02 \x01(\t\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"\x9c\x01\n\x14UpdateChannelRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12?\n\x07\x63hannel\x18\x02 \x01(\x0b\x32).google.cloud.video.livestream.v1.ChannelB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"b\n\x13StartChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"a\n\x12StopChannelRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x94\x01\n\x18StartDistributionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x1e\n\x11\x64istribution_keys\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x93\x01\n\x17StopDistributionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!livestream.googleapis.com/Channel\x12\x1e\n\x11\x64istribution_keys\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xb5\x01\n\x12\x43reateInputRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Input\x12;\n\x05input\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.InputB\x03\xe0\x41\x02\x12\x15\n\x08input_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x95\x01\n\x11ListInputsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Input\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x12ListInputsResponse\x12\x37\n\x06inputs\x18\x01 \x03(\x0b\x32\'.google.cloud.video.livestream.v1.Input\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x0fGetInputRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Input\"_\n\x12\x44\x65leteInputRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Input\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x96\x01\n\x12UpdateInputRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12;\n\x05input\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.InputB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"\xb5\x01\n\x12\x43reateEventRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Event\x12;\n\x05\x65vent\x18\x02 \x01(\x0b\x32\'.google.cloud.video.livestream.v1.EventB\x03\xe0\x41\x02\x12\x15\n\x08\x65vent_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x95\x01\n\x11ListEventsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1flivestream.googleapis.com/Event\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x12ListEventsResponse\x12\x37\n\x06\x65vents\x18\x01 \x03(\x0b\x32\'.google.cloud.video.livestream.v1.Event\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x0fGetEventRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Event\"_\n\x12\x44\x65leteEventRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Event\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x1a\n\x18\x43hannelOperationResponse\"\x93\x01\n\x10ListClipsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1elivestream.googleapis.com/Clip\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"x\n\x11ListClipsResponse\x12\x35\n\x05\x63lips\x18\x01 \x03(\x0b\x32&.google.cloud.video.livestream.v1.Clip\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"F\n\x0eGetClipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elivestream.googleapis.com/Clip\"\xb5\x01\n\x11\x43reateClipRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1elivestream.googleapis.com/Clip\x12\x14\n\x07\x63lip_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x04\x63lip\x18\x03 \x01(\x0b\x32&.google.cloud.video.livestream.v1.ClipB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"j\n\x11\x44\x65leteClipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elivestream.googleapis.com/Clip\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xb3\x01\n\x16ListDvrSessionsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$livestream.googleapis.com/DvrSession\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\"\x8b\x01\n\x17ListDvrSessionsResponse\x12\x42\n\x0c\x64vr_sessions\x18\x01 \x03(\x0b\x32,.google.cloud.video.livestream.v1.DvrSession\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"R\n\x14GetDvrSessionRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$livestream.googleapis.com/DvrSession\"\xdd\x01\n\x17\x43reateDvrSessionRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$livestream.googleapis.com/DvrSession\x12\x1b\n\x0e\x64vr_session_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\x0b\x64vr_session\x18\x03 \x01(\x0b\x32,.google.cloud.video.livestream.v1.DvrSessionB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17\x44\x65leteDvrSessionRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$livestream.googleapis.com/DvrSession\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xb8\x01\n\x17UpdateDvrSessionRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x46\n\x0b\x64vr_session\x18\x02 \x01(\x0b\x32,.google.cloud.video.livestream.v1.DvrSessionB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xe3\x01\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x06 \x01(\tB\x03\xe0\x41\x03\"F\n\x0eGetPoolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1elivestream.googleapis.com/Pool\"\x93\x01\n\x11UpdatePoolRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x39\n\x04pool\x18\x02 \x01(\x0b\x32&.google.cloud.video.livestream.v1.PoolB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"L\n\x13PreviewInputRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1flivestream.googleapis.com/Input\"9\n\x14PreviewInputResponse\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x14\n\x0c\x62\x65\x61rer_token\x18\x02 \x01(\t2\xb8\x37\n\x11LivestreamService\x12\xe0\x01\n\rCreateChannel\x12\x36.google.cloud.video.livestream.v1.CreateChannelRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\xda\x41\x19parent,channel,channel_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/channels:\x07\x63hannel\x12\xbc\x01\n\x0cListChannels\x12\x35.google.cloud.video.livestream.v1.ListChannelsRequest\x1a\x36.google.cloud.video.livestream.v1.ListChannelsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/channels\x12\xa9\x01\n\nGetChannel\x12\x33.google.cloud.video.livestream.v1.GetChannelRequest\x1a).google.cloud.video.livestream.v1.Channel\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/channels/*}\x12\xd0\x01\n\rDeleteChannel\x12\x36.google.cloud.video.livestream.v1.DeleteChannelRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/channels/*}\x12\xe2\x01\n\rUpdateChannel\x12\x36.google.cloud.video.livestream.v1.UpdateChannelRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1c\n\x07\x43hannel\x12\x11OperationMetadata\xda\x41\x13\x63hannel,update_mask\x82\xd3\xe4\x93\x02?24/v1/{channel.name=projects/*/locations/*/channels/*}:\x07\x63hannel\x12\xda\x01\n\x0cStartChannel\x12\x35.google.cloud.video.livestream.v1.StartChannelRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\"2/v1/{name=projects/*/locations/*/channels/*}:start:\x01*\x12\xd7\x01\n\x0bStopChannel\x12\x34.google.cloud.video.livestream.v1.StopChannelRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\"1/v1/{name=projects/*/locations/*/channels/*}:stop:\x01*\x12\x83\x02\n\x11StartDistribution\x12:.google.cloud.video.livestream.v1.StartDistributionRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x16name,distribution_keys\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/locations/*/channels/*}:startdistribution:\x01*\x12\x80\x02\n\x10StopDistribution\x12\x39.google.cloud.video.livestream.v1.StopDistributionRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41-\n\x18\x43hannelOperationResponse\x12\x11OperationMetadata\xda\x41\x16name,distribution_keys\x82\xd3\xe4\x93\x02\x42\"=/v1/{name=projects/*/locations/*/channels/*}:stopdistribution:\x01*\x12\xd2\x01\n\x0b\x43reateInput\x12\x34.google.cloud.video.livestream.v1.CreateInputRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\xda\x41\x15parent,input,input_id\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/inputs:\x05input\x12\xb4\x01\n\nListInputs\x12\x33.google.cloud.video.livestream.v1.ListInputsRequest\x1a\x34.google.cloud.video.livestream.v1.ListInputsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/inputs\x12\xa1\x01\n\x08GetInput\x12\x31.google.cloud.video.livestream.v1.GetInputRequest\x1a\'.google.cloud.video.livestream.v1.Input\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/inputs/*}\x12\xca\x01\n\x0b\x44\x65leteInput\x12\x34.google.cloud.video.livestream.v1.DeleteInputRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/inputs/*}\x12\xd4\x01\n\x0bUpdateInput\x12\x34.google.cloud.video.livestream.v1.UpdateInputRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x1a\n\x05Input\x12\x11OperationMetadata\xda\x41\x11input,update_mask\x82\xd3\xe4\x93\x02\x39\x32\x30/v1/{input.name=projects/*/locations/*/inputs/*}:\x05input\x12\xc3\x01\n\x0cPreviewInput\x12\x35.google.cloud.video.livestream.v1.PreviewInputRequest\x1a\x36.google.cloud.video.livestream.v1.PreviewInputResponse\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\"2/v1/{name=projects/*/locations/*/inputs/*}:preview:\x01*\x12\xca\x01\n\x0b\x43reateEvent\x12\x34.google.cloud.video.livestream.v1.CreateEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"\\\xda\x41\x15parent,event,event_id\x82\xd3\xe4\x93\x02>\"5/v1/{parent=projects/*/locations/*/channels/*}/events:\x05\x65vent\x12\xbf\x01\n\nListEvents\x12\x33.google.cloud.video.livestream.v1.ListEventsRequest\x1a\x34.google.cloud.video.livestream.v1.ListEventsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/channels/*}/events\x12\xac\x01\n\x08GetEvent\x12\x31.google.cloud.video.livestream.v1.GetEventRequest\x1a\'.google.cloud.video.livestream.v1.Event\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/channels/*/events/*}\x12\xa1\x01\n\x0b\x44\x65leteEvent\x12\x34.google.cloud.video.livestream.v1.DeleteEventRequest\x1a\x16.google.protobuf.Empty\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/channels/*/events/*}\x12\xbb\x01\n\tListClips\x12\x32.google.cloud.video.livestream.v1.ListClipsRequest\x1a\x33.google.cloud.video.livestream.v1.ListClipsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*/channels/*}/clips\x12\xa8\x01\n\x07GetClip\x12\x30.google.cloud.video.livestream.v1.GetClipRequest\x1a&.google.cloud.video.livestream.v1.Clip\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/channels/*/clips/*}\x12\xd6\x01\n\nCreateClip\x12\x33.google.cloud.video.livestream.v1.CreateClipRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41\x19\n\x04\x43lip\x12\x11OperationMetadata\xda\x41\x13parent,clip,clip_id\x82\xd3\xe4\x93\x02<\"4/v1/{parent=projects/*/locations/*/channels/*}/clips:\x04\x63lip\x12\xd2\x01\n\nDeleteClip\x12\x33.google.cloud.video.livestream.v1.DeleteClipRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/channels/*/clips/*}\x12\x84\x02\n\x10\x43reateDvrSession\x12\x39.google.cloud.video.livestream.v1.CreateDvrSessionRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41\x1f\n\nDvrSession\x12\x11OperationMetadata\xda\x41!parent,dvr_session,dvr_session_id\x82\xd3\xe4\x93\x02I\":/v1/{parent=projects/*/locations/*/channels/*}/dvrSessions:\x0b\x64vr_session\x12\xd3\x01\n\x0fListDvrSessions\x12\x38.google.cloud.video.livestream.v1.ListDvrSessionsRequest\x1a\x39.google.cloud.video.livestream.v1.ListDvrSessionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/*/channels/*}/dvrSessions\x12\xc0\x01\n\rGetDvrSession\x12\x36.google.cloud.video.livestream.v1.GetDvrSessionRequest\x1a,.google.cloud.video.livestream.v1.DvrSession\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/*/channels/*/dvrSessions/*}\x12\xe4\x01\n\x10\x44\x65leteDvrSession\x12\x39.google.cloud.video.livestream.v1.DeleteDvrSessionRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02<*:/v1/{name=projects/*/locations/*/channels/*/dvrSessions/*}\x12\x86\x02\n\x10UpdateDvrSession\x12\x39.google.cloud.video.livestream.v1.UpdateDvrSessionRequest\x1a\x1d.google.longrunning.Operation\"\x97\x01\xca\x41\x1f\n\nDvrSession\x12\x11OperationMetadata\xda\x41\x17\x64vr_session,update_mask\x82\xd3\xe4\x93\x02U2F/v1/{dvr_session.name=projects/*/locations/*/channels/*/dvrSessions/*}:\x0b\x64vr_session\x12\xd2\x01\n\x0b\x43reateAsset\x12\x34.google.cloud.video.livestream.v1.CreateAssetRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1a\n\x05\x41sset\x12\x11OperationMetadata\xda\x41\x15parent,asset,asset_id\x82\xd3\xe4\x93\x02\x33\"*/v1/{parent=projects/*/locations/*}/assets:\x05\x61sset\x12\xca\x01\n\x0b\x44\x65leteAsset\x12\x34.google.cloud.video.livestream.v1.DeleteAssetRequest\x1a\x1d.google.longrunning.Operation\"f\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=projects/*/locations/*/assets/*}\x12\xa1\x01\n\x08GetAsset\x12\x31.google.cloud.video.livestream.v1.GetAssetRequest\x1a\'.google.cloud.video.livestream.v1.Asset\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=projects/*/locations/*/assets/*}\x12\xb4\x01\n\nListAssets\x12\x33.google.cloud.video.livestream.v1.ListAssetsRequest\x1a\x34.google.cloud.video.livestream.v1.ListAssetsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=projects/*/locations/*}/assets\x12\x9d\x01\n\x07GetPool\x12\x30.google.cloud.video.livestream.v1.GetPoolRequest\x1a&.google.cloud.video.livestream.v1.Pool\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+\x12)/v1/{name=projects/*/locations/*/pools/*}\x12\xcd\x01\n\nUpdatePool\x12\x33.google.cloud.video.livestream.v1.UpdatePoolRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41\x19\n\x04Pool\x12\x11OperationMetadata\xda\x41\x10pool,update_mask\x82\xd3\xe4\x93\x02\x36\x32./v1/{pool.name=projects/*/locations/*/pools/*}:\x04pool\x1aM\xca\x41\x19livestream.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa1\x03\n$com.google.cloud.video.livestream.v1B\x0cServiceProtoP\x01ZDcloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb\xaa\x02 Google.Cloud.Video.LiveStream.V1\xca\x02 Google\\Cloud\\Video\\LiveStream\\V1\xea\x02$Google::Cloud::Video::LiveStream::V1\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}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.video.livestream.v1.Asset", "google/cloud/video/livestream/v1/resources.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.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 Video - module LiveStream - module V1 - CreateAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateAssetRequest").msgclass - DeleteAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteAssetRequest").msgclass - ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListAssetsRequest").msgclass - ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListAssetsResponse").msgclass - GetAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetAssetRequest").msgclass - CreateChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateChannelRequest").msgclass - ListChannelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListChannelsRequest").msgclass - ListChannelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListChannelsResponse").msgclass - GetChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetChannelRequest").msgclass - DeleteChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteChannelRequest").msgclass - UpdateChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdateChannelRequest").msgclass - StartChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StartChannelRequest").msgclass - StopChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StopChannelRequest").msgclass - StartDistributionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StartDistributionRequest").msgclass - StopDistributionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.StopDistributionRequest").msgclass - CreateInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateInputRequest").msgclass - ListInputsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListInputsRequest").msgclass - ListInputsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListInputsResponse").msgclass - GetInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetInputRequest").msgclass - DeleteInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteInputRequest").msgclass - UpdateInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdateInputRequest").msgclass - CreateEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateEventRequest").msgclass - ListEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListEventsRequest").msgclass - ListEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListEventsResponse").msgclass - GetEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetEventRequest").msgclass - DeleteEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteEventRequest").msgclass - ChannelOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ChannelOperationResponse").msgclass - ListClipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListClipsRequest").msgclass - ListClipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListClipsResponse").msgclass - GetClipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetClipRequest").msgclass - CreateClipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateClipRequest").msgclass - DeleteClipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteClipRequest").msgclass - ListDvrSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListDvrSessionsRequest").msgclass - ListDvrSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.ListDvrSessionsResponse").msgclass - GetDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetDvrSessionRequest").msgclass - CreateDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.CreateDvrSessionRequest").msgclass - DeleteDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.DeleteDvrSessionRequest").msgclass - UpdateDvrSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdateDvrSessionRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.OperationMetadata").msgclass - GetPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.GetPoolRequest").msgclass - UpdatePoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.UpdatePoolRequest").msgclass - PreviewInputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreviewInputRequest").msgclass - PreviewInputResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.livestream.v1.PreviewInputResponse").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb deleted file mode 100644 index 23027c3880c5..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/lib/google/cloud/video/livestream/v1/service_services_pb.rb +++ /dev/null @@ -1,123 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/video/livestream/v1/service.proto for package 'Google.Cloud.Video.LiveStream.V1' -# Original file comments: -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.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/video/livestream/v1/service_pb' - -module Google - module Cloud - module Video - module LiveStream - module V1 - module LivestreamService - # Using Live Stream API, you can generate live streams in the various - # renditions and streaming formats. The streaming format include HTTP Live - # Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can send - # a source stream in the various ways, including Real-Time Messaging - # Protocol (RTMP) and Secure Reliable Transport (SRT). - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.video.livestream.v1.LivestreamService' - - # Creates a channel with the provided unique ID in the specified - # region. - rpc :CreateChannel, ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, ::Google::Longrunning::Operation - # Returns a list of all channels in the specified region. - rpc :ListChannels, ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse - # Returns the specified channel. - rpc :GetChannel, ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, ::Google::Cloud::Video::LiveStream::V1::Channel - # Deletes the specified channel. - rpc :DeleteChannel, ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, ::Google::Longrunning::Operation - # Updates the specified channel. - rpc :UpdateChannel, ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, ::Google::Longrunning::Operation - # Starts the specified channel. Part of the video pipeline will be created - # only when the StartChannel request is received by the server. - rpc :StartChannel, ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, ::Google::Longrunning::Operation - # Stops the specified channel. Part of the video pipeline will be released - # when the StopChannel request is received by the server. - rpc :StopChannel, ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, ::Google::Longrunning::Operation - # Starts distribution which delivers outputs to the destination indicated by - # the Distribution configuration. - rpc :StartDistribution, ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, ::Google::Longrunning::Operation - # Stops the specified distribution. - rpc :StopDistribution, ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, ::Google::Longrunning::Operation - # Creates an input with the provided unique ID in the specified region. - rpc :CreateInput, ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, ::Google::Longrunning::Operation - # Returns a list of all inputs in the specified region. - rpc :ListInputs, ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse - # Returns the specified input. - rpc :GetInput, ::Google::Cloud::Video::LiveStream::V1::GetInputRequest, ::Google::Cloud::Video::LiveStream::V1::Input - # Deletes the specified input. - rpc :DeleteInput, ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, ::Google::Longrunning::Operation - # Updates the specified input. - rpc :UpdateInput, ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, ::Google::Longrunning::Operation - # Preview the streaming content of the specified input. - rpc :PreviewInput, ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse - # Creates an event with the provided unique ID in the specified channel. - rpc :CreateEvent, ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, ::Google::Cloud::Video::LiveStream::V1::Event - # Returns a list of all events in the specified channel. - rpc :ListEvents, ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse - # Returns the specified event. - rpc :GetEvent, ::Google::Cloud::Video::LiveStream::V1::GetEventRequest, ::Google::Cloud::Video::LiveStream::V1::Event - # Deletes the specified event. - rpc :DeleteEvent, ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, ::Google::Protobuf::Empty - # Returns a list of all clips in the specified channel. - rpc :ListClips, ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse - # Returns the specified clip. - rpc :GetClip, ::Google::Cloud::Video::LiveStream::V1::GetClipRequest, ::Google::Cloud::Video::LiveStream::V1::Clip - # Creates a clip with the provided clip ID in the specified channel. - rpc :CreateClip, ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, ::Google::Longrunning::Operation - # Deletes the specified clip job resource. This method only deletes the clip - # job and does not delete the VOD clip stored in Cloud Storage. - rpc :DeleteClip, ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, ::Google::Longrunning::Operation - # Creates a DVR session with the provided unique ID in the specified channel. - rpc :CreateDvrSession, ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, ::Google::Longrunning::Operation - # Returns a list of all DVR sessions in the specified channel. - rpc :ListDvrSessions, ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse - # Returns the specified DVR session. - rpc :GetDvrSession, ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, ::Google::Cloud::Video::LiveStream::V1::DvrSession - # Deletes the specified DVR session. - rpc :DeleteDvrSession, ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, ::Google::Longrunning::Operation - # Updates the specified DVR session. - rpc :UpdateDvrSession, ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, ::Google::Longrunning::Operation - # Creates a Asset with the provided unique ID in the specified - # region. - rpc :CreateAsset, ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, ::Google::Longrunning::Operation - # Deletes the specified asset if it is not used. - rpc :DeleteAsset, ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, ::Google::Longrunning::Operation - # Returns the specified asset. - rpc :GetAsset, ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, ::Google::Cloud::Video::LiveStream::V1::Asset - # Returns a list of all assets in the specified region. - rpc :ListAssets, ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse - # Returns the specified pool. - rpc :GetPool, ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, ::Google::Cloud::Video::LiveStream::V1::Pool - # Updates the specified pool. - rpc :UpdatePool, ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md deleted file mode 100644 index 10dc79685a07..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Live Stream V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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-video-live_stream-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb deleted file mode 100644 index 2da5118a4897..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/outputs.rb +++ /dev/null @@ -1,788 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - # Encoding of an input element such as an audio, video, or text track. - # Elementary streams must be packaged before mapping and sharing between - # different output formats. - # @!attribute [rw] key - # @return [::String] - # A unique key for this elementary stream. The key must be 1-63 - # characters in length. The key must begin and end with a letter (regardless - # of case) or a number, but can contain dashes or underscores in between. - # @!attribute [rw] video_stream - # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream] - # Encoding of a video stream. - # - # Note: The following fields are mutually exclusive: `video_stream`, `audio_stream`, `text_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] audio_stream - # @return [::Google::Cloud::Video::LiveStream::V1::AudioStream] - # Encoding of an audio stream. - # - # Note: The following fields are mutually exclusive: `audio_stream`, `video_stream`, `text_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_stream - # @return [::Google::Cloud::Video::LiveStream::V1::TextStream] - # Encoding of a text stream. For example, closed captions or subtitles. - # - # Note: The following fields are mutually exclusive: `text_stream`, `video_stream`, `audio_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ElementaryStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Multiplexing settings for output stream. - # @!attribute [rw] key - # @return [::String] - # A unique key for this multiplexed stream. The key must be 1-63 - # characters in length. The key must begin and end with a letter (regardless - # of case) or a number, but can contain dashes or underscores in between. - # @!attribute [rw] container - # @return [::String] - # The container format. The default is `fmp4`. - # - # Supported container formats: - # - # - `fmp4` - the corresponding file extension is `.m4s` - # - `ts` - the corresponding file extension is `.ts` - # @!attribute [rw] elementary_streams - # @return [::Array<::String>] - # List of `ElementaryStream` - # {::Google::Cloud::Video::LiveStream::V1::ElementaryStream#key key}s multiplexed - # in this stream. - # - # - For `fmp4` container, must contain either one video or one audio stream. - # - For `ts` container, must contain exactly one audio stream and up to one - # video stream. - # @!attribute [rw] segment_settings - # @return [::Google::Cloud::Video::LiveStream::V1::SegmentSettings] - # Segment settings for `fmp4` and `ts`. - # @!attribute [rw] encryption_id - # @return [::String] - # Identifier of the encryption configuration to use. If omitted, output - # will be unencrypted. - class MuxStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Manifest configuration. - # @!attribute [rw] file_name - # @return [::String] - # The name of the generated file. The default is `manifest` with the - # extension suffix corresponding to the `Manifest` - # {::Google::Cloud::Video::LiveStream::V1::Manifest#type type}. If multiple - # manifests are added to the channel, each must have a unique file name. - # @!attribute [rw] type - # @return [::Google::Cloud::Video::LiveStream::V1::Manifest::ManifestType] - # Required. Type of the manifest, can be `HLS` or `DASH`. - # @!attribute [rw] mux_streams - # @return [::Array<::String>] - # Required. List of `MuxStream` - # {::Google::Cloud::Video::LiveStream::V1::MuxStream#key key}s that should appear - # in this manifest. - # - # - For HLS, either `fmp4` or `ts` mux streams can be specified but not - # mixed. - # - For DASH, only `fmp4` mux streams can be specified. - # @!attribute [rw] max_segment_count - # @return [::Integer] - # Maximum number of segments that this manifest holds. Once the manifest - # reaches this maximum number of segments, whenever a new segment is added to - # the manifest, the oldest segment will be removed from the manifest. - # The minimum value is 3 and the default value is 5. - # @!attribute [rw] segment_keep_duration - # @return [::Google::Protobuf::Duration] - # How long to keep a segment on the output Google Cloud Storage bucket after - # it is removed from the manifest. This field should be large enough to cover - # the manifest propagation delay. Otherwise, a player could receive 404 - # errors while accessing segments which are listed in the manifest that the - # player has, but were already deleted from the output Google Cloud Storage - # bucket. Default value is `60s`. - # - # If both segment_keep_duration and - # {::Google::Cloud::Video::LiveStream::V1::RetentionConfig#retention_window_duration RetentionConfig.retention_window_duration} - # are set, - # {::Google::Cloud::Video::LiveStream::V1::RetentionConfig#retention_window_duration RetentionConfig.retention_window_duration} - # is used and segment_keep_duration is ignored. - # @!attribute [rw] use_timecode_as_timeline - # @return [::Boolean] - # Whether to use the timecode, as specified in timecode config, when setting: - # - # - `availabilityStartTime` attribute in DASH manifests. - # - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests. - # - # If false, ignore the input timecode and use the time from system clock - # when the manifest is first generated. This is the default behavior. - # @!attribute [rw] key - # @return [::String] - # Optional. A unique key for this manifest. - class Manifest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The manifest type can be either `HLS` or `DASH`. - module ManifestType - # The manifest type is not specified. - MANIFEST_TYPE_UNSPECIFIED = 0 - - # Create an `HLS` manifest. The corresponding file extension is `.m3u8`. - HLS = 1 - - # Create a `DASH` manifest. The corresponding file extension is `.mpd`. - DASH = 2 - end - end - - # Multiplexing settings for output streams used in - # {::Google::Cloud::Video::LiveStream::V1::Distribution Distribution}. - # @!attribute [rw] key - # @return [::String] - # Required. A unique key for this distribution stream. The key must be 1-63 - # characters in length. The key must begin and end with a letter (regardless - # of case) or a number, but can contain dashes or underscores in between. - # @!attribute [rw] container - # @return [::String] - # Required. The container format. - # - # Supported container formats: - # - # - `ts`, must contain exactly one audio stream and up to one video stream. - # - `flv`, must contain at most one audio stream and at most one video - # stream. - # @!attribute [rw] elementary_streams - # @return [::Array<::String>] - # Required. List of `ElementaryStream` - # {::Google::Cloud::Video::LiveStream::V1::ElementaryStream#key key}s multiplexed - # in this stream. Must contain at least one audio stream and up to one video - # stream. - class DistributionStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Distribution configuration. - # @!attribute [rw] key - # @return [::String] - # Required. A unique key for this distribution. The key must be 1-63 - # characters in length. The key must begin and end with a letter (regardless - # of case) or a number, but can contain dashes or underscores in between. - # @!attribute [rw] distribution_stream - # @return [::String] - # Required. `DistributionStream` - # {::Google::Cloud::Video::LiveStream::V1::DistributionStream#key key}s that should - # appear in this distribution output. - # - # - For SRT protocol, only `ts` distribution streams can be specified. - # - For RTMP protocol, only `flv` distribution streams can be specified. - # @!attribute [r] state - # @return [::Google::Cloud::Video::LiveStream::V1::Distribution::State] - # Output only. State of the distribution. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Only present when the `state` is `ERROR`. The reason for the - # error state of the distribution. - # @!attribute [rw] srt_push - # @return [::Google::Cloud::Video::LiveStream::V1::SrtPushOutputEndpoint] - # Output endpoint using SRT_PUSH. - # - # Note: The following fields are mutually exclusive: `srt_push`, `rtmp_push`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] rtmp_push - # @return [::Google::Cloud::Video::LiveStream::V1::RtmpPushOutputEndpoint] - # Output endpoint using RTMP_PUSH. - # - # Note: The following fields are mutually exclusive: `rtmp_push`, `srt_push`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Distribution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of this distribution. - module State - # State is not specified. - STATE_UNSPECIFIED = 0 - - # Distribution has trouble to produce or deliver the output. - ERROR = 5 - - # Distribution is not ready to be started. - NOT_READY = 6 - - # Distribution is ready to be started. - READY = 7 - - # Distribution is already started and is waiting for input. - AWAITING_INPUT = 8 - - # Distribution is already started and is generating output. - DISTRIBUTING = 9 - end - end - - # Configurations for an output endpoint using SRT_PUSH as the streaming - # protocol. - # @!attribute [rw] uri - # @return [::String] - # Required. The full URI of the remote SRT server. - # @!attribute [rw] passphrase_secret_version - # @return [::String] - # The name of the Secret Version containing the SRT encryption passphrase, - # which is stored in Google Secret Manager. It should be in the format of - # `projects/{project}/secrets/{secret_id}/versions/{version_number}`. - class SrtPushOutputEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configurations for an output endpoint using RTMP_PUSH as the streaming - # protocol. - # @!attribute [rw] uri - # @return [::String] - # Required. The full URI of the remote RTMP server. For example: - # `rtmp://192.168.123.321/live/my-stream` or `rtmp://somedomain.com/someapp`. - # @!attribute [rw] stream_key - # @return [::String] - # Required. Stream key for RTMP protocol. - class RtmpPushOutputEndpoint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Sprite sheet configuration. - # @!attribute [rw] format - # @return [::String] - # Format type. The default is `jpeg`. - # - # Supported formats: - # - # - `jpeg` - # @!attribute [rw] file_prefix - # @return [::String] - # Required. File name prefix for the generated sprite sheets. If multiple - # sprite sheets are added to the channel, each must have a unique file - # prefix. - # Each sprite sheet has an incremental 10-digit zero-padded suffix starting - # from 0 before the extension, such as `sprite_sheet0000000123.jpeg`. - # @!attribute [rw] sprite_width_pixels - # @return [::Integer] - # Required. The width of the sprite in pixels. Must be an even integer. - # @!attribute [rw] sprite_height_pixels - # @return [::Integer] - # Required. The height of the sprite in pixels. Must be an even integer. - # @!attribute [rw] column_count - # @return [::Integer] - # The maximum number of sprites per row in a sprite sheet. Valid range is - # [1, 10] and the default value is 1. - # @!attribute [rw] row_count - # @return [::Integer] - # The maximum number of rows per sprite sheet. When the sprite sheet is full, - # a new sprite sheet is created. Valid range is [1, 10] and the default value - # is 1. - # @!attribute [rw] interval - # @return [::Google::Protobuf::Duration] - # Create sprites at regular intervals. Valid range is [1 second, 1 hour] and - # the default value is `10s`. - # @!attribute [rw] quality - # @return [::Integer] - # The quality of the generated sprite sheet. Enter a value between 1 - # and 100, where 1 is the lowest quality and 100 is the highest quality. - # The default is 100. A high quality value corresponds to a low image data - # compression ratio. - class SpriteSheet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Preprocessing configurations. - # @!attribute [rw] audio - # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig::Audio] - # Audio preprocessing configuration. - # @!attribute [rw] crop - # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig::Crop] - # Specify the video cropping configuration. - # @!attribute [rw] pad - # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig::Pad] - # Specify the video pad filter configuration. - class PreprocessingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Audio preprocessing configuration. - # @!attribute [rw] lufs - # @return [::Float] - # Specify audio loudness normalization in loudness units relative to full - # scale (LUFS). Enter a value between -24 and 0 according to the following: - # - # - -24 is the Advanced Television Systems Committee (ATSC A/85) - # - -23 is the EU R128 broadcast standard - # - -19 is the prior standard for online mono audio - # - -18 is the ReplayGain standard - # - -16 is the prior standard for stereo audio - # - -14 is the new online audio standard recommended by Spotify, as well as - # Amazon Echo - # - 0 disables normalization. The default is 0. - class Audio - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Video cropping configuration for the input video. The cropped input video - # is scaled to match the output resolution. - # @!attribute [rw] top_pixels - # @return [::Integer] - # The number of pixels to crop from the top. The default is 0. - # @!attribute [rw] bottom_pixels - # @return [::Integer] - # The number of pixels to crop from the bottom. The default is 0. - # @!attribute [rw] left_pixels - # @return [::Integer] - # The number of pixels to crop from the left. The default is 0. - # @!attribute [rw] right_pixels - # @return [::Integer] - # The number of pixels to crop from the right. The default is 0. - class Crop - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pad filter configuration for the input video. The padded input video - # is scaled after padding with black to match the output resolution. - # @!attribute [rw] top_pixels - # @return [::Integer] - # The number of pixels to add to the top. The default is 0. - # @!attribute [rw] bottom_pixels - # @return [::Integer] - # The number of pixels to add to the bottom. The default is 0. - # @!attribute [rw] left_pixels - # @return [::Integer] - # The number of pixels to add to the left. The default is 0. - # @!attribute [rw] right_pixels - # @return [::Integer] - # The number of pixels to add to the right. The default is 0. - class Pad - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Video stream resource. - # @!attribute [rw] h264 - # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings] - # H264 codec settings. - # - # Note: The following fields are mutually exclusive: `h264`, `h265`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] h265 - # @return [::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings] - # H265 codec settings. - # - # Note: The following fields are mutually exclusive: `h265`, `h264`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class VideoStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # H264 codec settings. - # @!attribute [rw] width_pixels - # @return [::Integer] - # Required. The width of the video in pixels. Must be an even integer. - # Valid range is [320, 4096]. - # @!attribute [rw] height_pixels - # @return [::Integer] - # Required. The height of the video in pixels. Must be an even integer. - # Valid range is [180, 2160]. - # @!attribute [rw] frame_rate - # @return [::Float] - # Required. The target video frame rate in frames per second (FPS). Must be - # less than or equal to 60. Will default to the input frame rate if larger - # than the input frame rate. The API will generate an output FPS that is - # divisible by the input FPS, and smaller or equal to the target FPS. See - # [Calculating frame - # rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for - # more information. - # @!attribute [rw] bitrate_bps - # @return [::Integer] - # Required. The video bitrate in bits per second. Minimum value is 10,000. - # - # - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps). - # - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps). - # - For UHD resolution (<= 2160p), must be <= 25,000,000 (25 Mbps). - # @!attribute [rw] allow_open_gop - # @return [::Boolean] - # Specifies whether an open Group of Pictures (GOP) structure should be - # allowed or not. The default is `false`. - # @!attribute [rw] gop_frame_count - # @return [::Integer] - # Select the GOP size based on the specified frame count. - # If GOP frame count is set instead of GOP duration, GOP duration will be - # calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration - # must satisfy the limitations on `gopDuration` as well. - # Valid range is [60, 600]. - # - # Note: The following fields are mutually exclusive: `gop_frame_count`, `gop_duration`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gop_duration - # @return [::Google::Protobuf::Duration] - # Select the GOP size based on the specified duration. The default is - # `2s`. Note that `gopDuration` must be less than or equal to - # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration}, - # and - # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration} - # must be divisible by `gopDuration`. Valid range is [2s, 20s]. - # - # All video streams in the same channel must have the same GOP size. - # - # Note: The following fields are mutually exclusive: `gop_duration`, `gop_frame_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vbv_size_bits - # @return [::Integer] - # Size of the Video Buffering Verifier (VBV) buffer in bits. Must be - # greater than zero. The default is equal to - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#bitrate_bps bitrate_bps}. - # @!attribute [rw] vbv_fullness_bits - # @return [::Integer] - # Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. - # Must be greater than zero. The default is equal to 90% of - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#vbv_size_bits vbv_size_bits}. - # @!attribute [rw] entropy_coder - # @return [::String] - # The entropy coder to use. The default is `cabac`. - # - # Supported entropy coders: - # - # - `cavlc` - # - `cabac` - # @!attribute [rw] b_pyramid - # @return [::Boolean] - # Allow B-pyramid for reference frame selection. This may not be supported - # on all decoders. The default is `false`. - # @!attribute [rw] b_frame_count - # @return [::Integer] - # The number of consecutive B-frames. Must be greater than or equal to - # zero. Must be less than - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#gop_frame_count gop_frame_count} - # if set. The default is 0. - # @!attribute [rw] aq_strength - # @return [::Float] - # Specify the intensity of the adaptive quantizer (AQ). Must be between 0 - # and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A - # higher value equals a lower bitrate but smoother image. The default is 0. - # @!attribute [rw] profile - # @return [::String] - # Enforces the specified codec profile. The following profiles are - # supported: - # - # * `baseline` - # * `main` (default) - # * `high` - # - # The available options are [FFmpeg-compatible Profile - # Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile). - # Note that certain values for this field may cause the - # transcoder to override other fields you set in the - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings H264CodecSettings} - # message. - # @!attribute [rw] tune - # @return [::String] - # Enforces the specified codec tune. The available options are - # [FFmpeg-compatible Encode - # Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune) - # Note that certain values for this field may cause the transcoder to - # override other fields you set in the - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings H264CodecSettings} - # message. - class H264CodecSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # H265 codec settings. - # @!attribute [rw] width_pixels - # @return [::Integer] - # Optional. The width of the video in pixels. Must be an even integer. - # When not specified, the width is adjusted to match the specified height - # and input aspect ratio. If both are omitted, the input width is used. - # Valid range is [320, 4096]. - # @!attribute [rw] height_pixels - # @return [::Integer] - # Optional. The height of the video in pixels. Must be an even integer. - # When not specified, the height is adjusted to match the specified width - # and input aspect ratio. If both are omitted, the input height is used. - # Valid range is [180, 2160]. - # @!attribute [rw] frame_rate - # @return [::Float] - # Required. The target video frame rate in frames per second (FPS). Must be - # less than or equal to 120. Will default to the input frame rate if larger - # than the input frame rate. The API will generate an output FPS that is - # divisible by the input FPS, and smaller or equal to the target FPS. See - # [Calculating frame - # rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for - # more information. - # @!attribute [rw] bitrate_bps - # @return [::Integer] - # Required. The video bitrate in bits per second. Minimum value is 10,000. - # - # - For SD resolution (< 720p), must be <= 3,000,000 (3 Mbps). - # - For HD resolution (<= 1080p), must be <= 15,000,000 (15 Mbps). - # - For UHD resolution (<= 2160p), must be <= 25,000,000 (25 Mbps). - # @!attribute [rw] gop_frame_count - # @return [::Integer] - # Optional. Select the GOP size based on the specified frame count. - # If GOP frame count is set instead of GOP duration, GOP duration will be - # calculated by `gopFrameCount`/`frameRate`. The calculated GOP duration - # must satisfy the limitations on `gopDuration` as well. - # Valid range is [60, 600]. - # - # Note: The following fields are mutually exclusive: `gop_frame_count`, `gop_duration`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gop_duration - # @return [::Google::Protobuf::Duration] - # Optional. Select the GOP size based on the specified duration. The - # default is `2s`. Note that `gopDuration` must be less than or equal to - # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration}, - # and - # {::Google::Cloud::Video::LiveStream::V1::SegmentSettings#segment_duration segment_duration} - # must be divisible by `gopDuration`. Valid range is [2s, 20s]. - # - # All video streams in the same channel must have the same GOP size. - # - # Note: The following fields are mutually exclusive: `gop_duration`, `gop_frame_count`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vbv_size_bits - # @return [::Integer] - # Optional. Size of the Video Buffering Verifier (VBV) buffer in bits. Must - # be greater than zero. The default is equal to - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings#bitrate_bps bitrate_bps}. - # @!attribute [rw] vbv_fullness_bits - # @return [::Integer] - # Optional. Initial fullness of the Video Buffering Verifier (VBV) buffer - # in bits. Must be greater than zero. The default is equal to 90% of - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings#vbv_size_bits vbv_size_bits}. - # @!attribute [rw] b_pyramid - # @return [::Boolean] - # Optional. Allow B-pyramid for reference frame selection. This may not be - # supported on all decoders. The default is `false`. - # @!attribute [rw] b_frame_count - # @return [::Integer] - # Optional. The number of consecutive B-frames. Must be greater than or - # equal to zero. Must be less than - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H265CodecSettings#gop_frame_count gop_frame_count} - # if set. The default is 0. - # @!attribute [rw] aq_strength - # @return [::Float] - # Optional. Specify the intensity of the adaptive quantizer (AQ). Must be - # between 0 and 1, where 0 disables the quantizer and 1 maximizes the - # quantizer. A higher value equals a lower bitrate but smoother image. The - # default is 0. - class H265CodecSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Audio stream resource. - # @!attribute [rw] transmux - # @return [::Boolean] - # Specifies whether pass through (transmuxing) is enabled or not. - # If set to `true`, the rest of the settings, other than `mapping`, will be - # ignored. The default is `false`. - # @!attribute [rw] codec - # @return [::String] - # The codec for this audio stream. The default is `aac`. - # - # Supported audio codecs: - # - # - `aac` - # @!attribute [rw] bitrate_bps - # @return [::Integer] - # Required. Audio bitrate in bits per second. Must be between 1 and - # 10,000,000. - # @!attribute [rw] channel_count - # @return [::Integer] - # Number of audio channels. Must be between 1 and 6. The default is 2. - # @!attribute [rw] channel_layout - # @return [::Array<::String>] - # A list of channel names specifying layout of the audio channels. - # This only affects the metadata embedded in the container headers, if - # supported by the specified format. The default is `[fl, fr]`. - # - # Supported channel names: - # - # - `fl` - Front left channel - # - `fr` - Front right channel - # - `sl` - Side left channel - # - `sr` - Side right channel - # - `fc` - Front center channel - # - `lfe` - Low frequency - # @!attribute [rw] mapping - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::AudioStream::AudioMapping>] - # The mapping for the input streams and audio channels. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # The audio sample rate in Hertz. The default is 48000 Hertz. - class AudioStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The mapping for the input streams and audio channels. - # @!attribute [rw] input_key - # @return [::String] - # Required. The `Channel` - # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} - # that identifies the input that this audio mapping applies to. If an - # active input doesn't have an audio mapping, the primary audio track in - # the input stream will be selected. - # @!attribute [rw] input_track - # @return [::Integer] - # Required. The zero-based index of the track in the input stream. - # All {::Google::Cloud::Video::LiveStream::V1::AudioStream#mapping mapping}s in - # the same {::Google::Cloud::Video::LiveStream::V1::AudioStream AudioStream} must - # have the same input track. - # @!attribute [rw] input_channel - # @return [::Integer] - # Required. The zero-based index of the channel in the input stream. - # @!attribute [rw] output_channel - # @return [::Integer] - # Required. The zero-based index of the channel in the output audio stream. - # Must be consistent with the - # {::Google::Cloud::Video::LiveStream::V1::AudioStream::AudioMapping#input_channel input_channel}. - # @!attribute [rw] gain_db - # @return [::Float] - # Audio volume control in dB. Negative values decrease volume, - # positive values increase. The default is 0. - class AudioMapping - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Encoding of a text stream. For example, closed captions or subtitles. - # @!attribute [rw] codec - # @return [::String] - # Required. The codec for this text stream. - # - # Supported text codecs: - # - # - `cea608` - # - `cea708` - # - `webvtt` - # @!attribute [rw] language_code - # @return [::String] - # Optional. The BCP-47 language code, such as `en-US` or `sr-Latn`. For more - # information, see - # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] display_name - # @return [::String] - # Optional. The name for this particular text stream that will be added to - # the HLS/DASH manifest. - # @!attribute [rw] output_cea_channel - # @return [::String] - # Optional. The channel of the closed caption in the output stream. - # This field should only be set when textstream is used for partner - # distribution. - # Must be one of `CC1`, `CC2`, `CC3`, and `CC4`, if the - # {::Google::Cloud::Video::LiveStream::V1::TextStream#codec codec} is `cea608`; - # Must be one between `SERVICE1` and `SERVICE63`, if the - # {::Google::Cloud::Video::LiveStream::V1::TextStream#codec codec} is `cea708`. - # @!attribute [rw] mapping - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::TextStream::TextMapping>] - # Optional. The mapping for the input streams and text tracks. - class TextStream - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The mapping for the input streams and text tracks. - # @!attribute [rw] input_key - # @return [::String] - # Optional. The `Channel` - # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} - # that identifies the input that this text mapping applies to. - # @!attribute [rw] input_track - # @return [::Integer] - # Optional. The zero-based index of the track in the input stream. - # @!attribute [rw] input_cea_channel - # @return [::String] - # Optional. The channel of the closed caption in the input stream. - # If this field is set, the output - # {::Google::Cloud::Video::LiveStream::V1::TextStream#codec codec} must be - # `webvtt`. Must be one of `CC1`, `CC2`, `CC3`, and `CC4`, if the codec of - # the input closed caption is `cea608`; Must be one between `SERVICE1` and - # `SERVICE64`, if the codec of the input closed caption is `cea708`. - # @!attribute [rw] from_language_code - # @return [::String] - # Optional. The BCP-47 source language code, such as `en-US` or `sr-Latn`. - # If differ from the textStream's language code, enable translation. For - # more information on BCP-47 language codes, see - # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - class TextMapping - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Segment settings for `fmp4` and `ts`. - # @!attribute [rw] segment_duration - # @return [::Google::Protobuf::Duration] - # Duration of the segments in seconds. The default is `6s`. Note that - # `segmentDuration` must be greater than or equal to - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#gop_duration gop_duration}, - # and `segmentDuration` must be divisible by - # {::Google::Cloud::Video::LiveStream::V1::VideoStream::H264CodecSettings#gop_duration gop_duration}. - # Valid range is [2s, 20s]. - # - # All {::Google::Cloud::Video::LiveStream::V1::Manifest#mux_streams mux_streams} in - # the same manifest must have the same segment duration. - class SegmentSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Timecode configuration. - # @!attribute [rw] source - # @return [::Google::Cloud::Video::LiveStream::V1::TimecodeConfig::TimecodeSource] - # The source of the timecode that will later be used in outputs/manifests. - # It determines the initial timecode/timestamp (first frame) of output - # streams. - # @!attribute [rw] utc_offset - # @return [::Google::Protobuf::Duration] - # UTC offset. Must be whole seconds, between -18 hours and +18 hours. - # - # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone e.g. "America/Los_Angeles". - # - # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class TimecodeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The source of timecode. - module TimecodeSource - # The timecode source is not specified. - TIMECODE_SOURCE_UNSPECIFIED = 0 - - # Use input media timestamp. - MEDIA_TIMESTAMP = 1 - - # Use input embedded timecode e.g. picture timing SEI message. - EMBEDDED_TIMECODE = 2 - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb deleted file mode 100644 index 5d4f8a305dd4..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/resources.rb +++ /dev/null @@ -1,1294 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - # Input resource represents the endpoint from which the channel ingests - # the input stream. - # @!attribute [rw] name - # @return [::String] - # The resource name of the input, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # User-defined key/value metadata. - # @!attribute [rw] type - # @return [::Google::Cloud::Video::LiveStream::V1::Input::Type] - # Source type. - # @!attribute [rw] tier - # @return [::Google::Cloud::Video::LiveStream::V1::Input::Tier] - # Tier defines the maximum input specification that is accepted by the - # video pipeline. The billing is charged based on the tier specified here. - # See [Pricing](https://cloud.google.com/livestream/pricing) for more detail. - # The default is `HD`. - # @!attribute [r] uri - # @return [::String] - # Output only. URI to push the input stream to. - # Its format depends on the input - # {::Google::Cloud::Video::LiveStream::V1::Input#type type}, for example: - # - # * `RTMP_PUSH`: `rtmp://1.2.3.4/live/{STREAM-ID}` - # * `SRT_PUSH`: `srt://1.2.3.4:4201?streamid={STREAM-ID}` - # @!attribute [rw] preprocessing_config - # @return [::Google::Cloud::Video::LiveStream::V1::PreprocessingConfig] - # Preprocessing configurations. - # @!attribute [rw] security_rules - # @return [::Google::Cloud::Video::LiveStream::V1::Input::SecurityRule] - # Security rule for access control. - # @!attribute [r] input_stream_property - # @return [::Google::Cloud::Video::LiveStream::V1::InputStreamProperty] - # Output only. The information for the input stream. This field will be - # present only when this input receives the input stream. - class Input - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Security rules for access control. Each field represents one security rule. - # Only when the source of the input stream satisfies all the fields, this - # input stream can be accepted. - # @!attribute [rw] ip_ranges - # @return [::Array<::String>] - # At least one ip range must match unless none specified. The IP range is - # defined by CIDR block: for example, `192.0.1.0/24` for a range and - # `192.0.1.0/32` for a single IP address. - class SecurityRule - 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 type of the input. - module Type - # Input type is not specified. - TYPE_UNSPECIFIED = 0 - - # Input will take an rtmp input stream. - RTMP_PUSH = 1 - - # Input will take an srt (Secure Reliable Transport) input stream. - SRT_PUSH = 2 - end - - # Tier of the input specification. - module Tier - # Tier is not specified. - TIER_UNSPECIFIED = 0 - - # Resolution < 1280x720. Bitrate <= 6 Mbps. FPS <= 60. - SD = 1 - - # Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. - HD = 2 - - # Resolution <= 4096x2160. Bitrate <= 50 Mbps. FPS <= 60. - UHD = 3 - - # Resolution <= 1280x720. Bitrate <= 6 Mbps. FPS <= 60. H265 codec. - SD_H265 = 4 - - # Resolution <= 1920x1080. Bitrate <= 25 Mbps. FPS <= 60. H265 codec. - HD_H265 = 5 - - # Resolution <= 4096x2160. Bitrate <= 50 Mbps. FPS <= 60. H265 codec. - UHD_H265 = 6 - end - end - - # Channel resource represents the processor that does a user-defined - # "streaming" operation, which includes getting an input stream through an - # input, transcoding it to multiple renditions, and publishing output live - # streams in certain formats (for example, HLS or DASH) to the specified - # location. - # @!attribute [rw] name - # @return [::String] - # The resource name of the channel, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # User-defined key/value metadata. - # @!attribute [rw] input_attachments - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::InputAttachment>] - # A list of input attachments that this channel uses. - # One channel can have multiple inputs as the input sources. Only one - # input can be selected as the input source at one time. - # @!attribute [r] active_input - # @return [::String] - # Output only. The - # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} - # that serves as the current input source. The first input in the - # {::Google::Cloud::Video::LiveStream::V1::Channel#input_attachments input_attachments} - # is the initial input source. - # @!attribute [rw] output - # @return [::Google::Cloud::Video::LiveStream::V1::Channel::Output] - # Required. Information about the output (that is, the Cloud Storage bucket - # to store the generated live stream). - # @!attribute [rw] elementary_streams - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::ElementaryStream>] - # List of elementary streams. - # @!attribute [rw] mux_streams - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::MuxStream>] - # List of multiplexing settings for output streams. - # @!attribute [rw] manifests - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Manifest>] - # List of output manifests. - # @!attribute [rw] distribution_streams - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DistributionStream>] - # Optional. List of multiplexing settings of streams for distributions. - # @!attribute [rw] distributions - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Distribution>] - # Optional. List of distributions. - # @!attribute [rw] sprite_sheets - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::SpriteSheet>] - # List of output sprite sheets. - # @!attribute [r] streaming_state - # @return [::Google::Cloud::Video::LiveStream::V1::Channel::StreamingState] - # Output only. State of the streaming operation. - # @!attribute [r] streaming_error - # @return [::Google::Rpc::Status] - # Output only. A description of the reason for the streaming error. This - # property is always present when - # {::Google::Cloud::Video::LiveStream::V1::Channel#streaming_state streaming_state} - # is - # {::Google::Cloud::Video::LiveStream::V1::Channel::StreamingState::STREAMING_ERROR STREAMING_ERROR}. - # @!attribute [rw] log_config - # @return [::Google::Cloud::Video::LiveStream::V1::LogConfig] - # Configuration of platform logs for this channel. - # @!attribute [rw] timecode_config - # @return [::Google::Cloud::Video::LiveStream::V1::TimecodeConfig] - # Configuration of timecode for this channel. - # @!attribute [rw] encryptions - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Encryption>] - # Optional. Encryption configurations for this channel. Each configuration - # has an ID which is referred to by each MuxStream to indicate which - # configuration is used for that output. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Video::LiveStream::V1::InputConfig] - # The configuration for input sources defined in - # {::Google::Cloud::Video::LiveStream::V1::Channel#input_attachments input_attachments}. - # @!attribute [rw] retention_config - # @return [::Google::Cloud::Video::LiveStream::V1::RetentionConfig] - # Optional. Configuration for retention of output files for this channel. - # @!attribute [rw] static_overlays - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::StaticOverlay>] - # Optional. List of static overlay images. Those images display over the - # output content for the whole duration of the live stream. - # @!attribute [rw] auto_transcription_config - # @return [::Google::Cloud::Video::LiveStream::V1::AutoTranscriptionConfig] - # Optional. Advanced configurations for auto-generated text streams. - class Channel - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Location of output file(s) in a Google Cloud Storage bucket. - # @!attribute [rw] uri - # @return [::String] - # URI for the output file(s). For example, `gs://my-bucket/outputs/`. - class Output - 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 - - # State of streaming operation that the channel is running. - module StreamingState - # Streaming state is not specified. - STREAMING_STATE_UNSPECIFIED = 0 - - # Channel is getting the input stream, generating the live streams to the - # specified output location. - STREAMING = 1 - - # Channel is waiting for the input stream through the input. - AWAITING_INPUT = 2 - - # Channel is running, but has trouble publishing the live streams onto the - # specified output location (for example, the specified Cloud Storage - # bucket is not writable). - STREAMING_ERROR = 4 - - # Channel is generating live streams with no input stream. Live streams are - # filled out with black screen, while input stream is missing. - # Not supported yet. - STREAMING_NO_INPUT = 5 - - # Channel is stopped, finishing live streams. - STOPPED = 6 - - # Channel is starting. - STARTING = 7 - - # Channel is stopping. - STOPPING = 8 - end - end - - # 2D normalized coordinates. - # @!attribute [rw] x - # @return [::Float] - # Optional. Normalized x coordinate. Valid range is [0.0, 1.0]. Default is 0. - # @!attribute [rw] y - # @return [::Float] - # Optional. Normalized y coordinate. Valid range is [0.0, 1.0]. Default is 0. - class NormalizedCoordinate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Normalized resolution. - # @!attribute [rw] w - # @return [::Float] - # Optional. Normalized width. Valid range is [0.0, 1.0]. Default is 0. - # @!attribute [rw] h - # @return [::Float] - # Optional. Normalized height. Valid range is [0.0, 1.0]. Default is 0. - class NormalizedResolution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for the static overlay. - # @!attribute [rw] asset - # @return [::String] - # Required. Asset to use for the overlaid image. - # The asset must be represented in the form of: - # `projects/{project}/locations/{location}/assets/{assetId}`. - # The asset's resource type must be image. - # @!attribute [rw] resolution - # @return [::Google::Cloud::Video::LiveStream::V1::NormalizedResolution] - # Optional. Normalized image resolution, based on output video resolution. - # Valid values are [0.0, 1.0]. To respect the original image aspect ratio, - # set either `w` or `h` to 0. To use the original image resolution, set both - # `w` and `h` to 0. The default is \\{0, 0}. - # @!attribute [rw] position - # @return [::Google::Cloud::Video::LiveStream::V1::NormalizedCoordinate] - # Optional. Position of the image in terms of normalized coordinates of the - # upper-left corner of the image, based on output video resolution. For - # example, use the x and y coordinates \\{0, 0} to position the top-left corner - # of the overlay animation in the top-left corner of the output video. - # @!attribute [rw] opacity - # @return [::Float] - # Optional. Target image opacity. Valid values are from `1.0` (solid, - # default) to `0.0` (transparent), exclusive. Set this to a value greater - # than `0.0`. - class StaticOverlay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for the input sources of a channel. - # @!attribute [rw] input_switch_mode - # @return [::Google::Cloud::Video::LiveStream::V1::InputConfig::InputSwitchMode] - # Input switch mode. Default mode is `FAILOVER_PREFER_PRIMARY`. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Input switch mode. - module InputSwitchMode - # The input switch mode is not specified. - INPUT_SWITCH_MODE_UNSPECIFIED = 0 - - # Automatic failover is enabled. The primary input stream is always - # preferred over its backup input streams configured using the - # {::Google::Cloud::Video::LiveStream::V1::InputAttachment::AutomaticFailover AutomaticFailover} - # field. - FAILOVER_PREFER_PRIMARY = 1 - - # Automatic failover is disabled. You must use the - # {::Google::Cloud::Video::LiveStream::V1::Event#input_switch inputSwitch} event - # to switch the active input source for the channel to stream from. When - # this mode is chosen, the - # {::Google::Cloud::Video::LiveStream::V1::InputAttachment::AutomaticFailover AutomaticFailover} - # field is ignored. - MANUAL = 3 - end - end - - # Configuration of platform logs. - # See [Using and managing platform - # logs](https://cloud.google.com/logging/docs/api/platform-logs#managing-logs) - # for more information about how to view platform logs through Cloud Logging. - # @!attribute [rw] log_severity - # @return [::Google::Cloud::Video::LiveStream::V1::LogConfig::LogSeverity] - # The severity level of platform logging for this resource. - class LogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The severity level of platform logging for this channel. Logs with a - # severity level higher than or equal to the chosen severity level will be - # logged and can be viewed through Cloud Logging. - # The severity level of a log is ranked as followed from low to high: DEBUG < - # INFO < NOTICE < WARNING < ERROR < CRITICAL < ALERT < EMERGENCY. - # See - # [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity) - # for more information. - module LogSeverity - # Log severity is not specified. This is the same as log severity is OFF. - LOG_SEVERITY_UNSPECIFIED = 0 - - # Log is turned off. - OFF = 1 - - # Log with severity higher than or equal to DEBUG are logged. - DEBUG = 100 - - # Logs with severity higher than or equal to INFO are logged. - INFO = 200 - - # Logs with severity higher than or equal to WARNING are logged. - WARNING = 400 - - # Logs with severity higher than or equal to ERROR are logged. - ERROR = 500 - end - end - - # Configuration for retention of output files. - # @!attribute [rw] retention_window_duration - # @return [::Google::Protobuf::Duration] - # The minimum duration for which the output files from the channel will - # remain in the output bucket. After this duration, output files are - # deleted asynchronously. - # - # When the channel is deleted, all output files are deleted from the output - # bucket asynchronously. - # - # If omitted or set to zero, output files will remain in the output bucket - # based on - # {::Google::Cloud::Video::LiveStream::V1::Manifest#segment_keep_duration Manifest.segment_keep_duration}, - # which defaults to 60s. - # - # If both retention_window_duration and - # {::Google::Cloud::Video::LiveStream::V1::Manifest#segment_keep_duration Manifest.segment_keep_duration} - # are set, retention_window_duration is used and - # {::Google::Cloud::Video::LiveStream::V1::Manifest#segment_keep_duration Manifest.segment_keep_duration} - # is ignored. - class RetentionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Properties of the input stream. - # @!attribute [rw] last_establish_time - # @return [::Google::Protobuf::Timestamp] - # The time that the current input stream is accepted and the connection is - # established. - # @!attribute [rw] video_streams - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::VideoStreamProperty>] - # Properties of the video streams. - # @!attribute [rw] audio_streams - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::AudioStreamProperty>] - # Properties of the audio streams. - class InputStreamProperty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Properties of the video stream. - # @!attribute [rw] index - # @return [::Integer] - # Index of this video stream. - # @!attribute [rw] video_format - # @return [::Google::Cloud::Video::LiveStream::V1::VideoFormat] - # Properties of the video format. - class VideoStreamProperty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Properties of the video format. - # @!attribute [rw] codec - # @return [::String] - # Video codec used in this video stream. - # @!attribute [rw] width_pixels - # @return [::Integer] - # The width of the video stream in pixels. - # @!attribute [rw] height_pixels - # @return [::Integer] - # The height of the video stream in pixels. - # @!attribute [rw] frame_rate - # @return [::Float] - # The frame rate of the input video stream. - class VideoFormat - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Properties of the audio stream. - # @!attribute [rw] index - # @return [::Integer] - # Index of this audio stream. - # @!attribute [rw] audio_format - # @return [::Google::Cloud::Video::LiveStream::V1::AudioFormat] - # Properties of the audio format. - class AudioStreamProperty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Properties of the audio format. - # @!attribute [rw] codec - # @return [::String] - # Audio codec used in this audio stream. - # @!attribute [rw] channel_count - # @return [::Integer] - # The number of audio channels. - # @!attribute [rw] channel_layout - # @return [::Array<::String>] - # A list of channel names specifying the layout of the audio channels. - class AudioFormat - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A group of information for attaching an input resource to this channel. - # @!attribute [rw] key - # @return [::String] - # A unique key for this input attachment. The key must be 1-63 - # characters in length. The key must begin and end with a letter (regardless - # of case) or a number, but can contain dashes or underscores in between. - # @!attribute [rw] input - # @return [::String] - # The resource name of an existing input, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # @!attribute [rw] automatic_failover - # @return [::Google::Cloud::Video::LiveStream::V1::InputAttachment::AutomaticFailover] - # Automatic failover configurations. - class InputAttachment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configurations to follow when automatic failover happens. - # @!attribute [rw] input_keys - # @return [::Array<::String>] - # The - # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key}s - # of inputs to failover to when this input is disconnected. Currently, only - # up to one backup input is supported. - class AutomaticFailover - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Advanced configurations for auto-generated text streams. - # @!attribute [rw] display_timing - # @return [::Google::Cloud::Video::LiveStream::V1::AutoTranscriptionConfig::DisplayTiming] - # Optional. Whether auto-generated text streams are displayed synchronously - # or asynchronously with the original audio. - # @!attribute [rw] quality_preset - # @return [::Google::Cloud::Video::LiveStream::V1::AutoTranscriptionConfig::QualityPreset] - # Optional. Tunes the latency and quality of auto-generated captions. - class AutoTranscriptionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Whether auto-generated text streams are displayed synchronously or - # asynchronously with the original audio. - module DisplayTiming - # Display timing is not specified. Caption display will be asynchronous by - # default. - DISPLAY_TIMING_UNSPECIFIED = 0 - - # Caption will be displayed asynchronous with audio. - ASYNC = 1 - - # Caption will be displayed synchronous with audio. This option increases - # overall media output latency, and reduces viewing latency between audio - # and auto-generated captions. - SYNC = 2 - end - - # Presets to tune the latency and quality of auto-generated captions. - module QualityPreset - # Quality Preset is not specified. By default, BALANCED_QUALITY will be - # used. - QUALITY_PRESET_UNSPECIFIED = 0 - - # Reduce the latency of auto-generated captions. This may reduce the - # quality of the captions. - LOW_LATENCY = 1 - - # Default behavior when QualityPreset is not specified. - BALANCED_QUALITY = 2 - - # Increases the quality of the auto-generated captions at the cost of - # higher latency. - IMPROVED_QUALITY = 3 - end - end - - # Event is a sub-resource of a channel, which can be scheduled by the user to - # execute operations on a channel resource without having to stop the channel. - # @!attribute [rw] name - # @return [::String] - # The resource name of the event, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # User-defined key/value metadata. - # @!attribute [rw] input_switch - # @return [::Google::Cloud::Video::LiveStream::V1::Event::InputSwitchTask] - # Switches to another input stream. - # - # Note: The following fields are mutually exclusive: `input_switch`, `ad_break`, `return_to_program`, `slate`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ad_break - # @return [::Google::Cloud::Video::LiveStream::V1::Event::AdBreakTask] - # Inserts a new ad opportunity. - # - # Note: The following fields are mutually exclusive: `ad_break`, `input_switch`, `return_to_program`, `slate`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] return_to_program - # @return [::Google::Cloud::Video::LiveStream::V1::Event::ReturnToProgramTask] - # Stops any running ad break. - # - # Note: The following fields are mutually exclusive: `return_to_program`, `input_switch`, `ad_break`, `slate`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] slate - # @return [::Google::Cloud::Video::LiveStream::V1::Event::SlateTask] - # Inserts a slate. - # - # Note: The following fields are mutually exclusive: `slate`, `input_switch`, `ad_break`, `return_to_program`, `mute`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] mute - # @return [::Google::Cloud::Video::LiveStream::V1::Event::MuteTask] - # Mutes the stream. - # - # Note: The following fields are mutually exclusive: `mute`, `input_switch`, `ad_break`, `return_to_program`, `slate`, `unmute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] unmute - # @return [::Google::Cloud::Video::LiveStream::V1::Event::UnmuteTask] - # Unmutes the stream. - # - # Note: The following fields are mutually exclusive: `unmute`, `input_switch`, `ad_break`, `return_to_program`, `slate`, `mute`, `update_encryptions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] update_encryptions - # @return [::Google::Cloud::Video::LiveStream::V1::Event::UpdateEncryptionsTask] - # Updates encryption settings. - # - # Note: The following fields are mutually exclusive: `update_encryptions`, `input_switch`, `ad_break`, `return_to_program`, `slate`, `mute`, `unmute`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] execute_now - # @return [::Boolean] - # When this field is set to true, the event will be executed at the earliest - # time that the server can schedule the event and - # {::Google::Cloud::Video::LiveStream::V1::Event#execution_time execution_time} - # will be populated with the time that the server actually schedules the - # event. - # @!attribute [rw] execution_time - # @return [::Google::Protobuf::Timestamp] - # The time to execute the event. If you set - # {::Google::Cloud::Video::LiveStream::V1::Event#execute_now execute_now} to - # `true`, then do not set this field in the `CreateEvent` request. In - # this case, the server schedules the event and populates this field. If you - # set {::Google::Cloud::Video::LiveStream::V1::Event#execute_now execute_now} to - # `false`, then you must set this field to at least 10 seconds in the future - # or else the event can't be created. - # @!attribute [r] state - # @return [::Google::Cloud::Video::LiveStream::V1::Event::State] - # Output only. The state of the event. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. An error object that describes the reason for the failure. - # This property is always present when `state` is `FAILED`. - class Event - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Switches to another input stream. Automatic failover is then disabled. - # @!attribute [rw] input_key - # @return [::String] - # The - # {::Google::Cloud::Video::LiveStream::V1::InputAttachment#key InputAttachment.key} - # of the input to switch to. - class InputSwitchTask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Inserts a new ad opportunity. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration of an ad opportunity. Must be greater than 0. - class AdBreakTask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Inserts a slate. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Optional. Duration of the slate. Must be greater than 0 if specified. - # Omit this field for a long running slate. - # @!attribute [rw] asset - # @return [::String] - # Slate asset to use for the duration. If its duration is less than the - # duration of the SlateTask, then the slate loops. The slate must be - # represented in the form of: - # `projects/{project}/locations/{location}/assets/{assetId}`. - class SlateTask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Stops any events which are currently running. This only applies to events - # with a duration. - class ReturnToProgramTask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mutes the stream. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration for which the stream should be muted. If omitted, the stream - # will be muted until an UnmuteTask event is sent. - class MuteTask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Unmutes the stream. The task fails if the stream is not currently muted. - class UnmuteTask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Update encryption settings. - # @!attribute [rw] encryptions - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::EncryptionUpdate>] - # Required. A list of - # {::Google::Cloud::Video::LiveStream::V1::EncryptionUpdate EncryptionUpdate}s - # that updates the existing encryption settings. - class UpdateEncryptionsTask - 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 - - # State of the event - module State - # Event state is not specified. - STATE_UNSPECIFIED = 0 - - # Event is scheduled but not executed yet. - SCHEDULED = 1 - - # Event is being executed. - RUNNING = 2 - - # Event has been successfully executed. - SUCCEEDED = 3 - - # Event fails to be executed. - FAILED = 4 - - # Event has been created but not scheduled yet. - PENDING = 5 - - # Event was stopped before running for its full duration. - STOPPED = 6 - end - end - - # Clip is a sub-resource under channel. Each clip represents a clipping - # operation that generates a VOD playlist from its channel given a set of - # timestamp ranges. - # @!attribute [rw] name - # @return [::String] - # The resource name of the clip, in the following format: - # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. - # `{clipId}` is a user-specified resource id that conforms to the following - # criteria: - # - # 1. 1 character minimum, 63 characters maximum - # 2. Only contains letters, digits, underscores, and hyphens - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation timestamp of the clip resource. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the clip request starts to be processed. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp of the clip resource. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels associated with this resource. Each label is a key-value pair. - # @!attribute [r] state - # @return [::Google::Cloud::Video::LiveStream::V1::Clip::State] - # Output only. The state of the clip. - # @!attribute [rw] output_uri - # @return [::String] - # Specify the `output_uri` to determine where to place the clip segments and - # clip manifest files in Cloud Storage. The manifests specified in - # `clip_manifests` fields will be placed under this URI. The exact URI of the - # generated manifests will be provided in `clip_manifests.output_uri` for - # each manifest. - # Example: - # "output_uri": "gs://my-bucket/clip-outputs" - # "clip_manifests.output_uri": "gs://my-bucket/clip-outputs/main.m3u8" - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. An error object that describes the reason for the failure. - # This property only presents when `state` is `FAILED`. - # @!attribute [rw] slices - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Clip::Slice>] - # The specified ranges of segments to generate a clip. - # @!attribute [rw] clip_manifests - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Clip::ClipManifest>] - # Required. A list of clip manifests. Currently only one clip manifest is - # allowed. - # @!attribute [rw] output_type - # @return [::Google::Cloud::Video::LiveStream::V1::Clip::OutputType] - # Optional. OutputType of the clip. If not specified, the default value is - # MANIFEST. - class Clip - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # TimeSlice represents a tuple of Unix epoch timestamps that specifies a time - # range. - # @!attribute [rw] markin_time - # @return [::Google::Protobuf::Timestamp] - # The mark-in Unix epoch time in the original live stream manifest. - # @!attribute [rw] markout_time - # @return [::Google::Protobuf::Timestamp] - # The mark-out Unix epoch time in the original live stream manifest. - class TimeSlice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Slice represents a slice of the requested clip. - # @!attribute [rw] time_slice - # @return [::Google::Cloud::Video::LiveStream::V1::Clip::TimeSlice] - # A slice in form of a tuple of Unix epoch time. - class Slice - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ClipManifest identifies a source manifest for the generated clip manifest. - # @!attribute [rw] manifest_key - # @return [::String] - # Required. A unique key that identifies a manifest config in the parent - # channel. This key is the same as `channel.manifests.key` for the selected - # manifest. - # @!attribute [r] output_uri - # @return [::String] - # Output only. The output URI of the generated clip manifest. This field - # will be populated when the CreateClip request is accepted. Current output - # format is provided below but may change in the future. Please read this - # field to get the uri to the generated clip manifest. Format: - # \\{clip.output_uri}/\\{channel.manifest.fileName} Example: - # gs://my-bucket/clip-outputs/main.m3u8 - class ClipManifest - 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 - - # State of clipping operation. - module State - # State is not specified. - STATE_UNSPECIFIED = 0 - - # The operation is pending to be picked up by the server. - PENDING = 1 - - # The server admitted this create clip request, and - # outputs are under processing. - CREATING = 2 - - # Outputs are available in the specified Cloud Storage bucket. For - # additional information, see the `outputs` field. - SUCCEEDED = 3 - - # The operation has failed. For additional information, see the `error` - # field. - FAILED = 4 - end - - # OutputType represents the output type of the clip. - module OutputType - # OutputType is not specified. - OUTPUT_TYPE_UNSPECIFIED = 0 - - # OutputType is a VOD manifest. This is the default value. - MANIFEST = 1 - - # OutputType is an MP4 file. - MP4 = 2 - end - end - - # TimeInterval represents a time interval. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The start time of the interval. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The end time of the interval. - class TimeInterval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DvrSession is a sub-resource under channel. Each DvrSession represents a DVR - # recording of the live stream for a specific time range. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the DVR session, in the following format: - # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. - # `{dvrSessionId}` is a user-specified resource id that conforms to the - # following criteria: - # - # 1. 1 character minimum, 63 characters maximum - # 2. Only contains letters, digits, underscores, and hyphens - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. User-defined key/value metadata. - # @!attribute [r] state - # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession::State] - # Output only. The state of the clip. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. An error object that describes the reason for the failure. - # This property only presents when `state` is `FAILED`. - # @!attribute [rw] dvr_manifests - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DvrSession::DvrManifest>] - # Required. A list of DVR manifests. Currently only one DVR manifest is - # allowed. - # @!attribute [rw] dvr_windows - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DvrSession::DvrWindow>] - # Required. The specified ranges of segments to generate a DVR recording. - class DvrSession - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # DvrManifest identifies a source manifest and specifies a file name for the - # generated DVR manifest. - # @!attribute [rw] manifest_key - # @return [::String] - # Required. A unique key that identifies a manifest config in the parent - # channel. This key is the same as `channel.manifests.key` for the selected - # manifest. - # @!attribute [r] output_uri - # @return [::String] - # Output only. The output URI of the DVR manifest. The DVR output will be - # placed in a directory named `dvr/dvrSessionId/` under the parent - # channel's output uri. Format: - # \\{channel.output.uri}/dvr/\\{dvrSessionId}/\\{channel.manifests.fileName} - # Example: gs://my-bucket/outputs/dvr/my-dvr-session/main.m3u8 - class DvrManifest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DvrWindow represents a DVR window. - # @!attribute [rw] time_interval - # @return [::Google::Cloud::Video::LiveStream::V1::TimeInterval] - # A time interval in the form of a tuple of Unix epoch time. - class DvrWindow - 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 - - # State of the DVR session. - module State - # State is not specified. - STATE_UNSPECIFIED = 0 - - # The operation is pending to be picked up by the server. - PENDING = 1 - - # The session is being updated. - UPDATING = 2 - - # The session is scheduled and waiting for the start time. - SCHEDULED = 3 - - # The session is currently in progress and the outputs are available in the - # specified Cloud Storage bucket. For additional information, see the - # `dvr_manifests.output_uri` field. - LIVE = 4 - - # Outputs are available in the specified Cloud Storage bucket. For - # additional information, see the `dvr_manifests.output_uri` field. - FINISHED = 5 - - # The operation has failed. For additional information, see the `error` - # field. - FAILED = 6 - - # The session is being deleted. - DELETING = 7 - - # The session is being post processed. - POST_PROCESSING = 8 - - # The session is in cooldown. The cooldown period lasts for 60 seconds. - # When the DVR session is updated by the user to have a new end time that - # is likely already in the past, the DVR manifest will end as soon as - # possible and the DVR session will move to this state. This is done to - # prevent the players to receive a manifest update that removes a segment - # that has already been played. After the cooldown period ends, a new - # manifest is generated that honors the new end time. - COOLDOWN = 9 - - # The session is being stopped. The session will move to STOPPING state, if - # the parent channel is updated. - STOPPING = 10 - end - end - - # An asset represents a video or an image. - # @!attribute [rw] name - # @return [::String] - # The resource name of the asset, in the form of: - # `projects/{project}/locations/{location}/assets/{assetId}`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # User-defined key/value metadata. - # @!attribute [rw] video - # @return [::Google::Cloud::Video::LiveStream::V1::Asset::VideoAsset] - # VideoAsset represents a video. - # - # Note: The following fields are mutually exclusive: `video`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image - # @return [::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset] - # ImageAsset represents an image. - # - # Note: The following fields are mutually exclusive: `image`, `video`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] crc32c - # @return [::String] - # Based64-encoded CRC32c checksum of the asset file. For more information, - # see the crc32c checksum of the [Cloud Storage Objects - # resource](https://cloud.google.com/storage/docs/json_api/v1/objects). - # If crc32c is omitted or left empty when the asset is created, this field is - # filled by the crc32c checksum of the Cloud Storage object indicated by - # {::Google::Cloud::Video::LiveStream::V1::Asset::VideoAsset#uri VideoAsset.uri} or - # {::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset#uri ImageAsset.uri}. If - # crc32c is set, the asset can't be created if the crc32c value does not - # match with the crc32c checksum of the Cloud Storage object indicated by - # {::Google::Cloud::Video::LiveStream::V1::Asset::VideoAsset#uri VideoAsset.uri} or - # {::Google::Cloud::Video::LiveStream::V1::Asset::ImageAsset#uri ImageAsset.uri}. - # @!attribute [r] state - # @return [::Google::Cloud::Video::LiveStream::V1::Asset::State] - # Output only. The state of the asset resource. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Only present when `state` is `ERROR`. The reason for the error - # state of the asset. - class Asset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # VideoAsset represents a video. The supported formats are MP4, MPEG-TS, and - # FLV. The supported video codec is H264. The supported audio codecs are - # AAC, AC3, MP2, and MP3. - # @!attribute [rw] uri - # @return [::String] - # Cloud Storage URI of the video. The format is `gs://my-bucket/my-object`. - class VideoAsset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Image represents an image. The supported formats are JPEG, PNG. - # @!attribute [rw] uri - # @return [::String] - # Cloud Storage URI of the image. The format is `gs://my-bucket/my-object`. - class ImageAsset - 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 - - # State of the asset resource. - module State - # State is not specified. - STATE_UNSPECIFIED = 0 - - # The asset is being created. - CREATING = 1 - - # The asset is ready for use. - ACTIVE = 2 - - # The asset is being deleted. - DELETING = 3 - - # The asset has an error. - ERROR = 4 - end - end - - # Encryption settings. - # @!attribute [rw] id - # @return [::String] - # Required. Identifier for this set of encryption options. The ID must be - # 1-63 characters in length. The ID must begin and end with a letter - # (regardless of case) or a number, but can contain dashes or underscores in - # between. - # @!attribute [rw] secret_manager_key_source - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SecretManagerSource] - # For keys stored in Google Secret Manager. - # @!attribute [rw] drm_systems - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::DrmSystems] - # Required. Configuration for DRM systems. - # @!attribute [rw] aes128 - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Aes128Encryption] - # Configuration for HLS AES-128 encryption. - # - # Note: The following fields are mutually exclusive: `aes128`, `sample_aes`, `mpeg_cenc`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] sample_aes - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SampleAesEncryption] - # Configuration for HLS SAMPLE-AES encryption. - # - # Note: The following fields are mutually exclusive: `sample_aes`, `aes128`, `mpeg_cenc`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] mpeg_cenc - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::MpegCommonEncryption] - # Configuration for MPEG-Dash Common Encryption (MPEG-CENC). - # - # Note: The following fields are mutually exclusive: `mpeg_cenc`, `aes128`, `sample_aes`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Encryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for secrets stored in Google Secret Manager. - # @!attribute [rw] secret_version - # @return [::String] - # Required. The name of the Secret Version containing the encryption key. - # `projects/{project}/secrets/{secret_id}/versions/{version_number}` - class SecretManagerSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Widevine configuration. - class Widevine - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Fairplay configuration. - class Fairplay - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Playready configuration. - class Playready - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Clearkey configuration. - class Clearkey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines configuration for DRM systems in use. If a field is omitted, - # that DRM system will be considered to be disabled. - # @!attribute [rw] widevine - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Widevine] - # Optional. Widevine configuration. - # @!attribute [rw] fairplay - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Fairplay] - # Optional. Fairplay configuration. - # @!attribute [rw] playready - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Playready] - # Optional. Playready configuration. - # @!attribute [rw] clearkey - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::Clearkey] - # Optional. Clearkey configuration. - class DrmSystems - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for HLS AES-128 encryption. - class Aes128Encryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for HLS SAMPLE-AES encryption. - class SampleAesEncryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for MPEG-Dash Common Encryption (MPEG-CENC). - # @!attribute [rw] scheme - # @return [::String] - # Required. Specify the encryption scheme, supported schemes: - # - `cenc` - AES-CTR subsample - # - `cbcs`- AES-CBC subsample pattern - class MpegCommonEncryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Encryption setting when updating encryption. - # @!attribute [rw] id - # @return [::String] - # Required. Identifier for the encryption option to be updated. - # @!attribute [rw] secret_manager_key_source - # @return [::Google::Cloud::Video::LiveStream::V1::Encryption::SecretManagerSource] - # For keys stored in Google Secret Manager. - class EncryptionUpdate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pool resource defines the configuration of Live Stream pools for a specific - # location. Currently we support only one pool resource per project per - # location. After the creation of the first input, a default pool is created - # automatically at "projects/\\{project}/locations/\\{location}/pools/default". - # @!attribute [rw] name - # @return [::String] - # The resource name of the pool, in the form of: - # `projects/{project}/locations/{location}/pools/{poolId}`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # User-defined key/value metadata. - # @!attribute [rw] network_config - # @return [::Google::Cloud::Video::LiveStream::V1::Pool::NetworkConfig] - # Network configuration for the pool. - class Pool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines the network configuration for the pool. - # @!attribute [rw] peered_network - # @return [::String] - # peered_network is the network resource URL of the network that is peered - # to the service provider network. Must be of the format - # projects/NETWORK_PROJECT_NUMBER/global/networks/NETWORK_NAME, where - # NETWORK_PROJECT_NUMBER is the project number of the Cloud project that - # holds your VPC network and NETWORK_NAME is the name of your VPC network. - # If peered_network is omitted or empty, the pool will use endpoints that - # are publicly available. - class NetworkConfig - 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 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb deleted file mode 100644 index 47f17459c530..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/cloud/video/livestream/v1/service.rb +++ /dev/null @@ -1,1032 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Video - module LiveStream - module V1 - # Request message for "LivestreamService.CreateAsset". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] asset - # @return [::Google::Cloud::Video::LiveStream::V1::Asset] - # Required. The asset resource to be created. - # @!attribute [rw] asset_id - # @return [::String] - # Required. The ID of the asset resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class CreateAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.DeleteAsset". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the asset resource, in the form of: - # `projects/{project}/locations/{location}/assets/{assetId}`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class DeleteAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.ListAssets". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results - class ListAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for "LivestreamService.ListAssets". - # @!attribute [rw] assets - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Asset>] - # The list of Assets - # @!attribute [rw] next_page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.GetAsset". - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/assets/{asset}`. - class GetAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.CreateChannel". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] channel - # @return [::Google::Cloud::Video::LiveStream::V1::Channel] - # Required. The channel resource to be created. - # @!attribute [rw] channel_id - # @return [::String] - # Required. The ID of the channel resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class CreateChannelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.ListChannels". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - # @!attribute [rw] filter - # @return [::String] - # The filter to apply to list results. - # @!attribute [rw] order_by - # @return [::String] - # Specifies the ordering of results following syntax at - # https://cloud.google.com/apis/design/design_patterns#sorting_order. - class ListChannelsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for "LivestreamService.ListChannels". - # @!attribute [rw] channels - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Channel>] - # A list of channels. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListChannelsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.GetChannel". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - class GetChannelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.DeleteChannel". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - # @!attribute [rw] force - # @return [::Boolean] - # If the `force` field is set to the default value of `false`, you must - # delete all of a channel's events before you can delete the channel itself. - # If the field is set to `true`, requests to delete a channel also delete - # associated channel events. - class DeleteChannelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.UpdateChannel". - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the Channel - # resource by the update. You can only update the following fields: - # - # * [`inputAttachments`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputattachment) - # * [`inputConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#inputconfig) - # * [`output`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#output) - # * [`elementaryStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#elementarystream) - # * [`muxStreams`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#muxstream) - # * [`manifests`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#manifest) - # * [`spriteSheets`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#spritesheet) - # * [`logConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#logconfig) - # * [`timecodeConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#timecodeconfig) - # * [`encryptions`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.channels#encryption) - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the mask is not present, then each field from the list above is updated - # if the field appears in the request payload. To unset a field, add the - # field to the update mask and remove it from the request payload. - # @!attribute [rw] channel - # @return [::Google::Cloud::Video::LiveStream::V1::Channel] - # Required. The channel resource to be updated. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class UpdateChannelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.StartChannel". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class StartChannelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.StopChannel". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class StopChannelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.StartDistribution". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] distribution_keys - # @return [::Array<::String>] - # Optional. A list of keys to identify the distribution configuration in the - # channel resource. If left empty, all the distributions in the channel - # specification will be started. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class StartDistributionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.StopDistribution". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the channel resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] distribution_keys - # @return [::Array<::String>] - # Optional. A list of key to identify the distribution configuration in the - # channel resource. If left empty, all the distributions in the channel - # specification will be stopped. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class StopDistributionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.CreateInput". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] input - # @return [::Google::Cloud::Video::LiveStream::V1::Input] - # Required. The input resource to be created. - # @!attribute [rw] input_id - # @return [::String] - # Required. The ID of the input resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class CreateInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.ListInputs". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent location for the resource, in the form of: - # `projects/{project}/locations/{location}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListInputsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - # @!attribute [rw] filter - # @return [::String] - # The filter to apply to list results. - # @!attribute [rw] order_by - # @return [::String] - # Specifies the ordering of results following syntax at [Sorting - # Order](https://cloud.google.com/apis/design/design_patterns#sorting_order). - class ListInputsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for "LivestreamService.ListInputs". - # @!attribute [rw] inputs - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Input>] - # A list of inputs. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListInputsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.GetInput". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - class GetInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.DeleteInput". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class DeleteInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.UpdateInput". - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the Input - # resource by the update. You can only update the following fields: - # - # * [`tier`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#Tier) - # * [`preprocessingConfig`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#PreprocessingConfig) - # * [`securityRules`](https://cloud.google.com/livestream/docs/reference/rest/v1/projects.locations.inputs#SecurityRule) - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # - # If the mask is not present, then each field from the list above is updated - # if the field appears in the request payload. To unset a field, add the - # field to the update mask and remove it from the request payload. - # @!attribute [rw] input - # @return [::Google::Cloud::Video::LiveStream::V1::Input] - # Required. The input resource to be updated. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class UpdateInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.CreateEvent". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent channel for the resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] event - # @return [::Google::Cloud::Video::LiveStream::V1::Event] - # Required. The event resource to be created. - # @!attribute [rw] event_id - # @return [::String] - # Required. The ID of the event resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class CreateEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.ListEvents". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent channel for the resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. If unspecified, server - # will pick an appropriate default. Server may return fewer items than - # requested. A caller should only rely on response's - # {::Google::Cloud::Video::LiveStream::V1::ListEventsResponse#next_page_token next_page_token} - # to determine if there are more items left to be queried. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous List request, if any. - # @!attribute [rw] filter - # @return [::String] - # The filter to apply to list results. - # @!attribute [rw] order_by - # @return [::String] - # Specifies the ordering of results following syntax at - # https://cloud.google.com/apis/design/design_patterns#sorting_order. - class ListEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for "LivestreamService.ListEvents". - # @!attribute [rw] events - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Event>] - # A list of events. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.GetEvent". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - class GetEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.DeleteEvent". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}`. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class DeleteEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for Start/Stop Channel long-running operations. - class ChannelOperationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.ListClips". - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListClipsRequest - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results - class ListClipsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for "LivestreamService.ListClips". - # @!attribute [rw] clips - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::Clip>] - # The list of Clip - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListClipsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.GetClip". - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`. - class GetClipRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.CreateClip". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, in the following form: - # `projects/{project}/locations/{location}/channels/{channel}`. - # @!attribute [rw] clip_id - # @return [::String] - # Required. The ID of the clip resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @!attribute [rw] clip - # @return [::Google::Cloud::Video::LiveStream::V1::Clip] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateClipRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.DeleteClip". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the clip resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class DeleteClipRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.ListDvrSessions". - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListDvrSessionsRequest - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Optional. Hint for how to order the results - class ListDvrSessionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for "LivestreamService.ListDvrSessions". - # @!attribute [rw] dvr_sessions - # @return [::Array<::Google::Cloud::Video::LiveStream::V1::DvrSession>] - # The list of DVR sessions - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListDvrSessionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.GetDvrSession". - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource, in the following form: - # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. - class GetDvrSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.CreateDvrSession". - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, in the following form: - # `projects/{project}/locations/{location}/channels/{channelId}`. - # @!attribute [rw] dvr_session_id - # @return [::String] - # Required. The ID of the DVR session resource to be created. - # - # This value must be 1-63 characters, begin and end with a lower-case letter - # or a number, and consist of only lower-case letters, numbers, and hyphens. - # In other words, it must match the following regex: - # `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. - # @!attribute [rw] dvr_session - # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateDvrSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.DeleteDvrSession". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the event resource, in the form of: - # `projects/{project}/locations/{location}/channels/{channelId}/dvrSessions/{dvrSessionId}`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class DeleteDvrSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.UpdateDvrSession". - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # DvrSession resource by the update. You can only update the following - # fields: - # - # * `dvrWindows` - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # @!attribute [rw] dvr_session - # @return [::Google::Cloud::Video::LiveStream::V1::DvrSession] - # Required. The DVR session resource to be updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class UpdateDvrSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have - # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} - # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.GetPool". - # @!attribute [rw] name - # @return [::String] - # Required. The name of the pool resource, in the form of: - # `projects/{project}/locations/{location}/pools/{poolId}`. - class GetPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.UpdatePool". - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the Pool - # resource by the update. You can only update the following fields: - # - # * `networkConfig` - # - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. - # @!attribute [rw] pool - # @return [::Google::Cloud::Video::LiveStream::V1::Pool] - # Required. The pool resource to be updated. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported `(00000000-0000-0000-0000-000000000000)`. - class UpdatePoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for "LivestreamService.PreviewInput" - # @!attribute [rw] name - # @return [::String] - # Required. The name of the input resource, in the form of: - # `projects/{project}/locations/{location}/inputs/{inputId}`. - class PreviewInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for "LivestreamService.PreviewInput" - # @!attribute [rw] uri - # @return [::String] - # URI to display the preview content. - # @!attribute [rw] bearer_token - # @return [::String] - # A bearer token used to authenticate connections that display the preview - # content. The token expires after one hour. For HTTP connections, this token - # should be included as a bearer token inside the Authorization header. - class PreviewInputResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-video-live_stream-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb deleted file mode 100644 index d15ba7af54e4..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/proto_docs/google/type/datetime.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 civil time (or occasionally physical time). - # - # This type can represent a civil time in one of a few possible ways: - # - # * When utc_offset is set and time_zone is unset: a civil time on a calendar - # day with a particular offset from UTC. - # * When time_zone is set and utc_offset is unset: a civil time on a calendar - # day in a particular time zone. - # * When neither time_zone nor utc_offset is set: a civil time on a calendar - # day in local time. - # - # The date is relative to the Proleptic Gregorian Calendar. - # - # If year is 0, the DateTime is considered not to have a specific year. month - # and day must have valid, non-zero values. - # - # This type may also be used to represent a physical time if all the date and - # time fields are set and either case of the `time_offset` oneof is set. - # Consider using `Timestamp` message for physical time instead. If your use - # case also would like to store the user's timezone, that can be done in - # another field. - # - # This type is more flexible than some applications may want. Make sure to - # document and validate your application's limitations. - # @!attribute [rw] year - # @return [::Integer] - # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a - # datetime without a year. - # @!attribute [rw] month - # @return [::Integer] - # Required. Month of year. Must be from 1 to 12. - # @!attribute [rw] day - # @return [::Integer] - # Required. Day of month. Must be from 1 to 31 and valid for the year and - # month. - # @!attribute [rw] hours - # @return [::Integer] - # Required. Hours of day in 24 hour format. Should be from 0 to 23. An API - # may choose to allow the value "24:00:00" for scenarios like business - # closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Required. Minutes of hour of day. Must be from 0 to 59. - # @!attribute [rw] seconds - # @return [::Integer] - # Required. Seconds of minutes of the time. Must normally be from 0 to 59. An - # API may allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Required. Fractions of seconds in nanoseconds. Must be from 0 to - # 999,999,999. - # @!attribute [rw] utc_offset - # @return [::Google::Protobuf::Duration] - # UTC offset. Must be whole seconds, between -18 hours and +18 hours. - # For example, a UTC offset of -4:00 would be represented as - # { seconds: -14400 }. - # - # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone. - # - # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class DateTime - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a time zone from the - # [IANA Time Zone Database](https://www.iana.org/time-zones). - # @!attribute [rw] id - # @return [::String] - # IANA Time Zone Database time zone, e.g. "America/New_York". - # @!attribute [rw] version - # @return [::String] - # Optional. IANA Time Zone Database version number, e.g. "2019a". - class TimeZone - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile deleted file mode 100644 index ce646e3d1d3b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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-video-live_stream-v1", path: "../" -else - gem "google-cloud-video-live_stream-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-video-live_stream-v1/snippets/livestream_service/create_asset.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb deleted file mode 100644 index 1cd597923642..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_asset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateAsset_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the create_asset call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_asset. -# -def create_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new - - # Call the create_asset method. - result = client.create_asset 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 livestream_v1_generated_LivestreamService_CreateAsset_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb deleted file mode 100644 index dac75f9c51b1..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateChannel_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the create_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_channel. -# -def create_channel - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new - - # Call the create_channel method. - result = client.create_channel 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 livestream_v1_generated_LivestreamService_CreateChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb deleted file mode 100644 index 263b1fbd6a78..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_clip.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateClip_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the create_clip call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_clip. -# -def create_clip - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new - - # Call the create_clip method. - result = client.create_clip 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 livestream_v1_generated_LivestreamService_CreateClip_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb deleted file mode 100644 index be10cb5c574b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_dvr_session.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateDvrSession_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the create_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_dvr_session. -# -def create_dvr_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new - - # Call the create_dvr_session method. - result = client.create_dvr_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 livestream_v1_generated_LivestreamService_CreateDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb deleted file mode 100644 index 6ef860baaa1f..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateEvent_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the create_event call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_event. -# -def create_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new - - # Call the create_event method. - result = client.create_event request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. - p result -end -# [END livestream_v1_generated_LivestreamService_CreateEvent_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb deleted file mode 100644 index 2e25d9fe3e52..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_CreateInput_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the create_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#create_input. -# -def create_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new - - # Call the create_input method. - result = client.create_input 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 livestream_v1_generated_LivestreamService_CreateInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb deleted file mode 100644 index c85eed4d8460..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_asset.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteAsset_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the delete_asset call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_asset. -# -def delete_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.new - - # Call the delete_asset method. - result = client.delete_asset 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 livestream_v1_generated_LivestreamService_DeleteAsset_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb deleted file mode 100644 index d78c007e161b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteChannel_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the delete_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_channel. -# -def delete_channel - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new - - # Call the delete_channel method. - result = client.delete_channel 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 livestream_v1_generated_LivestreamService_DeleteChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb deleted file mode 100644 index be654078b442..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_clip.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteClip_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the delete_clip call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_clip. -# -def delete_clip - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new - - # Call the delete_clip method. - result = client.delete_clip 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 livestream_v1_generated_LivestreamService_DeleteClip_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb deleted file mode 100644 index 733d7fa61a1c..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_dvr_session.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteDvrSession_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the delete_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_dvr_session. -# -def delete_dvr_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.new - - # Call the delete_dvr_session method. - result = client.delete_dvr_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 livestream_v1_generated_LivestreamService_DeleteDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb deleted file mode 100644 index bf4b8ad1c01d..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteEvent_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the delete_event call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_event. -# -def delete_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new - - # Call the delete_event method. - result = client.delete_event request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END livestream_v1_generated_LivestreamService_DeleteEvent_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb deleted file mode 100644 index 7f32c9a49824..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_DeleteInput_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the delete_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#delete_input. -# -def delete_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new - - # Call the delete_input method. - result = client.delete_input 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 livestream_v1_generated_LivestreamService_DeleteInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb deleted file mode 100644 index 4f9f71971649..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_asset.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetAsset_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the get_asset call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_asset. -# -def get_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new - - # Call the get_asset method. - result = client.get_asset request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::Asset. - p result -end -# [END livestream_v1_generated_LivestreamService_GetAsset_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb deleted file mode 100644 index 98a538f10b25..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetChannel_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the get_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_channel. -# -def get_channel - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new - - # Call the get_channel method. - result = client.get_channel request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. - p result -end -# [END livestream_v1_generated_LivestreamService_GetChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb deleted file mode 100644 index 62488fe46f26..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_clip.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetClip_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the get_clip call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_clip. -# -def get_clip - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new - - # Call the get_clip method. - result = client.get_clip request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip. - p result -end -# [END livestream_v1_generated_LivestreamService_GetClip_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb deleted file mode 100644 index 6a651d07ac87..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_dvr_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetDvrSession_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the get_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_dvr_session. -# -def get_dvr_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new - - # Call the get_dvr_session method. - result = client.get_dvr_session request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::DvrSession. - p result -end -# [END livestream_v1_generated_LivestreamService_GetDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb deleted file mode 100644 index e0376dfa6af5..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetEvent_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the get_event call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_event. -# -def get_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new - - # Call the get_event method. - result = client.get_event request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. - p result -end -# [END livestream_v1_generated_LivestreamService_GetEvent_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb deleted file mode 100644 index 2b5a8ccf03f4..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetInput_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the get_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_input. -# -def get_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new - - # Call the get_input method. - result = client.get_input request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. - p result -end -# [END livestream_v1_generated_LivestreamService_GetInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb deleted file mode 100644 index 8ea9da19a6cf..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/get_pool.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_GetPool_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the get_pool call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#get_pool. -# -def get_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new - - # Call the get_pool method. - result = client.get_pool request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::Pool. - p result -end -# [END livestream_v1_generated_LivestreamService_GetPool_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb deleted file mode 100644 index 3756f6096bdb..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_assets.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListAssets_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the list_assets call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_assets. -# -def list_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.new - - # Call the list_assets method. - result = client.list_assets 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::Video::LiveStream::V1::Asset. - p item - end -end -# [END livestream_v1_generated_LivestreamService_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb deleted file mode 100644 index d91e8936af0b..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListChannels_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the list_channels call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_channels. -# -def list_channels - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new - - # Call the list_channels method. - result = client.list_channels 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::Video::LiveStream::V1::Channel. - p item - end -end -# [END livestream_v1_generated_LivestreamService_ListChannels_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb deleted file mode 100644 index c38a77a4210e..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_clips.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListClips_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the list_clips call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_clips. -# -def list_clips - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new - - # Call the list_clips method. - result = client.list_clips 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::Video::LiveStream::V1::Clip. - p item - end -end -# [END livestream_v1_generated_LivestreamService_ListClips_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb deleted file mode 100644 index f3882aac3b1f..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_dvr_sessions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListDvrSessions_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the list_dvr_sessions call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_dvr_sessions. -# -def list_dvr_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.new - - # Call the list_dvr_sessions method. - result = client.list_dvr_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::Video::LiveStream::V1::DvrSession. - p item - end -end -# [END livestream_v1_generated_LivestreamService_ListDvrSessions_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb deleted file mode 100644 index ad81a5f24b7f..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListEvents_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the list_events call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_events. -# -def list_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new - - # Call the list_events method. - result = client.list_events 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::Video::LiveStream::V1::Event. - p item - end -end -# [END livestream_v1_generated_LivestreamService_ListEvents_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb deleted file mode 100644 index 3806909b0944..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_ListInputs_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the list_inputs call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#list_inputs. -# -def list_inputs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new - - # Call the list_inputs method. - result = client.list_inputs 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::Video::LiveStream::V1::Input. - p item - end -end -# [END livestream_v1_generated_LivestreamService_ListInputs_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb deleted file mode 100644 index d550a09e0211..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/preview_input.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_PreviewInput_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the preview_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#preview_input. -# -def preview_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new - - # Call the preview_input method. - result = client.preview_input request - - # The returned object is of type Google::Cloud::Video::LiveStream::V1::PreviewInputResponse. - p result -end -# [END livestream_v1_generated_LivestreamService_PreviewInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb deleted file mode 100644 index df968f3cb54a..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StartChannel_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the start_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#start_channel. -# -def start_channel - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new - - # Call the start_channel method. - result = client.start_channel 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 livestream_v1_generated_LivestreamService_StartChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb deleted file mode 100644 index 844445f7f9b3..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/start_distribution.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StartDistribution_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the start_distribution call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#start_distribution. -# -def start_distribution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new - - # Call the start_distribution method. - result = client.start_distribution 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 livestream_v1_generated_LivestreamService_StartDistribution_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb deleted file mode 100644 index 8c3b49c350c7..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StopChannel_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the stop_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#stop_channel. -# -def stop_channel - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new - - # Call the stop_channel method. - result = client.stop_channel 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 livestream_v1_generated_LivestreamService_StopChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb deleted file mode 100644 index e6250762bc48..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_distribution.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_StopDistribution_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the stop_distribution call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#stop_distribution. -# -def stop_distribution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new - - # Call the stop_distribution method. - result = client.stop_distribution 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 livestream_v1_generated_LivestreamService_StopDistribution_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb deleted file mode 100644 index 69b1b71701ab..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdateChannel_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the update_channel call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_channel. -# -def update_channel - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new - - # Call the update_channel method. - result = client.update_channel 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 livestream_v1_generated_LivestreamService_UpdateChannel_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb deleted file mode 100644 index 71198791fe7c..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_dvr_session.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdateDvrSession_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the update_dvr_session call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_dvr_session. -# -def update_dvr_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new - - # Call the update_dvr_session method. - result = client.update_dvr_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 livestream_v1_generated_LivestreamService_UpdateDvrSession_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb deleted file mode 100644 index ecbc94e34893..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdateInput_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the update_input call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_input. -# -def update_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new - - # Call the update_input method. - result = client.update_input 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 livestream_v1_generated_LivestreamService_UpdateInput_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb deleted file mode 100644 index 07fb543dd597..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/livestream_service/update_pool.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 livestream_v1_generated_LivestreamService_UpdatePool_sync] -require "google/cloud/video/live_stream/v1" - -## -# Snippet for the update_pool call in the LivestreamService 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::Video::LiveStream::V1::LivestreamService::Client#update_pool. -# -def update_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new - - # Call the update_pool method. - result = client.update_pool 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 livestream_v1_generated_LivestreamService_UpdatePool_sync] diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json b/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json deleted file mode 100644 index 7a2c0afa9929..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json +++ /dev/null @@ -1,1375 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-video-live_stream-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.video.livestream.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "livestream_v1_generated_LivestreamService_CreateChannel_sync", - "title": "Snippet for the create_channel call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_channel.", - "file": "livestream_service/create_channel.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_channel", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_channel", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "CreateChannel", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateChannel", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_ListChannels_sync", - "title": "Snippet for the list_channels call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_channels.", - "file": "livestream_service/list_channels.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_channels", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_channels", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "ListChannels", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListChannels", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_GetChannel_sync", - "title": "Snippet for the get_channel call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_channel.", - "file": "livestream_service/get_channel.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_channel", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_channel", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::GetChannelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::Channel", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "GetChannel", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetChannel", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_DeleteChannel_sync", - "title": "Snippet for the delete_channel call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_channel.", - "file": "livestream_service/delete_channel.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_channel", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_channel", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "DeleteChannel", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteChannel", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_UpdateChannel_sync", - "title": "Snippet for the update_channel call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_channel.", - "file": "livestream_service/update_channel.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_channel", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_channel", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "UpdateChannel", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdateChannel", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_StartChannel_sync", - "title": "Snippet for the start_channel call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_channel.", - "file": "livestream_service/start_channel.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_channel", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_channel", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::StartChannelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "StartChannel", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.StartChannel", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_StopChannel_sync", - "title": "Snippet for the stop_channel call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_channel.", - "file": "livestream_service/stop_channel.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_channel", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_channel", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::StopChannelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "StopChannel", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.StopChannel", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_StartDistribution_sync", - "title": "Snippet for the start_distribution call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_distribution.", - "file": "livestream_service/start_distribution.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_distribution", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_distribution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "StartDistribution", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.StartDistribution", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_StopDistribution_sync", - "title": "Snippet for the stop_distribution call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_distribution.", - "file": "livestream_service/stop_distribution.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_distribution", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_distribution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "StopDistribution", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.StopDistribution", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_CreateInput_sync", - "title": "Snippet for the create_input call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_input.", - "file": "livestream_service/create_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_input", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::CreateInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "CreateInput", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateInput", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_ListInputs_sync", - "title": "Snippet for the list_inputs call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_inputs.", - "file": "livestream_service/list_inputs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_inputs", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_inputs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::ListInputsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::ListInputsResponse", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "ListInputs", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListInputs", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_GetInput_sync", - "title": "Snippet for the get_input call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_input.", - "file": "livestream_service/get_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_input", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::GetInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::Input", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "GetInput", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetInput", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_DeleteInput_sync", - "title": "Snippet for the delete_input call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_input.", - "file": "livestream_service/delete_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_input", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "DeleteInput", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteInput", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_UpdateInput_sync", - "title": "Snippet for the update_input call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_input.", - "file": "livestream_service/update_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_input", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "UpdateInput", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdateInput", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_PreviewInput_sync", - "title": "Snippet for the preview_input call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#preview_input.", - "file": "livestream_service/preview_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "preview_input", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#preview_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "PreviewInput", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.PreviewInput", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_CreateEvent_sync", - "title": "Snippet for the create_event call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_event.", - "file": "livestream_service/create_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_event", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::CreateEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::Event", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "CreateEvent", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateEvent", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_ListEvents_sync", - "title": "Snippet for the list_events call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_events.", - "file": "livestream_service/list_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_events", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::ListEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::ListEventsResponse", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "ListEvents", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListEvents", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_GetEvent_sync", - "title": "Snippet for the get_event call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_event.", - "file": "livestream_service/get_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_event", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::GetEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::Event", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "GetEvent", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetEvent", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_DeleteEvent_sync", - "title": "Snippet for the delete_event call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_event.", - "file": "livestream_service/delete_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_event", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "DeleteEvent", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteEvent", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_ListClips_sync", - "title": "Snippet for the list_clips call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_clips.", - "file": "livestream_service/list_clips.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clips", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_clips", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::ListClipsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::ListClipsResponse", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "ListClips", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListClips", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_GetClip_sync", - "title": "Snippet for the get_clip call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_clip.", - "file": "livestream_service/get_clip.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_clip", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_clip", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::GetClipRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::Clip", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "GetClip", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetClip", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_CreateClip_sync", - "title": "Snippet for the create_clip call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_clip.", - "file": "livestream_service/create_clip.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_clip", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_clip", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::CreateClipRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "CreateClip", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateClip", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_DeleteClip_sync", - "title": "Snippet for the delete_clip call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_clip.", - "file": "livestream_service/delete_clip.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_clip", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_clip", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "DeleteClip", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteClip", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_CreateDvrSession_sync", - "title": "Snippet for the create_dvr_session call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_dvr_session.", - "file": "livestream_service/create_dvr_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_dvr_session", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_dvr_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "CreateDvrSession", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateDvrSession", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_ListDvrSessions_sync", - "title": "Snippet for the list_dvr_sessions call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_dvr_sessions.", - "file": "livestream_service/list_dvr_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_dvr_sessions", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_dvr_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "ListDvrSessions", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListDvrSessions", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_GetDvrSession_sync", - "title": "Snippet for the get_dvr_session call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_dvr_session.", - "file": "livestream_service/get_dvr_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_dvr_session", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_dvr_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::DvrSession", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "GetDvrSession", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetDvrSession", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_DeleteDvrSession_sync", - "title": "Snippet for the delete_dvr_session call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_dvr_session.", - "file": "livestream_service/delete_dvr_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_dvr_session", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_dvr_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "DeleteDvrSession", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteDvrSession", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_UpdateDvrSession_sync", - "title": "Snippet for the update_dvr_session call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_dvr_session.", - "file": "livestream_service/update_dvr_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_dvr_session", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_dvr_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "UpdateDvrSession", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdateDvrSession", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_CreateAsset_sync", - "title": "Snippet for the create_asset call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_asset.", - "file": "livestream_service/create_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_asset", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "CreateAsset", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.CreateAsset", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_DeleteAsset_sync", - "title": "Snippet for the delete_asset call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_asset.", - "file": "livestream_service/delete_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_asset", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "DeleteAsset", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.DeleteAsset", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_GetAsset_sync", - "title": "Snippet for the get_asset call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_asset.", - "file": "livestream_service/get_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_asset", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::GetAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::Asset", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "GetAsset", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetAsset", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_ListAssets_sync", - "title": "Snippet for the list_assets call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_assets.", - "file": "livestream_service/list_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_assets", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "ListAssets", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.ListAssets", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_GetPool_sync", - "title": "Snippet for the get_pool call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_pool.", - "file": "livestream_service/get_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_pool", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::GetPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Video::LiveStream::V1::Pool", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "GetPool", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.GetPool", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "livestream_v1_generated_LivestreamService_UpdatePool_sync", - "title": "Snippet for the update_pool call in the LivestreamService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_pool.", - "file": "livestream_service/update_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_pool", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LivestreamService::Client", - "full_name": "::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client" - }, - "method": { - "short_name": "UpdatePool", - "full_name": "google.cloud.video.livestream.v1.LivestreamService.UpdatePool", - "service": { - "short_name": "LivestreamService", - "full_name": "google.cloud.video.livestream.v1.LivestreamService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb deleted file mode 100644 index 6d395ffb507e..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" -require "google/cloud/video/livestream/v1/service_services_pb" -require "google/cloud/video/live_stream/v1/livestream_service" - -class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb deleted file mode 100644 index ae4c7b52909c..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_paths_test.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/live_stream/v1/livestream_service" - -class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_asset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.asset_path project: "value0", location: "value1", asset: "value2" - assert_equal "projects/value0/locations/value1/assets/value2", path - end - end - - def test_channel_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.channel_path project: "value0", location: "value1", channel: "value2" - assert_equal "projects/value0/locations/value1/channels/value2", path - end - end - - def test_clip_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.clip_path project: "value0", location: "value1", channel: "value2", clip: "value3" - assert_equal "projects/value0/locations/value1/channels/value2/clips/value3", path - end - end - - def test_dvr_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::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dvr_session_path project: "value0", location: "value1", channel: "value2", dvr_session: "value3" - assert_equal "projects/value0/locations/value1/channels/value2/dvrSessions/value3", path - end - end - - def test_event_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_path project: "value0", location: "value1", channel: "value2", event: "value3" - assert_equal "projects/value0/locations/value1/channels/value2/events/value3", path - end - end - - def test_input_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.input_path project: "value0", location: "value1", input: "value2" - assert_equal "projects/value0/locations/value1/inputs/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::Video::LiveStream::V1::LivestreamService::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_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/global/networks/value1", path - end - end - - def test_pool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.pool_path project: "value0", location: "value1", pool: "value2" - assert_equal "projects/value0/locations/value1/pools/value2", path - end - end - - def test_secret_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_version_path project: "value0", secret: "value1", version: "value2" - assert_equal "projects/value0/secrets/value1/versions/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb deleted file mode 100644 index c116c36189e7..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_rest_test.rb +++ /dev/null @@ -1,1998 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" -require "google/cloud/video/live_stream/v1/livestream_service/rest" - - -class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_channel - # 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" - channel = {} - channel_id = "hello world" - request_id = "hello world" - - create_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_channel_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_channel({ parent: parent, channel: channel, channel_id: channel_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_channel parent: parent, channel: channel, channel_id: channel_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_channel ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_channel({ parent: parent, channel: channel, channel_id: channel_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_channel(::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_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_channel_client_stub.call_count - end - end - end - - def test_list_channels - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.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_channels_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_channels_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_channels_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_channels({ 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_channels 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_channels ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels({ 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_channels(::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels_client_stub.call_count - end - end - end - - def test_get_channel - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::Channel.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_channel_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_channel({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_channel name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_channel ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_channel({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_channel(::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_channel_client_stub.call_count - end - end - end - - def test_delete_channel - # 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" - force = true - - delete_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_channel_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_channel({ name: name, request_id: request_id, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_channel name: name, request_id: request_id, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_channel ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_channel({ name: name, request_id: request_id, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_channel(::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_channel_client_stub.call_count - end - end - end - - def test_update_channel - # 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. - update_mask = {} - channel = {} - request_id = "hello world" - - update_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_channel_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_channel({ update_mask: update_mask, channel: channel, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_channel update_mask: update_mask, channel: channel, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_channel ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_channel({ update_mask: update_mask, channel: channel, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_channel(::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_channel_client_stub.call_count - end - end - end - - def test_start_channel - # 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" - - start_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_start_channel_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_channel({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_channel name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_channel ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_channel({ 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.start_channel(::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.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, start_channel_client_stub.call_count - end - end - end - - def test_stop_channel - # 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" - - stop_channel_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_stop_channel_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_channel({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_channel name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_channel ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_channel({ 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.stop_channel(::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.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, stop_channel_client_stub.call_count - end - end - end - - def test_start_distribution - # 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" - distribution_keys = ["hello world"] - request_id = "hello world" - - start_distribution_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_start_distribution_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_distribution_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_distribution name: name, distribution_keys: distribution_keys, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_distribution ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_distribution(::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_distribution_client_stub.call_count - end - end - end - - def test_stop_distribution - # 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" - distribution_keys = ["hello world"] - request_id = "hello world" - - stop_distribution_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_stop_distribution_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_distribution_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_distribution name: name, distribution_keys: distribution_keys, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_distribution ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_distribution({ name: name, distribution_keys: distribution_keys, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.stop_distribution(::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, stop_distribution_client_stub.call_count - end - end - end - - def test_create_input - # 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" - input = {} - input_id = "hello world" - request_id = "hello world" - - create_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_input({ parent: parent, input: input, input_id: input_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_input parent: parent, input: input, input_id: input_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_input ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_input({ parent: parent, input: input, input_id: input_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_input(::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_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_input_client_stub.call_count - end - end - end - - def test_list_inputs - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.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_inputs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_inputs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_inputs_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_inputs({ 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_inputs 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_inputs ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs({ 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_inputs(::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs_client_stub.call_count - end - end - end - - def test_get_input - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::Input.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_input({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_input name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_input ::Google::Cloud::Video::LiveStream::V1::GetInputRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_input({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_input(::Google::Cloud::Video::LiveStream::V1::GetInputRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_input_client_stub.call_count - end - end - end - - def test_delete_input - # 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_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_input({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_input name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_input ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input({ 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_input(::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input_client_stub.call_count - end - end - end - - def test_update_input - # 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. - update_mask = {} - input = {} - request_id = "hello world" - - update_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_input({ update_mask: update_mask, input: input, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_input update_mask: update_mask, input: input, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_input ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_input({ update_mask: update_mask, input: input, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_input(::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_input_client_stub.call_count - end - end - end - - def test_preview_input - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - preview_input_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_preview_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, preview_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.preview_input({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.preview_input name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.preview_input ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.preview_input({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.preview_input(::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, preview_input_client_stub.call_count - end - end - end - - def test_create_event - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::Event.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - event = {} - event_id = "hello world" - request_id = "hello world" - - create_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_event_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_event({ parent: parent, event: event, event_id: event_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_event parent: parent, event: event, event_id: event_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_event ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_event({ parent: parent, event: event, event_id: event_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_event(::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_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_event_client_stub.call_count - end - end - end - - def test_list_events - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.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_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_events_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_events({ 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_events 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_events ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events_client_stub.call_count - end - end - end - - def test_get_event - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::Event.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_event_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_event({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_event name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_event ::Google::Cloud::Video::LiveStream::V1::GetEventRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_event({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_event(::Google::Cloud::Video::LiveStream::V1::GetEventRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_event_client_stub.call_count - end - end - end - - def test_delete_event - # 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" - request_id = "hello world" - - delete_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_event_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_event({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_event name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_event ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.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_event({ 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_event(::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.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_event_client_stub.call_count - end - end - end - - def test_list_clips - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse.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_clips_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_clips_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clips_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clips({ 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_clips 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_clips ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips({ 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_clips(::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips_client_stub.call_count - end - end - end - - def test_get_clip - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::Clip.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_clip_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_clip_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_clip_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_clip({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_clip name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_clip ::Google::Cloud::Video::LiveStream::V1::GetClipRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_clip({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_clip(::Google::Cloud::Video::LiveStream::V1::GetClipRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_clip_client_stub.call_count - end - end - end - - def test_create_clip - # 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" - clip_id = "hello world" - clip = {} - request_id = "hello world" - - create_clip_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_clip_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_clip_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_clip({ parent: parent, clip_id: clip_id, clip: clip, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_clip parent: parent, clip_id: clip_id, clip: clip, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_clip ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_clip({ parent: parent, clip_id: clip_id, clip: clip, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_clip(::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_clip_client_stub.call_count - end - end - end - - def test_delete_clip - # 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_clip_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_clip_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_clip_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_clip({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_clip name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_clip ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip({ 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_clip(::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip_client_stub.call_count - end - end - end - - def test_create_dvr_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" - dvr_session_id = "hello world" - dvr_session = {} - request_id = "hello world" - - create_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_dvr_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_dvr_session parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_dvr_session ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_dvr_session(::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_dvr_session_client_stub.call_count - end - end - end - - def test_list_dvr_sessions - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse.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_dvr_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_dvr_sessions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_dvr_sessions_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_dvr_sessions({ 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_dvr_sessions 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_dvr_sessions ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions({ 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_dvr_sessions(::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions_client_stub.call_count - end - end - end - - def test_get_dvr_session - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::DvrSession.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_dvr_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_dvr_session({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_dvr_session name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_dvr_session ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_dvr_session({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_dvr_session(::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_dvr_session_client_stub.call_count - end - end - end - - def test_delete_dvr_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_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_dvr_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_dvr_session({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_dvr_session name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_dvr_session ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_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_dvr_session(::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_session_client_stub.call_count - end - end - end - - def test_update_dvr_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. - update_mask = {} - dvr_session = {} - request_id = "hello world" - - update_dvr_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_dvr_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_dvr_session update_mask: update_mask, dvr_session: dvr_session, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_dvr_session ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_dvr_session(::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_dvr_session_client_stub.call_count - end - end - end - - def test_create_asset - # 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" - asset = {} - asset_id = "hello world" - request_id = "hello world" - - create_asset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_create_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_asset_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_asset({ parent: parent, asset: asset, asset_id: asset_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_asset parent: parent, asset: asset, asset_id: asset_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_asset ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_asset({ parent: parent, asset: asset, asset_id: asset_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_asset(::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_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_asset_client_stub.call_count - end - end - end - - def test_delete_asset - # 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_asset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_delete_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_asset_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_asset({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_asset name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_asset ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset({ 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_asset(::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset_client_stub.call_count - end - end - end - - def test_get_asset - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::Asset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_asset_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_asset_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_asset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_asset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_asset ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_asset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_asset(::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_asset_client_stub.call_count - end - end - end - - def test_list_assets - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.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_assets_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_assets({ 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_assets 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_assets ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets_client_stub.call_count - end - end - end - - def test_get_pool - # Create test objects. - client_result = ::Google::Cloud::Video::LiveStream::V1::Pool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_get_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_pool_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_pool({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_pool name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_pool ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_pool({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_pool(::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_pool_client_stub.call_count - end - end - end - - def test_update_pool - # 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. - update_mask = {} - pool = {} - request_id = "hello world" - - update_pool_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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::Video::LiveStream::V1::LivestreamService::Rest::ServiceStub.stub :transcode_update_pool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_pool_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_pool({ update_mask: update_mask, pool: pool, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_pool update_mask: update_mask, pool: pool, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_pool ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_pool({ update_mask: update_mask, pool: pool, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_pool(::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_pool_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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb deleted file mode 100644 index bf117eb14fe0..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/test/google/cloud/video/live_stream/v1/livestream_service_test.rb +++ /dev/null @@ -1,2336 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/video/livestream/v1/service_pb" -require "google/cloud/video/live_stream/v1/livestream_service" - -class ::Google::Cloud::Video::LiveStream::V1::LivestreamService::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_channel - # 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" - channel = {} - channel_id = "hello world" - request_id = "hello world" - - create_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_channel, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Channel), request["channel"] - assert_equal "hello world", request["channel_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_channel({ parent: parent, channel: channel, channel_id: channel_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_channel parent: parent, channel: channel, channel_id: channel_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_channel ::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_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_channel({ parent: parent, channel: channel, channel_id: channel_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_channel(::Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new(parent: parent, channel: channel, channel_id: channel_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_channel_client_stub.call_rpc_count - end - end - - def test_list_channels - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListChannelsResponse.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_channels_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_channels, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest, 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_channels_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_channels({ 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_channels 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_channels ::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels({ 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_channels(::Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.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_channels_client_stub.call_rpc_count - end - end - - def test_get_channel - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::Channel.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_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_channel, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_channel({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_channel name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_channel ::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_channel({ 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_channel(::Google::Cloud::Video::LiveStream::V1::GetChannelRequest.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_channel_client_stub.call_rpc_count - end - end - - def test_delete_channel - # 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" - force = true - - delete_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_channel, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_channel({ name: name, request_id: request_id, force: force }) 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_channel name: name, request_id: request_id, force: force 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_channel ::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force) 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_channel({ name: name, request_id: request_id, force: force }, 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_channel(::Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new(name: name, request_id: request_id, force: force), 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_channel_client_stub.call_rpc_count - end - end - - def test_update_channel - # 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. - update_mask = {} - channel = {} - request_id = "hello world" - - update_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_channel, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Channel), request["channel"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_channel({ update_mask: update_mask, channel: channel, 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_channel update_mask: update_mask, channel: channel, 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_channel ::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, 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_channel({ update_mask: update_mask, channel: channel, 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_channel(::Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new(update_mask: update_mask, channel: channel, 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_channel_client_stub.call_rpc_count - end - end - - def test_start_channel - # 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" - - start_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_channel, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_channel({ 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.start_channel 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.start_channel ::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.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.start_channel({ 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.start_channel(::Google::Cloud::Video::LiveStream::V1::StartChannelRequest.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, start_channel_client_stub.call_rpc_count - end - end - - def test_stop_channel - # 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" - - stop_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_channel, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_channel_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_channel({ 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.stop_channel 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.stop_channel ::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.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.stop_channel({ 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.stop_channel(::Google::Cloud::Video::LiveStream::V1::StopChannelRequest.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, stop_channel_client_stub.call_rpc_count - end - end - - def test_start_distribution - # 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" - distribution_keys = ["hello world"] - request_id = "hello world" - - start_distribution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_distribution, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["distribution_keys"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_distribution_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution name: name, distribution_keys: distribution_keys, 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_distribution ::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution(::Google::Cloud::Video::LiveStream::V1::StartDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution_client_stub.call_rpc_count - end - end - - def test_stop_distribution - # 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" - distribution_keys = ["hello world"] - request_id = "hello world" - - stop_distribution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_distribution, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["distribution_keys"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_distribution_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution name: name, distribution_keys: distribution_keys, 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_distribution ::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution({ name: name, distribution_keys: distribution_keys, 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_distribution(::Google::Cloud::Video::LiveStream::V1::StopDistributionRequest.new(name: name, distribution_keys: distribution_keys, 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_distribution_client_stub.call_rpc_count - end - end - - def test_create_input - # 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" - input = {} - input_id = "hello world" - request_id = "hello world" - - create_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_input, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Input), request["input"] - assert_equal "hello world", request["input_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_input({ parent: parent, input: input, input_id: input_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_input parent: parent, input: input, input_id: input_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_input ::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_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_input({ parent: parent, input: input, input_id: input_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_input(::Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new(parent: parent, input: input, input_id: input_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_input_client_stub.call_rpc_count - end - end - - def test_list_inputs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListInputsResponse.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_inputs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_inputs, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest, 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_inputs_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_inputs({ 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_inputs 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_inputs ::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs({ 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_inputs(::Google::Cloud::Video::LiveStream::V1::ListInputsRequest.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_inputs_client_stub.call_rpc_count - end - end - - def test_get_input - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::Input.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_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_input, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetInputRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_input({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_input name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_input ::Google::Cloud::Video::LiveStream::V1::GetInputRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_input({ 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_input(::Google::Cloud::Video::LiveStream::V1::GetInputRequest.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_input_client_stub.call_rpc_count - end - end - - def test_delete_input - # 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_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_input, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_input({ 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_input 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_input ::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input({ 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_input(::Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.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_input_client_stub.call_rpc_count - end - end - - def test_update_input - # 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. - update_mask = {} - input = {} - request_id = "hello world" - - update_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_input, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Input), request["input"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_input({ update_mask: update_mask, input: input, 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_input update_mask: update_mask, input: input, 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_input ::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, 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_input({ update_mask: update_mask, input: input, 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_input(::Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new(update_mask: update_mask, input: input, 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_input_client_stub.call_rpc_count - end - end - - def test_preview_input - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::PreviewInputResponse.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" - - preview_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :preview_input, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, preview_input_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.preview_input({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.preview_input name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.preview_input ::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.preview_input({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.preview_input(::Google::Cloud::Video::LiveStream::V1::PreviewInputRequest.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, preview_input_client_stub.call_rpc_count - end - end - - def test_create_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::Event.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" - event = {} - event_id = "hello world" - request_id = "hello world" - - create_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_event, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Event), request["event"] - assert_equal "hello world", request["event_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_event_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_event({ parent: parent, event: event, event_id: event_id, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_event parent: parent, event: event, event_id: event_id, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_event ::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_id, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_event({ parent: parent, event: event, event_id: event_id, 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.create_event(::Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new(parent: parent, event: event, event_id: event_id, 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, create_event_client_stub.call_rpc_count - end - end - - def test_list_events - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListEventsResponse.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_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_events, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest, 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_events_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_events({ 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_events 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_events ::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::Video::LiveStream::V1::ListEventsRequest.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_events_client_stub.call_rpc_count - end - end - - def test_get_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::Event.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_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_event, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetEventRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_event_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_event({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_event name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_event ::Google::Cloud::Video::LiveStream::V1::GetEventRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_event({ 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_event(::Google::Cloud::Video::LiveStream::V1::GetEventRequest.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_event_client_stub.call_rpc_count - end - end - - def test_delete_event - # 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" - request_id = "hello world" - - delete_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_event, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_event_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_event({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_event name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_event ::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_event({ name: name, 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.delete_event(::Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new(name: name, 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, delete_event_client_stub.call_rpc_count - end - end - - def test_list_clips - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListClipsResponse.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_clips_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clips, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, 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_clips_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clips({ 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_clips 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_clips ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips({ 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_clips(::Google::Cloud::Video::LiveStream::V1::ListClipsRequest.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_clips_client_stub.call_rpc_count - end - end - - def test_get_clip - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::Clip.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_clip_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_clip, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetClipRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_clip_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_clip({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_clip name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_clip ::Google::Cloud::Video::LiveStream::V1::GetClipRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_clip({ 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_clip(::Google::Cloud::Video::LiveStream::V1::GetClipRequest.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_clip_client_stub.call_rpc_count - end - end - - def test_create_clip - # 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" - clip_id = "hello world" - clip = {} - request_id = "hello world" - - create_clip_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_clip, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["clip_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Clip), request["clip"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_clip_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_clip({ parent: parent, clip_id: clip_id, clip: clip, 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_clip parent: parent, clip_id: clip_id, clip: clip, 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_clip ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, 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_clip({ parent: parent, clip_id: clip_id, clip: clip, 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_clip(::Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new(parent: parent, clip_id: clip_id, clip: clip, 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_clip_client_stub.call_rpc_count - end - end - - def test_delete_clip - # 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_clip_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_clip, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_clip_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_clip({ 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_clip 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_clip ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip({ 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_clip(::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.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_clip_client_stub.call_rpc_count - end - end - - def test_create_dvr_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" - dvr_session_id = "hello world" - dvr_session = {} - request_id = "hello world" - - create_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_dvr_session, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["dvr_session_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::DvrSession), request["dvr_session"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session ::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session({ parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session(::Google::Cloud::Video::LiveStream::V1::CreateDvrSessionRequest.new(parent: parent, dvr_session_id: dvr_session_id, dvr_session: dvr_session, 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_dvr_session_client_stub.call_rpc_count - end - end - - def test_list_dvr_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsResponse.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_dvr_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_dvr_sessions, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest, 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_dvr_sessions_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_dvr_sessions({ 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_dvr_sessions 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_dvr_sessions ::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions({ 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_dvr_sessions(::Google::Cloud::Video::LiveStream::V1::ListDvrSessionsRequest.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_dvr_sessions_client_stub.call_rpc_count - end - end - - def test_get_dvr_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::DvrSession.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_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_dvr_session, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_dvr_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_dvr_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_dvr_session ::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_dvr_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_dvr_session(::Google::Cloud::Video::LiveStream::V1::GetDvrSessionRequest.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_dvr_session_client_stub.call_rpc_count - end - end - - def test_delete_dvr_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_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_dvr_session, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_dvr_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_dvr_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_dvr_session ::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_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_dvr_session(::Google::Cloud::Video::LiveStream::V1::DeleteDvrSessionRequest.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_dvr_session_client_stub.call_rpc_count - end - end - - def test_update_dvr_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. - update_mask = {} - dvr_session = {} - request_id = "hello world" - - update_dvr_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_dvr_session, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::DvrSession), request["dvr_session"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_dvr_session_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session ::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session({ update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session(::Google::Cloud::Video::LiveStream::V1::UpdateDvrSessionRequest.new(update_mask: update_mask, dvr_session: dvr_session, 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_dvr_session_client_stub.call_rpc_count - end - end - - def test_create_asset - # 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" - asset = {} - asset_id = "hello world" - request_id = "hello world" - - create_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_asset, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Asset), request["asset"] - assert_equal "hello world", request["asset_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_asset_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_asset({ parent: parent, asset: asset, asset_id: asset_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_asset parent: parent, asset: asset, asset_id: asset_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_asset ::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_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_asset({ parent: parent, asset: asset, asset_id: asset_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_asset(::Google::Cloud::Video::LiveStream::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_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_asset_client_stub.call_rpc_count - end - end - - def test_delete_asset - # 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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_asset, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_asset_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_asset({ 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_asset 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_asset ::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset({ 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_asset(::Google::Cloud::Video::LiveStream::V1::DeleteAssetRequest.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_asset_client_stub.call_rpc_count - end - end - - def test_get_asset - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::Asset.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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_asset, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_asset_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_asset({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_asset name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_asset ::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_asset({ 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_asset(::Google::Cloud::Video::LiveStream::V1::GetAssetRequest.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_asset_client_stub.call_rpc_count - end - end - - def test_list_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::ListAssetsResponse.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_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_assets, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest, 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_assets_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_assets({ 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_assets 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_assets ::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::Video::LiveStream::V1::ListAssetsRequest.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_assets_client_stub.call_rpc_count - end - end - - def test_get_pool - # Create GRPC objects. - grpc_response = ::Google::Cloud::Video::LiveStream::V1::Pool.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_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_pool, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_pool_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_pool({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_pool name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_pool ::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_pool({ 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_pool(::Google::Cloud::Video::LiveStream::V1::GetPoolRequest.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_pool_client_stub.call_rpc_count - end - end - - def test_update_pool - # 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. - update_mask = {} - pool = {} - request_id = "hello world" - - update_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_pool, name - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Video::LiveStream::V1::Pool), request["pool"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_pool_client_stub do - # Create client - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_pool({ update_mask: update_mask, pool: pool, 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_pool update_mask: update_mask, pool: pool, 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_pool ::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, 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_pool({ update_mask: update_mask, pool: pool, 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_pool(::Google::Cloud::Video::LiveStream::V1::UpdatePoolRequest.new(update_mask: update_mask, pool: pool, 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_pool_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::Video::LiveStream::V1::LivestreamService::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::Video::LiveStream::V1::LivestreamService::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client, client - assert_equal creds, client.configure.credentials - end - 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::Video::LiveStream::V1::LivestreamService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb b/owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-video-live_stream-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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"